From 69ddea7174c7fa84af8e764de68a2cf53cef2f68 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Wed, 15 Nov 2023 17:00:06 -0500 Subject: [PATCH 1/9] fix(ci): update versions of everything including python --- .github/workflows/actions.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 25186bae..04271db8 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,9 +20,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ env.default-python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ env.default-python }} - name: Upgrade pip, Install nox @@ -38,9 +38,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ env.default-python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ env.default-python }} - name: Upgrade pip, Install nox @@ -75,12 +75,12 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Determine pip cache directory @@ -88,7 +88,7 @@ jobs: run: | echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip${{ matrix.python-version }} @@ -105,9 +105,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ env.default-python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ env.default-python }} - name: Upgrade pip and install nox @@ -129,7 +129,7 @@ jobs: - build-docs steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: python -m pip install wheel - name: Set version @@ -161,4 +161,4 @@ jobs: body_path: ${{ github.workspace }}-CHANGELOG.md files: | dist/*.tar.gz - dist/*.whl \ No newline at end of file + dist/*.whl From 7d9b518edfb50c352d62f4e5e43b0802b1de699a Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Wed, 15 Nov 2023 17:03:54 -0500 Subject: [PATCH 2/9] docs: add changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ffbe882..38ad393e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Usage of `if __name__ == "__main__"` where it was only intended for testing purposes ([#756](https://github.com/pdfminer/pdfminer.six/pull/756)) +## [20231115] + +### Fixed + +- Update list of Python versions for CI + ## [20220524] ### Fixed From 0b351ef077f182a254398db9ba8c10070eece4c5 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Wed, 15 Nov 2023 17:22:00 -0500 Subject: [PATCH 3/9] fix(ci): use black from last year --- CHANGELOG.md | 1 + noxfile.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38ad393e..ce567f11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Update list of Python versions for CI +- Version dependency on `black` to avoid CI failures ## [20220524] diff --git a/noxfile.py b/noxfile.py index f55bbadb..7f892c6c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -3,13 +3,13 @@ import nox -PYTHON_ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] +PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"] PYTHON_MODULES = ["pdfminer", "tools", "tests", "noxfile.py", "setup.py"] @nox.session def format(session): - session.install("black") + session.install("black<23") # Format files locally with black, but only check in cicd if "CI" in os.environ: session.run("black", "--check", *PYTHON_MODULES) From c396fa75c3158abfbd6421f00409ed634ad6c0b0 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Wed, 15 Nov 2023 17:29:38 -0500 Subject: [PATCH 4/9] fix(ci): fix linting and typechecking issues --- CHANGELOG.md | 5 ++++- noxfile.py | 2 +- pdfminer/image.py | 2 +- tests/test_converter.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce567f11..c27e16ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Update list of Python versions for CI -- Version dependency on `black` to avoid CI failures +- Version dependency on `black` to avoid CI failures (for now, should reformat) +- Fix a `flake8` error in `tests/test_converter.py` +- Version dependency on `mypy` to avoid CI failures (for now, should fix) +- Correct `type: ignore` comment in `pdfplumber/image.py` ## [20220524] diff --git a/noxfile.py b/noxfile.py index 7f892c6c..12489fb0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -25,7 +25,7 @@ def lint(session): @nox.session def types(session): - session.install("mypy") + session.install("mypy<1") session.run( "mypy", "--install-types", diff --git a/pdfminer/image.py b/pdfminer/image.py index 61c2673e..d72a10cd 100644 --- a/pdfminer/image.py +++ b/pdfminer/image.py @@ -8,7 +8,7 @@ from typing import Literal except ImportError: # Literal was introduced in Python 3.8 - from typing_extensions import Literal # type: ignore[misc] + from typing_extensions import Literal # type: ignore[assignment] from .jbig2 import JBIG2StreamReader, JBIG2StreamWriter from .layout import LTImage diff --git a/tests/test_converter.py b/tests/test_converter.py index 5bd560e9..3a3fff90 100644 --- a/tests/test_converter.py +++ b/tests/test_converter.py @@ -173,7 +173,7 @@ def get_types(path): # they all have shape 'ml' not 'mlh' ml_pdf = extract_pages("samples/contrib/pr-00530-ml-lines.pdf") ml_pdf_page = list(ml_pdf)[0] - assert sum(type(item) == LTLine for item in ml_pdf_page) == 6 + assert sum(type(item) is LTLine for item in ml_pdf_page) == 6 def _get_analyzer(self): analyzer = PDFLayoutAnalyzer(None) From 3362d8962d5fd0c36553ed809d09f12d3b9c6fac Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Wed, 15 Nov 2023 17:30:25 -0500 Subject: [PATCH 5/9] docs: put CHANGELOG entries in the right place --- CHANGELOG.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c27e16ab..7158de28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed +- Update list of Python versions for CI +- Version dependency on `black` to avoid CI failures (for now, should reformat) +- Fix a `flake8` error in `tests/test_converter.py` +- Version dependency on `mypy` to avoid CI failures (for now, should fix) +- Correct `type: ignore` comment in `pdfplumber/image.py` - `ValueError` when bmp images with 1 bit channel are decoded ([#773](https://github.com/pdfminer/pdfminer.six/issues/773)) - `ValueError` when trying to decrypt empty metadata values ([#766](https://github.com/pdfminer/pdfminer.six/issues/766)) - Sphinx errors during building of documentation ([#760](https://github.com/pdfminer/pdfminer.six/pull/760)) @@ -28,16 +33,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Usage of `if __name__ == "__main__"` where it was only intended for testing purposes ([#756](https://github.com/pdfminer/pdfminer.six/pull/756)) -## [20231115] - -### Fixed - -- Update list of Python versions for CI -- Version dependency on `black` to avoid CI failures (for now, should reformat) -- Fix a `flake8` error in `tests/test_converter.py` -- Version dependency on `mypy` to avoid CI failures (for now, should fix) -- Correct `type: ignore` comment in `pdfplumber/image.py` - ## [20220524] ### Fixed From 730988d3ab3426b321995a6c36e6183e350fd8a2 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Wed, 15 Nov 2023 17:40:28 -0500 Subject: [PATCH 6/9] fix(ci): use older pip/setuptools to tolerate bogus -VERSION- --- CHANGELOG.md | 5 +++-- noxfile.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7158de28..fa3de185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Update list of Python versions for CI -- Version dependency on `black` to avoid CI failures (for now, should reformat) +- Version dependency on `black` in tests to avoid CI failures (for now, should reformat) - Fix a `flake8` error in `tests/test_converter.py` -- Version dependency on `mypy` to avoid CI failures (for now, should fix) +- Version dependency on `mypy` in tests to avoid CI failures (for now, should fix) - Correct `type: ignore` comment in `pdfplumber/image.py` +- Version dependency on `pip` and `setuptools` in tests to avoid CI failures (for now, should *really* fix that bogus version string!) - `ValueError` when bmp images with 1 bit channel are decoded ([#773](https://github.com/pdfminer/pdfminer.six/issues/773)) - `ValueError` when trying to decrypt empty metadata values ([#766](https://github.com/pdfminer/pdfminer.six/issues/766)) - Sphinx errors during building of documentation ([#760](https://github.com/pdfminer/pdfminer.six/pull/760)) diff --git a/noxfile.py b/noxfile.py index 12489fb0..30ec9fb3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -37,6 +37,8 @@ def types(session): @nox.session(python=PYTHON_ALL_VERSIONS) def tests(session): + session.install("pip<23") + session.install("setuptools<58") session.install("-e", ".[dev]") session.run("pytest") From 51657c0760b24cadf46fc87a8b576d6f74259bb4 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Wed, 15 Nov 2023 17:44:42 -0500 Subject: [PATCH 7/9] fix(ci): skip 3.12 for now, fix remaining nox --- .github/workflows/actions.yml | 2 +- noxfile.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 04271db8..6a174ebe 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -75,7 +75,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.8", "3.9", "3.10", "3.11" ] # should have 3.12 too! steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/noxfile.py b/noxfile.py index 30ec9fb3..95677bcf 100644 --- a/noxfile.py +++ b/noxfile.py @@ -3,7 +3,7 @@ import nox -PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"] +PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11"] # should have 3.12 PYTHON_MODULES = ["pdfminer", "tools", "tests", "noxfile.py", "setup.py"] @@ -45,6 +45,8 @@ def tests(session): @nox.session def docs(session): + session.install("pip<23") + session.install("setuptools<58") session.install("-e", ".[docs]") session.run( "python", "-m", "sphinx", "-b", "html", "docs/source", "docs/build/html" From 64ccc957d01596099a65209878958544165c5bb5 Mon Sep 17 00:00:00 2001 From: Pieter Marsman Date: Fri, 24 Nov 2023 19:25:18 +0100 Subject: [PATCH 8/9] Update minimum Python version in the README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 182ffcf8..0015bb08 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Features How to use ---------- -* Install Python 3.6 or newer. +* Install Python 3.8 or newer. * Install pdfminer.six. `pip install pdfminer.six` From 8b49becafa5102ea6a666a0afefb34e06eb78458 Mon Sep 17 00:00:00 2001 From: Pieter Marsman Date: Fri, 24 Nov 2023 19:30:16 +0100 Subject: [PATCH 9/9] Simplify lines in CHANGELOG.md --- CHANGELOG.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa3de185..f7e3b193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Removed +- Support for Python 3.6 and 3.7 ([#921](https://github.com/pdfminer/pdfminer.six/pull/921)) + ### Added - Output converter for the hOCR format ([#651](https://github.com/pdfminer/pdfminer.six/pull/651)) @@ -14,12 +17,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed -- Update list of Python versions for CI -- Version dependency on `black` in tests to avoid CI failures (for now, should reformat) -- Fix a `flake8` error in `tests/test_converter.py` -- Version dependency on `mypy` in tests to avoid CI failures (for now, should fix) -- Correct `type: ignore` comment in `pdfplumber/image.py` -- Version dependency on `pip` and `setuptools` in tests to avoid CI failures (for now, should *really* fix that bogus version string!) +- Broken CI/CD pipeline by setting upper version limit for black, mypy, pip and setuptools ([#921](https://github.com/pdfminer/pdfminer.six/pull/921)) +- `flake8` failures ([#921](https://github.com/pdfminer/pdfminer.six/pull/921)) - `ValueError` when bmp images with 1 bit channel are decoded ([#773](https://github.com/pdfminer/pdfminer.six/issues/773)) - `ValueError` when trying to decrypt empty metadata values ([#766](https://github.com/pdfminer/pdfminer.six/issues/766)) - Sphinx errors during building of documentation ([#760](https://github.com/pdfminer/pdfminer.six/pull/760))