Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12 compatibility; docker, venv/virtualenv #1015

Merged
merged 13 commits into from
May 5, 2024

Conversation

ix5
Copy link
Member

@ix5 ix5 commented Apr 23, 2024

Checklist

  • All new and existing tests are passing
  • (If adding features:) I have added tests to cover my changes
  • (If docs changes needed:) I have updated the documentation accordingly.
  • I have added an entry to CHANGES.rst because this is a user-facing change or an important bugfix
  • I have written proper commit message(s)

What changes does this Pull Request introduce?

Compatibility for Python 3.12 and a few stray nits

  • Mentions needed virtualenv package in docs, make pip and virtualenv related commands more consistent
  • Require setuptools in setup.py (mostly because of pkg_resources)
  • docker: Use buildkit in another instance of the Makefile, remove version from compose file, improve Dockerfile formatting
  • Mark Python 3.12 support in setup.py and use it in Dockerfile, GitHub Actions

Why is this necessary?

Python 3.12 changes: What's new

gh-95299: Do not pre-install setuptools in virtual environments created with venv. This means that distutils, setuptools, pkg_resources, and easy_install will no longer available by default; to access these run pip install setuptools in the activated virtual environment.

  • We were using python -m venv and virtualenv interchangeably in the docs
  • In Python 3.12, python -m venv seemingly no longer pulls in pip and setuptools, so switch to virtualenv instead
  • python setup.py develop is now even more heavily discouraged

@ix5 ix5 added server (Python) server code docs Documentation of the project labels Apr 23, 2024
@ix5 ix5 added this to the 0.14 milestone Apr 23, 2024
@jelmer
Copy link
Member

jelmer commented May 4, 2024

FWIW these changes LGTM, apart from the merge conflicts :)

ix5 added 12 commits May 5, 2024 22:23
In Python 3.12, python -m venv seemingly no longer pulls in
pip and setuptools, so switch to virtualenv instead

`python setup.py develop` is now even more heavily
discouraged, so use `pip install -e` instead
See https://docs.docker.com/compose/compose-file/04-version-and-name/

> The top-level version property is defined by the Compose
> Specification for backward compatibility. It is only
> informative and you'll receive a warning message that it is
> obsolete if used.
N.b. `PYTHON_VERSION` env var is already taken by the
underlying Debian image and conflicts when running commands
such as pip or virtualenv
Docker hub is implicitly set as registry, make it explicit
This way, the docker image instructions stay consistent with
what the docs recommend for regular installations
`python setup.py develop` is discouraged in newer Python
versions
@ix5 ix5 changed the title [DNM] Python 3.12 compatibility; docker, venv/virtualenv Python 3.12 compatibility; docker, venv/virtualenv May 5, 2024
@ix5 ix5 marked this pull request as ready for review May 5, 2024 21:30
@ix5
Copy link
Member Author

ix5 commented May 5, 2024

Might also be time to move on from python setup.py {sdist, bdist} and use the "official" PyPA build package instead, although that's another dependency. PyPA recommends it (via stackoverflow)

@ix5 ix5 merged commit 33ad1fb into isso-comments:master May 5, 2024
18 checks passed
@ix5 ix5 deleted the py3.12-docker-venv branch May 5, 2024 21:33
@ix5 ix5 modified the milestones: 0.14, 0.13.1 May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation of the project server (Python) server code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants