From 231b29c2776128c1a8c8ab5d5cec765c00615966 Mon Sep 17 00:00:00 2001 From: "Jonathan G. Underwood" Date: Sat, 31 Dec 2022 00:26:27 +0000 Subject: [PATCH 1/5] Add .readthedocs.yml --- .readthedocs.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .readthedocs.yml diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..1ad8c58 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,25 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-20.04 + tools: + python: "3.11" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# If using Sphinx, optionally build your docs in additional formats such as PDF +formats: + - pdf + +# Optionally declare the Python requirements required to build your docs +python: + install: + - requirements: docs/requirements.txt From 837d0d68d1b97a91a432aecf0e983f8fe8d60ba3 Mon Sep 17 00:00:00 2001 From: David Evans Date: Thu, 21 Dec 2023 08:30:22 +0000 Subject: [PATCH 2/5] Use `importlib.metadata` over `pkg_resources` This is "The Modern Way" and is requoired for Python 3.12. https://docs.python.org/3.12/library/importlib.metadata.html As `importlib.metadata` was added in Python 3.8, and as we still support Python 3.7, we add a fallback import for older versions. --- docs/conf.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 51b6576..aefff88 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,8 +55,13 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -from pkg_resources import get_distribution -release = get_distribution('lz4').version +try: + import importlib.metadata +except ImportError: + from pkg_resources import get_distribution + release = get_distribution('lz4').version +else: + release = importlib.metadata.version('lz4') version = release # The language for content autogenerated by Sphinx. Refer to documentation From d41a6760eeed3800edf02ad862c976b5daedfd70 Mon Sep 17 00:00:00 2001 From: David Evans Date: Thu, 21 Dec 2023 08:09:25 +0000 Subject: [PATCH 3/5] Add Python 3.12 to the build matrix This required updating to the latest version of `pypa/cibuildwheel`. --- .github/workflows/build_dist.yml | 4 ++-- setup.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_dist.yml b/.github/workflows/build_dist.yml index 6fd9b2f..19999af 100644 --- a/.github/workflows/build_dist.yml +++ b/.github/workflows/build_dist.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - cibw_build: [cp37-*, cp38-*, cp39-*, cp310-*, cp311-*] + cibw_build: [cp37-*, cp38-*, cp39-*, cp310-*, cp311-*, cp312-*] steps: - name: Check out repository uses: actions/checkout@v3 @@ -51,7 +51,7 @@ jobs: with: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2.11.4 + uses: pypa/cibuildwheel@v2.16.2 env: CIBW_ENVIRONMENT: PYLZ4_USE_SYSTEM_LZ4="False" CIBW_ARCHS_LINUX: "x86_64 i686 aarch64" diff --git a/setup.py b/setup.py index 387f5c8..2fbd2ca 100644 --- a/setup.py +++ b/setup.py @@ -205,5 +205,6 @@ def pkgconfig_installed_check(lib, required_version, default): 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], ) From b8844b1443b449302dc973e49e895c0fe0d84374 Mon Sep 17 00:00:00 2001 From: David Evans Date: Thu, 21 Dec 2023 13:53:16 +0000 Subject: [PATCH 4/5] Add explicit dependency on `setuptools` --- .github/workflows/build_dist.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_dist.yml b/.github/workflows/build_dist.yml index 19999af..682b69d 100644 --- a/.github/workflows/build_dist.yml +++ b/.github/workflows/build_dist.yml @@ -22,6 +22,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.x + - name: Install setuptools + run: pip install setuptools - name: Build sdist run: python setup.py sdist - name: Save sdist From 7182e7d0bd7d70db65cc4f32cf0462c7fb71f5cb Mon Sep 17 00:00:00 2001 From: David Evans Date: Thu, 21 Dec 2023 14:11:30 +0000 Subject: [PATCH 5/5] Drop support for Python 3.7 This reached end-of-life in June 2023: https://devguide.python.org/versions/#unsupported-versions And attempting to build the wheel fails with an error: ``` docs: install_package_deps /project> python -I -m pip install sphinx-bootstrap-theme 'sphinx>=1.6.0' docs: install_package /project> python -I -m pip install --force-reinstall --no-deps /project/.tox/.tmp/package/3/lz4-0.1.dev1180+g91fe6ef-0.editable-cp37-cp37m-linux_x86_64.whl docs: commands[0] /project> make -C docs doctest html make: Entering directory `/project/docs' sphinx-build -b doctest -d _build/doctrees . _build/doctest Running Sphinx v5.3.0 Extension error: Could not import extension sphinx.builders.linkcheck (exception: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'. See: https://github.com/urllib3/urllib3/issues/2168) ``` --- .github/workflows/build_dist.yml | 2 +- docs/install.rst | 2 +- setup.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_dist.yml b/.github/workflows/build_dist.yml index 682b69d..fe70b79 100644 --- a/.github/workflows/build_dist.yml +++ b/.github/workflows/build_dist.yml @@ -37,7 +37,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - cibw_build: [cp37-*, cp38-*, cp39-*, cp310-*, cp311-*, cp312-*] + cibw_build: [cp38-*, cp39-*, cp310-*, cp311-*, cp312-*] steps: - name: Check out repository uses: actions/checkout@v3 diff --git a/docs/install.rst b/docs/install.rst index 3d531f7..664ffd3 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -22,7 +22,7 @@ The LZ4 bindings require linking to the LZ4 library, and so if there is not a pre-compiled wheel available for your platform you will need to have a suitable C compiler available, as well as the Python development header files. On Debian/Ubuntu based systems the header files for Python are found in the -distribution package ``pythonX.Y-dev`` e.g. ``python3.7-dev``. On Fedora/Red Hat +distribution package ``pythonX.Y-dev`` e.g. ``python3.8-dev``. On Fedora/Red Hat based systems, the Python header files are found in the distribution package ``python-devel``. diff --git a/setup.py b/setup.py index 2fbd2ca..f3a226d 100644 --- a/setup.py +++ b/setup.py @@ -171,7 +171,7 @@ def pkgconfig_installed_check(lib, required_version, default): use_scm_version={ 'write_to': "lz4/version.py", }, - python_requires=">=3.7", + python_requires=">=3.8", setup_requires=[ 'setuptools_scm', 'pkgconfig', @@ -200,7 +200,6 @@ def pkgconfig_installed_check(lib, required_version, default): 'Intended Audience :: Developers', 'Programming Language :: C', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10',