diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index ca184268..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 @@ -57,7 +62,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 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): 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(),