Skip to content

python 3.13 transition  #37197

Closed
Closed
@smoser

Description

@smoser

Last week we bumped the 'provider priority' value for the python 3.13 subpackage of packages named 'py3-'.
That is to say that before last week, if you did apk add py3-lxml you'd end up with the python-3.12 version, a package named py3.12-lxml. This week, you'd end up with py3.13-lxml and its dependencies installed.

There are several packages that have an un-versioned python package listed as a build-depends, runtime-dependency or test dependency. Many of these packages will now be broken either in runtime or in the next build for reasons such as:

  1. they installed python modules (.py files) into /usr/lib/python3.12/site-packages or a virtual env's lib/python3.12/site-packages using 'python' or 'python3' to do the install.
  2. their build uses a python3 or python3-dev package , but does not support python-3.13

I searched through existing melange files for use of un-versioned python 3 packages.
There are very few cases where an un-versioned python dependency (python3-dev rather than python-3.XX-dev) should be used. Those are mostly limited to:

  1. build systems that use only python3 and no other python packages.
  2. runtime dependencies that use only the python executable and standard library. byobu is one such example.

To update packages, follow these bullet points:

  • Remove python-3 and python-3-dev references. Either replace them with python3 or python3-dev. In almost all cases, python3 should not be listed in the runtime or test dependencies.

  • Packages that simply use python or python3 in their build environment but do not produce packages with python files can continue to use python3.

  • If python3 is listed only in the build environment (not elsewhere), you may well be able to just delete it. If another package in the build environment needs python, it should be pulled in.

  • If a package has more than one python package (py3-) in its build environment, it should pick a specific version (3.13 if supported) and list the dependencies with py${{vars.py-version}}-pkg. This will guarantee that the dependencies are installed at a consistent version.

  • If there are more than one python build package (setuptools, wheel...) listed in the build environment, then replace those with py3.XX-build-base, then use the build-base package.

  • If a package has anything other than python3 listed in its runtime depends, or it uses a virtual env, then it needs to pick a specific python version.

  • If the build uses python3 or python by name, the easiest thing to do is
    to use a python-as-wrapper package to provide that executable.
    Add python-as-wrapper package and use it in asciidoc build. #36891 . It ensures that shbang will get
    the correct executable value, and melange will then generate the correct
    dependendency.

Where 'pick a specific version' is mentioned above, the preferred mechanism for
doing so is to use py-version variable.

vars:
  py-version: 3.13
...

environment:
  contents:
  packages:
   ..
   - py${{py-version}}-build-base
   - py${{py-version}}-

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions