From f35db785b5f4e7042f2baf8025d34f2b0e71b2a3 Mon Sep 17 00:00:00 2001 From: Stefan Jansen Date: Tue, 24 Sep 2024 20:25:01 -0400 Subject: [PATCH 1/4] version updates --- .github/workflows/build_wheels.yml | 2 +- .github/workflows/unit_tests.yml | 2 ++ pyproject.toml | 25 +++++++++++++++++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index ca184268..f54a02f9 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -57,7 +57,7 @@ jobs: with: user: __token__ password: ${{ secrets.TESTPYPI_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ - name: publish to pypi if: ${{ github.event.inputs.target == 'PYPI' }} diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 01f19f51..6fd7f58c 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -2,6 +2,8 @@ name: Tests on: workflow_dispatch: + schedule: + - cron: "0 9 * * 6" push: branches: - main diff --git a/pyproject.toml b/pyproject.toml index 8fe4f003..57baf008 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,10 +31,12 @@ classifiers = [ ] dependencies = [ + # following pandas + "numpy>=1.23.5; python_version<'3.12'", + "numpy>=1.26.0; python_version>='3.12'", + "pandas >=1.3.0,<3.0", "ipython >=3.2.3", "matplotlib >=1.4.0", - "numpy >=1.11.1", - "pandas >=1.3", "pytz >=2014.10", "scipy >=0.14.0", "scikit-learn >=0.16.1", @@ -99,7 +101,8 @@ version_scheme = 'guess-next-dev' local_scheme = 'dirty-tag' -[tool.pytest] +[tool.pytest.ini_options] +pythonpath = ['src'] minversion = "6.0" testpaths = 'tests' addopts = '-v' @@ -134,7 +137,17 @@ extend-exclude = ''' [tool.tox] legacy_tox_ini = """ [tox] -envlist = py{39,310}-pandas{13,14,15}, py{39,310, 311,312}-pandas{20,21,22} + +envlist = + py39-pandas{13,14,15}-numpy1 + py310-pandas{13,14,15,20,21,22}-numpy1 + py311-pandas{13,14,15,20,21,22}-numpy1 + py312-pandas{13,14,15,20,21,22}-numpy1 + py39-pandas222-numpy2 + py310-pandas222-numpy2 + py311-pandas222-numpy2 + py312-pandas222-numpy2 + isolated_build = True skip_missing_interpreters = True minversion = 3.23.0 @@ -160,6 +173,10 @@ deps = pandas20: pandas>=2.0,<2.1 pandas21: pandas>=2.1,<2.2 pandas22: pandas>=2.2,<2.3 + pandas222: pandas>=2.2.2,<2.3 + numpy1: numpy>=1.23.5,<2.0 + numpy2: numpy>=2.0,<2.1 + commands = pytest -n 2 --cov={toxinidir}/src --cov-report term --cov-report=xml --cov-report=html:htmlcov {toxinidir}/tests From b560efb2abd22373e5c0acb9ab4620c76629b4a4 Mon Sep 17 00:00:00 2001 From: Stefan Jansen Date: Wed, 25 Sep 2024 16:53:29 -0400 Subject: [PATCH 2/4] skip sharpe test on pandas 14 due to macos CI error --- tests/test_timeseries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_timeseries.py b/tests/test_timeseries.py index f2f044bc..6e92e8f1 100644 --- a/tests/test_timeseries.py +++ b/tests/test_timeseries.py @@ -297,7 +297,7 @@ class TestStats(TestCase): ) ] ) - @skipIf(pandas_one_point_three_or_less, "pandas<=1.3 returns np.inf not np.nan") + @skipIf(pandas_one_point_three_or_less, "pandas<=1.4 returns np.inf not np.nan") def test_sharpe_2(self, returns, rolling_sharpe_window, expected): np.testing.assert_array_almost_equal( timeseries.rolling_sharpe(returns, rolling_sharpe_window).to_numpy(), From 2850edb768786e001b972f825dada1aa69637ddd Mon Sep 17 00:00:00 2001 From: Stefan Jansen Date: Wed, 25 Sep 2024 21:30:06 -0400 Subject: [PATCH 3/4] skip sharpe test on pandas 14 due to macos CI error --- src/pyfolio/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyfolio/utils.py b/src/pyfolio/utils.py index a233d661..88c65d3e 100644 --- a/src/pyfolio/utils.py +++ b/src/pyfolio/utils.py @@ -70,7 +70,7 @@ pandas_version = Version(pd.__version__) -pandas_one_point_three_or_less = pandas_version < Version("1.4") +pandas_one_point_three_or_less = pandas_version <= Version("1.4") def one_dec_places(x, pos): From c325cd4d1868d711371cc2c768424ae6c327de15 Mon Sep 17 00:00:00 2001 From: Stefan Jansen Date: Wed, 25 Sep 2024 21:35:43 -0400 Subject: [PATCH 4/4] gha wheels update --- .github/workflows/build_wheels.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index f54a02f9..6b32afcd 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -9,6 +9,11 @@ on: required: true default: 'PYPI' options: [ 'TESTPYPI', 'PYPI' ] + version: + type: string + description: 'Version tag' + required: true + default: '0.9.8' jobs: dist: @@ -24,7 +29,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: 0.9.7 + ref: ${{ github.event.inputs.version }} - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5