From 9f31abeeaaef55ac73ef8c08152bec8fb505e21e Mon Sep 17 00:00:00 2001 From: Stefan Jansen Date: Tue, 14 May 2024 10:09:55 -0400 Subject: [PATCH] v0.9.7 (#47) * fix GHA workflows * address seaborn 0.13 error --- .github/workflows/build_wheels.yml | 10 ++++++---- .github/workflows/test_wheels.yml | 19 ++++++++++++++----- src/pyfolio/plotting.py | 2 +- tests/test_tears.py | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 7d0dba08..88cbf9ec 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -6,8 +6,8 @@ on: publish_to_pypi: description: 'Publish to PyPI?' required: true - type: boolean - default: false + type: string + default: 'false' jobs: dist: @@ -23,6 +23,8 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + ref: '0.9.7' + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -51,7 +53,7 @@ jobs: - name: publish to testpypi uses: pypa/gh-action-pypi-publish@release/v1 - if: ${{ inputs.publish_to_pypi == false }} + if: ${{ inputs.publish_to_pypi == 'false' }} with: user: __token__ password: ${{ secrets.TESTPYPI_TOKEN }} @@ -59,7 +61,7 @@ jobs: - name: publish to pypi uses: pypa/gh-action-pypi-publish@release/v1 - if: ${{ inputs.publish_to_pypi == true }} + if: ${{ inputs.publish_to_pypi == 'true' }} with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/test_wheels.yml b/.github/workflows/test_wheels.yml index 4a4c9db8..07b91c14 100644 --- a/.github/workflows/test_wheels.yml +++ b/.github/workflows/test_wheels.yml @@ -16,8 +16,17 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install wheel - run: | - pip install -U pip wheel - pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pyfolio-reloaded[test] - pytest tests + - name: Checkout pyfolio + uses: actions/checkout@v4 + + - name: Unittests with tox & pytest + uses: nick-fields/retry@v3 + with: + timeout_minutes: 90 + max_attempts: 3 + retry_on: error + new_command_on_retry: | + python -m pip install -U pip wheel tox tox-gh-actions + python -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pyfolio-reloaded[test] + tox + command: tox -p auto -q diff --git a/src/pyfolio/plotting.py b/src/pyfolio/plotting.py index e23e76b5..361f84c9 100644 --- a/src/pyfolio/plotting.py +++ b/src/pyfolio/plotting.py @@ -1377,7 +1377,7 @@ def plot_return_quantiles(returns, live_start_date=None, ax=None, **kwargs): is_weekly = ep.aggregate_returns(is_returns, "weekly") is_monthly = ep.aggregate_returns(is_returns, "monthly") sns.boxplot( - data=[is_returns, is_weekly, is_monthly], + data=[is_returns.values, is_weekly.values, is_monthly.values], palette=["#4c72B0", "#55A868", "#CCB974"], ax=ax, **kwargs, diff --git a/tests/test_tears.py b/tests/test_tears.py index 86b809b4..e1d1894d 100644 --- a/tests/test_tears.py +++ b/tests/test_tears.py @@ -110,7 +110,7 @@ class PositionsTestCase(TestCase): @parameterized.expand( [ ({},), - # ({"slippage": 1},), + ({"slippage": 1},), ({"live_start_date": test_returns.index[-20]},), ({"round_trips": True},), ({"hide_positions": True},),