Skip to content

Build wheels for Python 3.12#275

Merged
jonathanunderwood merged 4 commits into
python-lz4:masterfrom
evansd:python3.12-wheels
Jan 1, 2024
Merged

Build wheels for Python 3.12#275
jonathanunderwood merged 4 commits into
python-lz4:masterfrom
evansd:python3.12-wheels

Conversation

@evansd

@evansd evansd commented Dec 21, 2023

Copy link
Copy Markdown
Contributor

This required updating the pypa/cibuildwheel action, making a minor change to the way the current version is retrieved in the docs config, and adding an explicit dependency on setuptools.

It also required dropping Python 3.7 support as the wheel for this no longer builds. As this reached end-of-life in June 2023 this seems reasonable and those still running against Python 3.7 can continue to use older versions of lz4.

I've done an experimental CI build here, and verified that the Linux wheel installs correctly.
https://github.com/evansd/python-lz4/actions/runs/7289231332

Closes #274

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.
@evansd

evansd commented Dec 21, 2023

Copy link
Copy Markdown
Contributor Author

Update: the below are now resolved


Ah, the wheels build OK but it looks like are a bunch of other CI failures unrelated to this change.

One related to missing setuptools:

image

And the other something to do with openssl versions when running sphinx.builders.linkcheck:

 py: OK ✔ in 2 minutes 2.88 seconds
  flake8: install_package_deps /project> python -I -m pip install flake8
  flake8: install_package /project> python -I -m pip install --force-reinstall --no-deps /project/.tox/.tmp/package/2/lz4-0.1.dev1180+g91fe6ef-0.editable-cp37-cp37m-linux_x86_64.whl
  flake8: commands[0] /project> flake8 lz4 setup.py tests
  .pkg: _exit /project> python /opt/python/cp37-cp37m/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  flake8: OK ✔ in 2.54 seconds
  .pkg-experimental: install_requires /project> python -I -m pip install pkgconfig 'setuptools>=45' 'setuptools_scm[toml]>=6.2' wheel
  .pkg-experimental: _optional_hooks /project> python /opt/python/cp37-cp37m/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  .pkg-experimental: get_requires_for_build_editable /project> python /opt/python/cp37-cp37m/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  .pkg-experimental: install_requires_for_build_editable /project> python -I -m pip install pkgconfig setuptools_scm wheel
  .pkg-experimental: build_editable /project> python /opt/python/cp37-cp37m/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  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)

This required updating to the latest version of `pypa/cibuildwheel`.
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: urllib3/urllib3#2168)
```

@jonathanunderwood jonathanunderwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@jonathanunderwood jonathanunderwood merged commit 65b563a into python-lz4:master Jan 1, 2024
@evansd evansd deleted the python3.12-wheels branch January 2, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wheels for Python 3.12

2 participants