diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 26676b014..e8380f5f2 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -8,7 +8,7 @@ on: - cron: "40 06 * * SAT" jobs: - latest p9, latest matplotlib: + latest-p9_latest-matplotlib: runs-on: ubuntu-latest strategy: @@ -52,7 +52,7 @@ jobs: path: result_images/ if-no-files-found: ignore - latest p9, latest pandas: + latest-p9_latest-pandas: runs-on: ubuntu-latest strategy: @@ -77,19 +77,16 @@ jobs: run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV - name: Install Packages - shell: bash run: | - uv pip install --upgrade git+https://github.com/pandas-dev/pandas uv pip install ".[extra,test]" + uv pip install --upgrade git+https://github.com/pandas-dev/pandas - name: Environment Information - shell: bash run: | uv pip list # to do: think about catching deprecations earlier - name: Run Tests - shell: bash run: | make test @@ -100,7 +97,7 @@ jobs: path: result_images/ if-no-files-found: ignore - stable p9, latest matplotlib: + stable-p9_latest-matplotlib: runs-on: ubuntu-latest strategy: @@ -110,12 +107,10 @@ jobs: steps: - name: Get latest release with tag from GitHub API id: latestrelease - shell: bash run: | echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/has2k1/plotnine/releases/latest | jq '.tag_name' | sed 's/\"//g')" - name: Confirm Release Tag - shell: bash run: | echo ${{ steps.latestrelease.outputs.latestrelease }} @@ -138,18 +133,15 @@ jobs: run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV - name: Install Packages - shell: bash run: | uv pip install --upgrade git+https://github.com/matplotlib/matplotlib uv pip install ".[extra,test]" - name: Environment Information - shell: bash run: | uv pip list - name: Run Tests - shell: bash run: | make test @@ -160,7 +152,7 @@ jobs: path: result_images/ if-no-files-found: ignore - stable p9, latest pandas: + stable-p9_latest-pandas: runs-on: ubuntu-latest strategy: @@ -170,12 +162,10 @@ jobs: steps: - name: Get latest release with tag from GitHub API id: latestrelease - shell: bash run: | echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/has2k1/plotnine/releases/latest | jq '.tag_name' | sed 's/\"//g')" - name: Confirm Release Tag - shell: bash run: | echo ${{ steps.latestrelease.outputs.latestrelease }} @@ -198,19 +188,16 @@ jobs: run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV - name: Install Packages - shell: bash run: | uv pip install --upgrade git+https://github.com/pandas-dev/pandas uv pip install ".[extra,test]" - name: Environment Information - shell: bash run: | uv pip list # to do: think about catching deprecations earlier - name: Run Tests - shell: bash run: | make test @@ -221,7 +208,7 @@ jobs: path: tests/result_images/ if-no-files-found: ignore - TYP latest p9, latest matplotlib: + TYP_latest-p9_latest-matplotlib: runs-on: ubuntu-latest strategy: @@ -246,22 +233,19 @@ jobs: run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV - name: Install Packages - shell: bash run: | uv pip install ".[extra,typing]" uv pip install --upgrade git+https://github.com/matplotlib/matplotlib - name: Environment Information - shell: bash run: | uv pip list - name: Run Tests - shell: bash run: | make typecheck - TYP latest p9, latest pandas: + TYP_latest-p9_latest-pandas: runs-on: ubuntu-latest strategy: @@ -286,21 +270,18 @@ jobs: run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV - name: Install Packages - shell: bash run: | uv pip install ".[extra,typing]" uv pip install --upgrade git+https://github.com/pandas-dev/pandas - name: Environment Information - shell: bash run: | uv pip list # to do: think about catching deprecations earlier - name: Run Tests - shell: bash run: | - make test + make typecheck - uses: actions/upload-artifact@v3 if: failure() diff --git a/plotnine/ggplot.py b/plotnine/ggplot.py index 63b1c6e4b..afab59481 100755 --- a/plotnine/ggplot.py +++ b/plotnine/ggplot.py @@ -783,7 +783,7 @@ def facet_pages(column) if verbose: warn(f"Filename: {filename}", PlotnineWarning) - with PdfPages(filename, keep_empty=False) as pdf: + with PdfPages(filename) as pdf: # Re-add the first element to the iterator, if it was removed for plot in plots: fig = plot.draw() diff --git a/pyproject.toml b/pyproject.toml index 17bc0f14e..0e0c41c4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ dev = [ ] typing = [ - "pyright==1.1.374", + "pyright==1.1.385", "ipython", "pandas-stubs", ] diff --git a/tests/test_save_as_pdf_pages.py b/tests/test_save_as_pdf_pages.py index 8e3f1bd0f..1dc665d62 100644 --- a/tests/test_save_as_pdf_pages.py +++ b/tests/test_save_as_pdf_pages.py @@ -57,7 +57,7 @@ def test_save_method(self): with warnings.catch_warnings(record=True) as record: save_as_pdf_pages(p(), fn, verbose=False) assert_exist_and_clean(fn, "save method") - assert not record, "Issued an unexpected warning" + assert not record, f"Unexpected warnings" res = ("filename" in str(item.message).lower() for item in record) assert not any(res) @@ -91,6 +91,10 @@ def test_plot_exception(self): with pytest.raises(PlotnineError): save_as_pdf_pages(plots, fn, verbose=False) + # TODO: Remove when MPL>=3.10.0 + if fn.exists(): + fn.unlink() + assert not fn.exists()