:::warning
:atom_symbol: This process is a nuclear power plant. We don’t expect casual contributors to follow it.
:::
:::info
:construction: This is a WIP document. It'll be better in time. Ping @befeleme if you want to understand the unclear parts of it.
There's also an older document which may contain interesting details not covered here: https://fedoraproject.org/wiki/SIGs/Python/UpgradingPython.
:::
:::success
befeleme changed a month agoView mode Like Bookmark
:::warning
:atom_symbol: This process is a nuclear power plant. We don’t expect casual contributors to follow it.
By we, we mean Red Hat's python-maint team, which currently handles Python interpreter maintenance in Fedora.
If you're not in the team, you're certainly welcome to look how we do things and follow/improve this guide (or parts of it) if you want to, but your time might be better spent learning other things :)
It's perfectly OK to just file bugs in Bugzilla, submit Pull Requests in Pagure, and talk on the mailing list.
:::
:::info
:construction: This document is work in progress. Python-maint members should have write access—if it doesn't work, ask @torsava. Feel free to edit to fix typos or reword sentences. Keep discussion in e-mail or in person, please avoid comments here, they are hard to follow. Feel free to add XXX notes.
Tomáš Hrnčiar changed 3 months agoView mode Like Bookmark
Hello Pythonistas.
tl;dr I wonder if we should get rid of the last downstream-only patch in Fedora's Python,
the one responsible for /usr/local/lib(64)/python... installation location.
The removal would bring us closer to upstream, but perhaps cause a regression for our users.
I propose to adapt PEP 668 (Marking Python base environments as “externally managed”) instead.
Details:
On Python 3.13+ we only ship one downstream-only patch in Python.
Miro Hrončok changed 8 months agoView mode Like Bookmark
Check what packages (transitively) BuildRequire your package
$ repoquery --repo=rawhide{,-source} --whatrequires python3-foo --recursive | grep src$ | pkgname | sort | uniq > packages.txt
Use --repo={fedora,updates}{,-source} --releasever XX --latest=1 instead of --repo=rawhide{,-source} for older releases.
XXX: what does --latest=1 mean?
Always use the package name for this, not a virtual provide.
Note that the --recursive flag might give an enormous list of packages (e.g. for python3-setuptools), so feel free to not always use it.
Check what packages might not even install the new version
Miro Hrončok changed 2 years agoView mode Like Bookmark
obs-service-set_version
https://copr.fedorainfracloud.org/coprs/thrnciar/python-packaging/package/obs-service-set_version/
test failures wrt some version manipulation for RPM?
pcs
https://copr.fedorainfracloud.org/coprs/thrnciar/python-packaging/package/pcs/
python3dist() provides generator:
Miro Hrončok changed 2 years agoView mode Like Bookmark
Error: The version in the Python package metadata {version} normalizes to zero.
It's likely a packaging error caused by missing version information (e.g. when using a version control system snapshot as a source).
Try providing the version information manually when building the Python package, for example by setting the SETUPTOOLS_SCM_PRETEND_VERSION environment variable if the package uses setuptools_scm.
If you are confident that the version of the Python package is intentionally zero, you may %define the _python_dist_allow_version_zero macro in the spec file to disable this check.
Miro Hrončok changed 3 years agoView mode Like Bookmark
User Stories
As a Fedora packager of a library
I want to create a quality RPM package (conforming to the guidelines)
in order to submit it to Fedora.
As a devops person
I want to quickly create a working RPM package of a Python library
in order to install it on my machine(s).
As a maintainer of a library
befeleme changed 3 years agoView mode Like Bookmark
:warning: This is a ReST document.
Most of it renders OK as Markdown, though.
PEP: XXXX
Title: pysource: File Layout for Installed Modules
Author: Petr Viktorin pviktori@redhat.com, XXX add yourself :)
Discussions-To: XXX
Status: Draft
Type: Standards Track
Created: 04-Feb-2022
Petr Viktorin changed 3 years agoView mode Like Bookmark
:::info
👉 https://hackmd.io/@python-maint/fedora-pr-process
:::
What PR submitter does
Ask for review: Paste the PR link to the team Etherpad
Clearly mark the PR as WIP (ideally in the PR title)
Miro Hrončok changed 3 years agoView mode Like Bookmark
In Fedora 36, Python changes the way installation paths of Python packages are handled. The changes affect the main Python in Fedora 36, Python 3.10, as well as any newer Python version included. Most Fedora users should not be affected by the change but there are situations where there might be slight differences.
When Python packages are installed by sudo pip, sudo python setup.py install or similar methods, Python packages are installed to /usr/local/lib(64)/python3.10/site-packages/. This has already been happening since Fedora 27. However the way this is achieved has been significantly re-implemented in Fedora 36 and that has created several minor differences.
The sysconfig Python module from the standard library defines several installation schemes. By default, the installation scheme used on Fedora 36 when installing Python packages using root privileges (for example via sudo) is {prefix}/local/lib(64)/python3.10/site-packages/ (where {prefix} is defined as /usr by default). When Python itself runs from a Python virtual environment or when building RPM packages, the installation scheme is {prefix}/lib(64)/python3.10/site-packages/ (it does not include /local/).
Previously, the /local/ part was only artificially added when installing packages, now it is part of the installation scheme. This was changed to be more consistent with what other Python distributors are doing, so that the scheme is more likely to be accepted in upstream Python and to work well with upstream tools like setuptools or pip, which we cannot modify when they are installed or upgraded using pip directly from the Python Package Index.
Here are the differences that might be observed with the new approach:
Miro Hrončok changed 3 years agoView mode Like Bookmark