diff -Nru python3-defaults-3.6.3/.bzrignore python3-defaults-3.9.4/.bzrignore --- python3-defaults-3.6.3/.bzrignore 2017-10-14 05:06:32.000000000 +0000 +++ python3-defaults-3.9.4/.bzrignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -debian/*.debhelper* -debian/*.substvars -debian/files -debian/python3-minimal.postinst -debian/python3.postinst -debian/python3.postrm -debian/python3.preinst - -debian/idle -debian/idle3 -debian/libpython3-all-dbg -debian/libpython3-all-dev -debian/libpython3-dbg -debian/libpython3-dev -debian/libpython3-stdlib -debian/python3 -debian/python3-all -debian/python3-all-dbg -debian/python3-all-dev -debian/python3-dbg -debian/python3-dev -debian/python3-doc -debian/python3-examples -debian/python3-minimal -debian/python3-venv - -py3clean.1 -py3compile.1 -stamp-* diff -Nru python3-defaults-3.6.3/debian/2to3.1 python3-defaults-3.9.4/debian/2to3.1 --- python3-defaults-3.6.3/debian/2to3.1 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/debian/2to3.1 2018-06-05 21:35:36.000000000 +0000 @@ -0,0 +1,41 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH 2TO3-3.3 "1" "January 2012" "2to3-3.3 3.3" "User Commands" +.SH NAME +2to3-3.3 \- Python2 to Python3 converter +.SH SYNOPSIS +.B 2to3 +[\fIoptions\fR] \fIfile|dir \fR... +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-d\fR, \fB\-\-doctests_only\fR +Fix up doctests only +.TP +\fB\-f\fR FIX, \fB\-\-fix\fR=\fIFIX\fR +Each FIX specifies a transformation; default: all +.TP +\fB\-j\fR PROCESSES, \fB\-\-processes\fR=\fIPROCESSES\fR +Run 2to3 concurrently +.TP +\fB\-x\fR NOFIX, \fB\-\-nofix\fR=\fINOFIX\fR +Prevent a transformation from being run +.TP +\fB\-l\fR, \fB\-\-list\-fixes\fR +List available transformations +.TP +\fB\-p\fR, \fB\-\-print\-function\fR +Modify the grammar so that print() is a function +.TP +\fB\-v\fR, \fB\-\-verbose\fR +More verbose logging +.TP +\fB\-\-no\-diffs\fR +Don't show diffs of the refactoring +.TP +\fB\-w\fR, \fB\-\-write\fR +Write back modified files +.TP +\fB\-n\fR, \fB\-\-nobackups\fR +Don't write backups for modified files diff -Nru python3-defaults-3.6.3/debian/2to3.py python3-defaults-3.9.4/debian/2to3.py --- python3-defaults-3.6.3/debian/2to3.py 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/debian/2to3.py 2018-06-05 21:35:36.000000000 +0000 @@ -0,0 +1,5 @@ +#! /usr/bin/python3 +import sys +from lib2to3.main import main + +sys.exit(main("lib2to3.fixes")) diff -Nru python3-defaults-3.6.3/debian/changelog python3-defaults-3.9.4/debian/changelog --- python3-defaults-3.6.3/debian/changelog 2021-09-02 19:32:41.000000000 +0000 +++ python3-defaults-3.9.4/debian/changelog 2022-02-27 23:46:26.000000000 +0000 @@ -1,8 +1,328 @@ -python3-defaults (3.6.3-2~16.04.sav0) xenial; urgency=medium +python3-defaults (3.9.4-1~16.04.sav0) xenial; urgency=medium * Backport to Xenial + * debian/control{.in}: Change all python3-{distutils,gdbm,lib2to3,tk} deps + to python3.9-* to match packages built by backported Python 3.9 for Xenial + * policy/conf.py: Add master_doc = 'index' (fix "contents.rst not found") + - Change f-string to str format (as Sphinx is running under Python 3.5) + * debian/compat: Set compat level to 10 (Launchpad sbuild highest for Xenial) - -- Rob Savoury Thu, 02 Sep 2021 12:32:41 -0700 + -- Rob Savoury Sun, 27 Feb 2022 15:46:26 -0800 + +python3-defaults (3.9.4-1) experimental; urgency=medium + + * Bump version to 3.9.4. + + -- Matthias Klose Tue, 06 Apr 2021 19:28:56 +0200 + +python3-defaults (3.9.2-3) unstable; urgency=medium + + * Ship index.html to unbreak links in python-policy.html. Closes: #985313. + * Don't ship html policy links in the python3.9 doc directory. + Closes: #984961. + + -- Matthias Klose Mon, 05 Apr 2021 14:00:48 +0200 + +python3-defaults (3.9.2-2) unstable; urgency=medium + + * Upload to unstable. + + -- Stefano Rivera Tue, 02 Mar 2021 10:55:41 -0800 + +python3-defaults (3.9.2-1) experimental; urgency=medium + + [ Stefano Rivera ] + * Update Python Policy to describe python3-full and other interpreter + packaging changes. + * Convert Python Policy to Sphinx. + * Add myself to uploaders. + + [ Matthias Klose ] + * Bump version to 3.9.2. + * Make the Sphinx generated documents more compact. + * Clarify that python3-full must not be used neither as a build dependency + nor a recommendation. + * Move the html version of the policy into the python3-dev package. + * policy: Add paragraphs "Removal of the unversioned packages" and + "Unversioned python commands. + + -- Stefano Rivera Tue, 02 Mar 2021 10:37:38 -0800 + +python3-defaults (3.9.2~rc1-1) experimental; urgency=medium + + * Bump version to 3.9.2 rc1. + + [ Stefano Rivera ] + * Improve package descriptions, describing venv, stdlib, and lib2to3 package + contents. + + [ Matthias Klose ] + * Build a python3-full package. + - Depends on ca-certificates. Closes: #960869. + + -- Matthias Klose Thu, 18 Feb 2021 12:16:46 +0100 + +python3-defaults (3.9.1-1) unstable; urgency=medium + + * Bump version to 3.9.1. + + -- Matthias Klose Wed, 23 Dec 2020 07:05:58 +0100 + +python3-defaults (3.9.0-4) unstable; urgency=medium + + * Remove 3.8 as a supported Python3 versions. + + -- Matthias Klose Sun, 06 Dec 2020 11:36:08 +0100 + +python3-defaults (3.9.0-3) unstable; urgency=medium + + * Bump standards version. + + -- Matthias Klose Wed, 18 Nov 2020 21:21:16 +0100 + +python3-defaults (3.9.0-2) experimental; urgency=medium + + * Relax dependencies on packages built by python3-stdlib-extensions. + + -- Matthias Klose Mon, 19 Oct 2020 13:35:56 +0200 + +python3-defaults (3.9.0-1) experimental; urgency=medium + + * Default python3 version to 3.9. + * Drop the venv binary and man page. Closes: #970764. + + -- Matthias Klose Thu, 15 Oct 2020 12:10:47 +0200 + +python3-defaults (3.8.6-1) unstable; urgency=medium + + * Bump version to 3.8.6. + * Re-introduce the the python3-venv package. + + -- Matthias Klose Tue, 13 Oct 2020 21:25:54 +0200 + +python3-defaults (3.8.5-1) experimental; urgency=medium + + [ Scott Kitterman ] + * Policy: Update wheel policy to allow python3 only wheels for packages + (like setuptools) that no longer support python2 (Scott Kitterman). + + [ Matthias Klose ] + * Bump version to 3.8.5. + * Add 3.9 as a supported Python3 version. + * Stop building the python3-venv package. + * Bump debhelper version. + + -- Matthias Klose Thu, 13 Aug 2020 14:51:41 +0200 + +python3-defaults (3.8.2-3) unstable; urgency=medium + + * Remove 3.7 as a supported Python3 versions. + * Fix policy for location for Python 3 local modules. Closes: #884736. + * Policy: Clarify module package naming (Simon McVittie). + * Policy: Prefer to document python3-foo in python-foo-doc (Simon McVittie). + + -- Matthias Klose Tue, 07 Apr 2020 12:43:18 +0200 + +python3-defaults (3.8.2-2) unstable; urgency=medium + + [ Stuart Prescott ] + * py3compile: use unbuffered IO to pass filenames to py_compile + (closes: 953056) + + [ Piotr Ożarowski ] + * Byte compile exception patterns (bcep) changes: + - new "file" type to list just one file + example: file|-4.0|/usr/share/foo/test.py + - ignore lines that start with hash char. (to allow comments) + - tighten checking directory name (partial match was possible before) + - in "re" type's pattern - check relative paths in addition to full path + (i.e. no need to include directory path in the pattern) + example: re|-4.0|/usr/lib/bar|baz/test.*\.py + - only warn about invalid patterns (instead of failing) + + -- Piotr Ożarowski Sat, 21 Mar 2020 17:18:03 +0100 + +python3-defaults (3.8.2-1) unstable; urgency=medium + + * Bump version to 3.8.2. + * Bump standards version. + + -- Matthias Klose Mon, 02 Mar 2020 13:40:23 +0100 + +python3-defaults (3.8.0-3) experimental; urgency=medium + + * Drop the symlinks with the m modifier. + + -- Matthias Klose Sun, 15 Dec 2019 13:49:16 +0100 + +python3-defaults (3.8.0-2) experimental; urgency=medium + + * Bump the defaults version in the python_defaults file as well- + + -- Matthias Klose Tue, 26 Nov 2019 17:31:54 +0100 + +python3-defaults (3.8.0-1) experimental; urgency=medium + + * Default python3 version to 3.8. + * python3-dbg: Provide a python3-dbg-embed.pc pkg-config file. + * Move the pkg-config files into libpython3-dev and libpython3-dbg. + + -- Matthias Klose Mon, 25 Nov 2019 12:38:19 +0100 + +python3-defaults (3.7.5-3) unstable; urgency=medium + + [ Matthias Klose ] + * Update the Python policy for the Python2 removal (Neil Williams). + Closes: #943666. + * Prepare to ship the python*-embed pkg-config files with 3.8 as the + default Python3 version. + + [ Piotr Ożarowski ] + * Remove dh-python dependency from python3-all and python3-dev packages. + Packages should build depend on dh-python or dh-sequence-python3 instead. + + -- Matthias Klose Thu, 14 Nov 2019 15:13:23 +0100 + +python3-defaults (3.7.5-2) experimental; urgency=medium + + * Add 3.8 as a supported Python3 versions. + + -- Matthias Klose Sun, 20 Oct 2019 11:41:55 +0200 + +python3-defaults (3.7.5-1) unstable; urgency=medium + + * Bump version to 3.7.5. + * Bump standards version. + + -- Matthias Klose Wed, 02 Oct 2019 14:31:29 +0200 + +python3-defaults (3.7.3-1) unstable; urgency=medium + + * Bump version to 3.7.3. + + -- Matthias Klose Tue, 26 Mar 2019 11:25:14 +0100 + +python3-defaults (3.7.2-1) unstable; urgency=medium + + * Bump version to 3.7.2. + * Bump standards version. + + -- Matthias Klose Fri, 18 Jan 2019 08:54:49 +0100 + +python3-defaults (3.7.1-3) unstable; urgency=medium + + * Remove 3.6 as a supported Python3 versions. + + -- Matthias Klose Wed, 19 Dec 2018 03:54:07 +0100 + +python3-defaults (3.7.1-2) unstable; urgency=medium + + * Default python3 version to 3.7, targeting sid/buster. + * Fix FTCBFS: Annotate python build dependencies with :any (Helmut Grohne). + Closes: #912899. + + -- Matthias Klose Wed, 21 Nov 2018 13:04:27 +0100 + +python3-defaults (3.7.1-1) experimental; urgency=medium + + * Default python3 version to 3.7. + + -- Matthias Klose Sun, 21 Oct 2018 14:23:45 +0200 + +python3-defaults (3.6.7-1) unstable; urgency=high + + * Really ship the policy in the python3 package, and update from the last + version found in the python package. Closes: #910113. + * Bump version to 3.6.7. + + -- Matthias Klose Sun, 21 Oct 2018 11:21:31 +0200 + +python3-defaults (3.6.6-1) unstable; urgency=medium + + [ Matthias Klose ] + * Fix the idle desktop file. Closes: #901096. + * Install the policy files in the python3 package. Closes: #901486. + * python3-minimal: Pre-Depend on python3.6-minimal. Closes: #901001. + * Bump version to 3.6.6. + + [ Scott Kitterman ] + * Remove myself from uploaders + + -- Matthias Klose Wed, 27 Jun 2018 18:18:20 +0200 + +python3-defaults (3.6.5-5) experimental; urgency=medium + + * Fix typo in the defaults file. Closes: #900937, #900949. + + -- Matthias Klose Thu, 07 Jun 2018 17:57:53 +0200 + +python3-defaults (3.6.5-4) experimental; urgency=medium + + * Update Vcs attributes. + * Add Python 3.7 to the list of supported Python3 versions. + + -- Matthias Klose Wed, 06 Jun 2018 18:26:50 +0200 + +python3-defaults (3.6.5-3) unstable; urgency=medium + + * Update valgrind support file. LP: #1513364. + * debian/control.in (Michael Vogt): + - add Cnf-Visible-Pkgname hint to ensure command-not-found recommends + installing "python3" instead of "python3-minimal" when it is missing. + + -- Matthias Klose Tue, 10 Apr 2018 11:48:03 +0200 + +python3-defaults (3.6.5-2) unstable; urgency=medium + + * Distinguish between python3.6 and python3-stdlib-extensions versions. + Closes: #894168. + * python3-venv: Depend on python3-distutils. + + -- Matthias Klose Mon, 02 Apr 2018 07:06:32 +0200 + +python3-defaults (3.6.5-1) unstable; urgency=medium + + [ Matthias Klose ] + * Bump version to 3.6.5. + + [ Michael Vogt ] + * debian/control.in: LP: #1752415 + - add "XB-Cnf-Extra-Commands: python" to ensure command-not-found + outputs the python3 package when searching for "python" + - add XB-Cnf-Priority-Bonus to ensure python3 is listed on the + top when typing "python" + + -- Matthias Klose Sat, 31 Mar 2018 16:26:32 +0800 + +python3-defaults (3.6.5~rc1-1) unstable; urgency=medium + + * Bump version to 3.6.5~rc1. + * Remove dh-python dependency from python3. + * Add dh-python and python3-distutils dependencies to python3-all and + python3-dev. + + -- Matthias Klose Sun, 25 Mar 2018 19:05:26 +0800 + +python3-defaults (3.6.4-1) unstable; urgency=medium + + * Bump version to 3.6.4. + * 2to3: Depend on python3-lib2to3 and provide the 2to3 launcher. + + -- Matthias Klose Fri, 29 Dec 2017 23:53:39 +0100 + +python3-defaults (3.6.4~rc1-2) unstable; urgency=medium + + * 2to3: Fix breaks/replaces relation with python. Closes: #884418. + + -- Matthias Klose Fri, 15 Dec 2017 08:24:00 +0100 + +python3-defaults (3.6.4~rc1-1) unstable; urgency=medium + + * Bump version to 3.6.4~rc1. + * Stop using priority extra for the -dbg packages. + * Build a 2to3 package. + + -- Matthias Klose Wed, 13 Dec 2017 23:52:01 +0100 python3-defaults (3.6.3-2) unstable; urgency=medium diff -Nru python3-defaults-3.6.3/debian/chunk.xsl python3-defaults-3.9.4/debian/chunk.xsl --- python3-defaults-3.6.3/debian/chunk.xsl 2017-09-01 06:38:43.000000000 +0000 +++ python3-defaults-3.9.4/debian/chunk.xsl 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ - - - - - 1 - 0 - 1 - 1 - 1 - _blank - 1 - diff -Nru python3-defaults-3.6.3/debian/compat python3-defaults-3.9.4/debian/compat --- python3-defaults-3.6.3/debian/compat 2016-03-21 11:58:30.000000000 +0000 +++ python3-defaults-3.9.4/debian/compat 2022-02-27 22:04:48.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru python3-defaults-3.6.3/debian/control python3-defaults-3.9.4/debian/control --- python3-defaults-3.6.3/debian/control 2017-10-26 08:42:30.000000000 +0000 +++ python3-defaults-3.9.4/debian/control 2022-02-27 23:46:17.000000000 +0000 @@ -2,26 +2,24 @@ Section: python Priority: optional Maintainer: Matthias Klose -Uploaders: Piotr Ożarowski , Scott Kitterman -Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.17.11), python3.6 (>= 3.6.3-1~), +Uploaders: Piotr Ożarowski , Stefano Rivera +Build-Depends: debhelper (>= 11), dpkg-dev (>= 1.17.11), python3.9:any (>= 3.9.4-0~), lsb-release, python3-minimal:any, python3-docutils, - docbook-xml, - docbook-xsl, - w3m, - xsltproc, -Standards-Version: 4.1.1 -Homepage: http://www.python.org/ -Vcs-Bzr: http://alioth.debian.org/anonscm/bzr/pkg-python/python3-defaults-debian -Vcs-Browser: http://alioth.debian.org/scm/loggerhead/pkg-python/python3-defaults-debian/files + python3-sphinx, + html2text, +Standards-Version: 4.5.1 +Homepage: https://www.python.org/ +Vcs-Git: https://salsa.debian.org/cpython-team/python3-defaults.git +Vcs-Browser: https://salsa.debian.org/cpython-team/python3-defaults Package: python3 Architecture: any Multi-Arch: allowed Pre-Depends: python3-minimal (= ${binary:Version}) -Depends: python3.6 (>= 3.6.3-1~), libpython3-stdlib (= ${binary:Version}), ${misc:Depends}, dh-python -Suggests: python3-doc (>= ${binary:Version}), python3-tk (>= 3.6.3-1~) , python3-venv (>= ${binary:Version}) +Depends: python3.9 (>= 3.9.4-0~), libpython3-stdlib (= ${binary:Version}), ${misc:Depends} +Suggests: python3-doc (>= ${binary:Version}), python3.9-tk (>= 3.9.4-0~) , python3-venv (>= ${binary:Version}) Replaces: python3-minimal (<< 3.1.2-2) Provides: python3-profiler Description: interactive high-level object-oriented language (default python3 version) @@ -30,82 +28,98 @@ network programming, system administration, sounds and graphics. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v3.6). + Python 3 version (currently v3.9). +XB-Cnf-Extra-Commands: python +XB-Cnf-Priority-Bonus: 5 Package: python3-venv Architecture: any Multi-Arch: allowed -Depends: python3.6-venv (>= 3.6.3-1~), python3 (= ${binary:Version}), ${misc:Depends} -Description: pyvenv-3 binary for python3 (default python3 version) - Python, the high-level, interactive object oriented language, - includes an extensive class library with lots of goodies for - network programming, system administration, sounds and graphics. +Depends: python3.9-venv (>= 3.9.4-0~), python3 (= ${binary:Version}), + python3.9-distutils (>= 3.9.4-0~), ${misc:Depends} +Description: venv module for python3 (default python3 version) + This package contains the venv module for the Python language (default python3 + version). + . + The venv module provides support for creating lightweight "virtual + environments" with their own site directories, optionally isolated from system + site directories. Each virtual environment has its own Python binary (which + matches the version of the binary that was used to create this environment) + and can have its own independent set of installed Python packages in its site + directories. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v3.6). + Python 3 version's venv module (currently v3.9). Package: python3-minimal Architecture: any Multi-Arch: allowed -Depends: python3.6-minimal (>= 3.6.3-1~), dpkg (>= 1.13.20), ${misc:Depends} +Pre-Depends: python3.9-minimal (>= 3.9.4-0~) +Depends: dpkg (>= 1.13.20), ${misc:Depends} Description: minimal subset of the Python language (default python3 version) This package contains the interpreter and some essential modules. It's used in the boot process for some basic tasks. - See /usr/share/doc/python3.6-minimal/README.Debian for a list of the modules + See /usr/share/doc/python3.9-minimal/README.Debian for a list of the modules contained in this package. +Cnf-Visible-Pkgname: python3 Package: python3-examples Architecture: all Multi-Arch: foreign -Depends: python3 (>= ${binary:Version}), python3.6-examples (>= 3.6.3-1~), ${misc:Depends} +Depends: python3 (>= ${binary:Version}), python3.9-examples (>= 3.9.4-0~), ${misc:Depends} Description: examples for the Python language (default version) Examples, Demos and Tools for Python. These are files included in the upstream Python distribution. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v3.6). + Python 3 version's examples (currently v3.9). Package: python3-dev Architecture: any Multi-Arch: allowed -Depends: python3 (= ${binary:Version}), libpython3-dev (= ${binary:Version}), python3.6-dev (>= 3.6.3-1~), ${misc:Depends} -Replaces: python3.1 (<< 3.1.2+20100706-3) +Depends: python3 (= ${binary:Version}), libpython3-dev (= ${binary:Version}), + python3.9-dev (>= 3.9.4-0~), python3.9-distutils (>= 3.9.4-0~), + ${misc:Depends}, ${sphinxdoc:Depends} +Breaks: python3 (<< 3.9.2-1~) +Replaces: python3.1 (<< 3.1.2+20100706-3), python3 (<< 3.9.2-1~) +Built-Using: ${sphinxdoc:Built-Using} Description: header files and a static library for Python (default) Header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v3.6). + Python 3 version's headers (currently v3.9). Package: libpython3-dev Architecture: any Multi-Arch: same Section: libdevel -Depends: libpython3.6-dev (>= 3.6.3-1~), ${misc:Depends} +Depends: libpython3.9-dev (>= 3.9.4-0~), ${misc:Depends} +Breaks: libpython3.8-dev (<< 3.8.0-2), python3-dev (<< 3.8.0-1) +Replaces: libpython3.8-dev (<< 3.8.0-2), python3-dev (<< 3.8.0-1) Description: header files and a static library for Python (default) Header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v3.6). + Python 3 version's headers (currently v3.9). Package: libpython3-stdlib Architecture: any Multi-Arch: same -Depends: libpython3.6-stdlib (>= 3.6.3-1~), ${misc:Depends} +Depends: libpython3.9-stdlib (>= 3.9.4-0~), ${misc:Depends} Description: interactive high-level object-oriented language (default python3 version) - Python, the high-level, interactive object oriented language, - includes an extensive class library with lots of goodies for - network programming, system administration, sounds and graphics. + This package contains the majority of the standard library for the Python + language (default python3 version). . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v3.6). + Python 3 version's standard library (currently v3.9). Package: idle Architecture: all -Depends: python3 (>= ${binary:Version}), python3-tk, ${misc:Depends}, idle-python3.6 +Depends: python3 (>= ${binary:Version}), python3.9-tk, ${misc:Depends}, idle-python3.9 Enhances: python3 Breaks: idle3 (<< 3.6.2-2) Replaces: idle3 (<< 3.6.2-2) @@ -114,7 +128,7 @@ IDLE is written using Tkinter and therefore quite platform-independent. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v3.6). + Python 3 version's IDLE (currently v3.9). Package: idle3 Architecture: all @@ -129,11 +143,11 @@ Section: doc Architecture: all Multi-Arch: foreign -Depends: python3.6-doc (>= 3.6.3-1~), ${misc:Depends} +Depends: python3.9-doc (>= 3.9.4-0~), ${misc:Depends} Suggests: python3 (>= ${binary:Version}), python3-examples Description: documentation for the high-level object-oriented language Python 3 This is the official set of documentation for the interactive high-level - object-oriented language Python 3 (v3.6). All documents are provided + object-oriented language Python 3 (v3.9). All documents are provided in HTML format, some in info format. The package consists of nine documents: . * Tutorial @@ -147,35 +161,37 @@ * Distributing Python Modules . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v3.6). + Python 3 version's documentation (currently v3.9). Package: python3-dbg Architecture: any Multi-Arch: allowed Section: debug -Priority: extra -Depends: python3 (= ${binary:Version}), libpython3-dbg (= ${binary:Version}), python3.6-dbg (>= 3.6.3-1~), ${misc:Depends} -Description: debug build of the Python 3 Interpreter (version 3.6) +Depends: python3 (= ${binary:Version}), libpython3-dbg (= ${binary:Version}), python3.9-dbg (>= 3.9.4-0~), ${misc:Depends} +Description: debug build of the Python 3 Interpreter (version 3.9) Python 3 interpreter configured with --pydebug. Dynamically loaded modules - are searched in /usr/lib/python3.6/lib-dynload/debug first. + are searched in /usr/lib/python3.9/lib-dynload/debug first. Package: libpython3-dbg Architecture: any Multi-Arch: same Section: debug -Priority: extra -Depends: libpython3.6-dbg (>= 3.6.3-1~), ${misc:Depends} -Description: debug build of the Python 3 Interpreter (version 3.6) +Depends: libpython3.9-dbg (>= 3.9.4-0~), ${misc:Depends} +Breaks: python3-dbg (<< 3.8.0-1) +Replaces: python3-dbg (<< 3.8.0-1) +Description: debug build of the Python 3 Interpreter (version 3.9) Python 3 interpreter configured with --pydebug. Dynamically loaded modules - are searched in /usr/lib/python3.6/lib-dynload/debug first. + are searched in /usr/lib/python3.9/lib-dynload/debug first. Package: python3-all Architecture: any Multi-Arch: allowed -Depends: python3 (= ${binary:Version}), ${misc:Depends}, - python3.6 +Depends: python3 (= ${binary:Version}), + ${misc:Depends}, + python3.9-distutils (>= 3.9.4-0~), + python3.9, Description: package depending on all supported Python 3 runtime versions - The package currently depends on python3.6, in the future, + The package currently depends on python3.9, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . @@ -185,10 +201,14 @@ Package: python3-all-dev Architecture: any Multi-Arch: allowed -Depends: python3 (= ${binary:Version}), libpython3-all-dev (= ${binary:Version}), python3-all (= ${binary:Version}), python3-dev (= ${binary:Version}), ${misc:Depends}, - python3.6-dev +Depends: python3 (= ${binary:Version}), + libpython3-all-dev (= ${binary:Version}), + python3-all (= ${binary:Version}), + python3-dev (= ${binary:Version}), + ${misc:Depends}, + python3.9-dev, Description: package depending on all supported Python 3 development packages - The package currently depends on python3.6-dev, in the + The package currently depends on python3.9-dev, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . @@ -200,11 +220,14 @@ Architecture: any Multi-Arch: allowed Section: debug -Priority: extra -Depends: python3 (= ${binary:Version}), libpython3-all-dbg (= ${binary:Version}), python3-all (= ${binary:Version}), python3-dbg (= ${binary:Version}), ${misc:Depends}, - python3.6-dbg +Depends: python3 (= ${binary:Version}), + libpython3-all-dbg (= ${binary:Version}), + python3-all (= ${binary:Version}), + python3-dbg (= ${binary:Version}), + ${misc:Depends}, + python3.9-dbg, Description: package depending on all supported Python 3 debugging packages - The package currently depends on python3.6-dbg, in the + The package currently depends on python3.9-dbg, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . @@ -215,10 +238,11 @@ Architecture: any Multi-Arch: same Section: libdevel -Depends: libpython3-dev (= ${binary:Version}), ${misc:Depends}, - libpython3.6-dev +Depends: libpython3-dev (= ${binary:Version}), + ${misc:Depends}, + libpython3.9-dev, Description: package depending on all supported Python 3 development packages - The package currently depends on libpython3.6-dev, in the + The package currently depends on libpython3.9-dev, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . @@ -230,13 +254,61 @@ Architecture: any Multi-Arch: same Section: debug -Priority: extra -Depends: libpython3-dbg (= ${binary:Version}), ${misc:Depends}, - libpython3.6-dbg +Depends: libpython3-dbg (= ${binary:Version}), + ${misc:Depends}, + libpython3.9-dbg, Description: package depending on all supported Python 3 debugging packages - The package currently depends on libpython3.6-dbg, in the + The package currently depends on libpython3.9-dbg, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python 3 debug packages. + +Package: 2to3 +Architecture: all +Multi-Arch: foreign +Depends: python3.9-lib2to3 (>= 3.9.4-0~), python3 (>= ${binary:Version}), ${misc:Depends} +Breaks: python (<< 2.7.14-4) +Replaces: python (<< 2.7.14-4) +Description: 2to3 binary using python3 + 2to3 is a Python program that reads Python 2.x source code and applies a + series of fixers to transform it into valid Python 3.x code. The standard + library contains a rich set of fixers that will handle almost all code. 2to3 + supporting library lib2to3 is, however, a flexible and generic library, so it + is possible to write your own fixers for 2to3. lib2to3 could also be adapted + to custom applications in which Python code needs to be edited automatically. + . + This package is a dependency package, which depends on Debian's default + Python 3 2to3 version (currently v3.9). + +Package: python3-full +Architecture: any +Multi-Arch: allowed +Depends: python3 (= ${binary:Version}), + python3.9-full (>= 3.9.4-0~), + python3-venv (= ${binary:Version}), + 2to3, + idle, + python3.9-distutils, + python3.9-gdbm, + python3.9-lib2to3, + python3.9-tk, + ${shlibs:Depends}, ${misc:Depends} +Recommends: python3-doc, python3-examples, +Suggests: python3-dev +Description: Default Python Interpreter with complete class library + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on the full + standard library of Python for Python developers. Including modules + used only at build-time, such as venv and distutils, and modules with + complex dependencies, such as tk and IDLE. All batteries included. + . + This package depends on Debian's default python 3 version's full + standard library (currently v3.9). + . + According to the Debian Python policy, this package must not be used in + build dependencies, dependencies and recommendations. diff -Nru python3-defaults-3.6.3/debian/control.in python3-defaults-3.9.4/debian/control.in --- python3-defaults-3.6.3/debian/control.in 2017-10-26 08:42:07.000000000 +0000 +++ python3-defaults-3.9.4/debian/control.in 2022-02-27 23:46:15.000000000 +0000 @@ -2,26 +2,24 @@ Section: python Priority: optional Maintainer: Matthias Klose -Uploaders: Piotr Ożarowski , Scott Kitterman -Build-Depends: debhelper (>= 9), @bd_i586@ +Uploaders: Piotr Ożarowski , Stefano Rivera +Build-Depends: debhelper (>= 11), @bd_i586@ lsb-release, python3-minimal:any, python3-docutils, - docbook-xml, - docbook-xsl, - w3m, - xsltproc, -Standards-Version: 4.1.1 -Homepage: http://www.python.org/ -Vcs-Bzr: http://alioth.debian.org/anonscm/bzr/pkg-python/python3-defaults-debian -Vcs-Browser: http://alioth.debian.org/scm/loggerhead/pkg-python/python3-defaults-debian/files + python3-sphinx, + html2text, +Standards-Version: 4.5.1 +Homepage: https://www.python.org/ +Vcs-Git: https://salsa.debian.org/cpython-team/python3-defaults.git +Vcs-Browser: https://salsa.debian.org/cpython-team/python3-defaults Package: python3 Architecture: any Multi-Arch: allowed Pre-Depends: python3-minimal (= ${binary:Version}) -Depends: python@VER@ (>= @UPSTRVER@), libpython3-stdlib (= ${binary:Version}), ${misc:Depends}, dh-python -Suggests: python3-doc (>= ${binary:Version}), python3-tk (>= @UPSTRVER@) , python3-venv (>= ${binary:Version}) +Depends: python@VER@ (>= @UPSTRVER@), libpython3-stdlib (= ${binary:Version}), ${misc:Depends} +Suggests: python3-doc (>= ${binary:Version}), python3.9-tk (>= @STDLIBVER@) , python3-venv (>= ${binary:Version}) Replaces: python3-minimal (<< 3.1.2-2) Provides: python3-profiler Description: interactive high-level object-oriented language (default python3 version) @@ -31,28 +29,39 @@ . This package is a dependency package, which depends on Debian's default Python 3 version (currently v@VER@). +XB-Cnf-Extra-Commands: python +XB-Cnf-Priority-Bonus: 5 Package: python3-venv Architecture: any Multi-Arch: allowed -Depends: python@VER@-venv (>= @UPSTRVER@), python3 (= ${binary:Version}), ${misc:Depends} -Description: pyvenv-3 binary for python3 (default python3 version) - Python, the high-level, interactive object oriented language, - includes an extensive class library with lots of goodies for - network programming, system administration, sounds and graphics. +Depends: python@VER@-venv (>= @UPSTRVER@), python3 (= ${binary:Version}), + python3.9-distutils (>= @STDLIBVER@), ${misc:Depends} +Description: venv module for python3 (default python3 version) + This package contains the venv module for the Python language (default python3 + version). + . + The venv module provides support for creating lightweight "virtual + environments" with their own site directories, optionally isolated from system + site directories. Each virtual environment has its own Python binary (which + matches the version of the binary that was used to create this environment) + and can have its own independent set of installed Python packages in its site + directories. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v@VER@). + Python 3 version's venv module (currently v@VER@). Package: python3-minimal Architecture: any Multi-Arch: allowed -Depends: python@VER@-minimal (>= @UPSTRVER@), dpkg (>= 1.13.20), ${misc:Depends} +Pre-Depends: python@VER@-minimal (>= @UPSTRVER@) +Depends: dpkg (>= 1.13.20), ${misc:Depends} Description: minimal subset of the Python language (default python3 version) This package contains the interpreter and some essential modules. It's used in the boot process for some basic tasks. See /usr/share/doc/python@VER@-minimal/README.Debian for a list of the modules contained in this package. +Cnf-Visible-Pkgname: python3 Package: python3-examples Architecture: all @@ -63,49 +72,54 @@ the upstream Python distribution. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v@VER@). + Python 3 version's examples (currently v@VER@). Package: python3-dev Architecture: any Multi-Arch: allowed -Depends: python3 (= ${binary:Version}), libpython3-dev (= ${binary:Version}), python@VER@-dev (>= @UPSTRVER@), ${misc:Depends} -Replaces: python3.1 (<< 3.1.2+20100706-3) +Depends: python3 (= ${binary:Version}), libpython3-dev (= ${binary:Version}), + python@VER@-dev (>= @UPSTRVER@), python3.9-distutils (>= @STDLIBVER@), + ${misc:Depends}, ${sphinxdoc:Depends} +Breaks: python3 (<< 3.9.2-1~) +Replaces: python3.1 (<< 3.1.2+20100706-3), python3 (<< 3.9.2-1~) +Built-Using: ${sphinxdoc:Built-Using} Description: header files and a static library for Python (default) Header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v@VER@). + Python 3 version's headers (currently v@VER@). Package: libpython3-dev Architecture: any Multi-Arch: same Section: libdevel Depends: libpython@VER@-dev (>= @UPSTRVER@), ${misc:Depends} +Breaks: libpython3.8-dev (<< 3.8.0-2), python3-dev (<< 3.8.0-1) +Replaces: libpython3.8-dev (<< 3.8.0-2), python3-dev (<< 3.8.0-1) Description: header files and a static library for Python (default) Header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v@VER@). + Python 3 version's headers (currently v@VER@). Package: libpython3-stdlib Architecture: any Multi-Arch: same Depends: libpython@VER@-stdlib (>= @UPSTRVER@), ${misc:Depends} Description: interactive high-level object-oriented language (default python3 version) - Python, the high-level, interactive object oriented language, - includes an extensive class library with lots of goodies for - network programming, system administration, sounds and graphics. + This package contains the majority of the standard library for the Python + language (default python3 version). . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v@VER@). + Python 3 version's standard library (currently v@VER@). Package: idle Architecture: all -Depends: python3 (>= ${binary:Version}), python3-tk, ${misc:Depends}, idle-python@VER@ +Depends: python3 (>= ${binary:Version}), python3.9-tk, ${misc:Depends}, idle-python@VER@ Enhances: python3 Breaks: idle3 (<< 3.6.2-2) Replaces: idle3 (<< 3.6.2-2) @@ -114,7 +128,7 @@ IDLE is written using Tkinter and therefore quite platform-independent. . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v@VER@). + Python 3 version's IDLE (currently v@VER@). Package: idle3 Architecture: all @@ -147,13 +161,12 @@ * Distributing Python Modules . This package is a dependency package, which depends on Debian's default - Python 3 version (currently v@VER@). + Python 3 version's documentation (currently v@VER@). Package: python3-dbg Architecture: any Multi-Arch: allowed Section: debug -Priority: extra Depends: python3 (= ${binary:Version}), libpython3-dbg (= ${binary:Version}), python@VER@-dbg (>= @UPSTRVER@), ${misc:Depends} Description: debug build of the Python 3 Interpreter (version @VER@) Python 3 interpreter configured with --pydebug. Dynamically loaded modules @@ -163,8 +176,9 @@ Architecture: any Multi-Arch: same Section: debug -Priority: extra Depends: libpython@VER@-dbg (>= @UPSTRVER@), ${misc:Depends} +Breaks: python3-dbg (<< 3.8.0-1) +Replaces: python3-dbg (<< 3.8.0-1) Description: debug build of the Python 3 Interpreter (version @VER@) Python 3 interpreter configured with --pydebug. Dynamically loaded modules are searched in /usr/lib/python@VER@/lib-dynload/debug first. @@ -172,10 +186,12 @@ Package: python3-all Architecture: any Multi-Arch: allowed -Depends: python3 (= ${binary:Version}), ${misc:Depends}, - python3.6 +Depends: python3 (= ${binary:Version}), + ${misc:Depends}, + python3.9-distutils (>= @STDLIBVER@), + python3.9, Description: package depending on all supported Python 3 runtime versions - The package currently depends on python3.6, in the future, + The package currently depends on python3.9, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . @@ -185,10 +201,14 @@ Package: python3-all-dev Architecture: any Multi-Arch: allowed -Depends: python3 (= ${binary:Version}), libpython3-all-dev (= ${binary:Version}), python3-all (= ${binary:Version}), python3-dev (= ${binary:Version}), ${misc:Depends}, - python3.6-dev +Depends: python3 (= ${binary:Version}), + libpython3-all-dev (= ${binary:Version}), + python3-all (= ${binary:Version}), + python3-dev (= ${binary:Version}), + ${misc:Depends}, + python3.9-dev, Description: package depending on all supported Python 3 development packages - The package currently depends on python3.6-dev, in the + The package currently depends on python3.9-dev, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . @@ -200,11 +220,14 @@ Architecture: any Multi-Arch: allowed Section: debug -Priority: extra -Depends: python3 (= ${binary:Version}), libpython3-all-dbg (= ${binary:Version}), python3-all (= ${binary:Version}), python3-dbg (= ${binary:Version}), ${misc:Depends}, - python3.6-dbg +Depends: python3 (= ${binary:Version}), + libpython3-all-dbg (= ${binary:Version}), + python3-all (= ${binary:Version}), + python3-dbg (= ${binary:Version}), + ${misc:Depends}, + python3.9-dbg, Description: package depending on all supported Python 3 debugging packages - The package currently depends on python3.6-dbg, in the + The package currently depends on python3.9-dbg, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . @@ -215,10 +238,11 @@ Architecture: any Multi-Arch: same Section: libdevel -Depends: libpython3-dev (= ${binary:Version}), ${misc:Depends}, - libpython3.6-dev +Depends: libpython3-dev (= ${binary:Version}), + ${misc:Depends}, + libpython3.9-dev, Description: package depending on all supported Python 3 development packages - The package currently depends on libpython3.6-dev, in the + The package currently depends on libpython3.9-dev, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . @@ -230,13 +254,61 @@ Architecture: any Multi-Arch: same Section: debug -Priority: extra -Depends: libpython3-dbg (= ${binary:Version}), ${misc:Depends}, - libpython3.6-dbg +Depends: libpython3-dbg (= ${binary:Version}), + ${misc:Depends}, + libpython3.9-dbg, Description: package depending on all supported Python 3 debugging packages - The package currently depends on libpython3.6-dbg, in the + The package currently depends on libpython3.9-dbg, in the future, dependencies on jython (Python for a JVM) and ironpython (Python for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python 3 debug packages. + +Package: 2to3 +Architecture: all +Multi-Arch: foreign +Depends: python3.9-lib2to3 (>= @STDLIBVER@), python3 (>= ${binary:Version}), ${misc:Depends} +Breaks: python (<< 2.7.14-4) +Replaces: python (<< 2.7.14-4) +Description: 2to3 binary using python3 + 2to3 is a Python program that reads Python 2.x source code and applies a + series of fixers to transform it into valid Python 3.x code. The standard + library contains a rich set of fixers that will handle almost all code. 2to3 + supporting library lib2to3 is, however, a flexible and generic library, so it + is possible to write your own fixers for 2to3. lib2to3 could also be adapted + to custom applications in which Python code needs to be edited automatically. + . + This package is a dependency package, which depends on Debian's default + Python 3 2to3 version (currently v@VER@). + +Package: python3-full +Architecture: any +Multi-Arch: allowed +Depends: python3 (= ${binary:Version}), + python3.9-full (>= @UPSTRVER@), + python3-venv (= ${binary:Version}), + 2to3, + idle, + python3.9-distutils, + python3.9-gdbm, + python3.9-lib2to3, + python3.9-tk, + ${shlibs:Depends}, ${misc:Depends} +Recommends: python3-doc, python3-examples, +Suggests: python3-dev +Description: Default Python Interpreter with complete class library + Python, the high-level, interactive object oriented language, + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package is a dependency package, which depends on the full + standard library of Python for Python developers. Including modules + used only at build-time, such as venv and distutils, and modules with + complex dependencies, such as tk and IDLE. All batteries included. + . + This package depends on Debian's default python 3 version's full + standard library (currently v3.9). + . + According to the Debian Python policy, this package must not be used in + build dependencies, dependencies and recommendations. diff -Nru python3-defaults-3.6.3/debian/debian_defaults python3-defaults-3.9.4/debian/debian_defaults --- python3-defaults-3.6.3/debian/debian_defaults 2017-10-26 08:39:35.000000000 +0000 +++ python3-defaults-3.9.4/debian/debian_defaults 2020-12-04 13:05:26.000000000 +0000 @@ -1,12 +1,12 @@ [DEFAULT] # the default python3 version -default-version = python3.6 +default-version = python3.9 # all supported python3 versions -supported-versions = python3.6 +supported-versions = python3.9 # formerly supported python3 versions -old-versions = python3.1, python3.2, python3.3, python3.4, python3.5 +old-versions = python3.1, python3.2, python3.3, python3.4, python3.5, python3.6, python3.7, python3.8 # unsupported versions, including older versions -unsupported-versions = python3.1, python3.2, python3.3, python3.4, python3.5 +unsupported-versions = python3.1, python3.2, python3.3, python3.4, python3.5, python3.6, python3.7 diff -Nru python3-defaults-3.6.3/debian/html.xsl python3-defaults-3.9.4/debian/html.xsl --- python3-defaults-3.6.3/debian/html.xsl 2017-09-01 06:38:43.000000000 +0000 +++ python3-defaults-3.9.4/debian/html.xsl 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ - - - - - 1 - 1 - diff -Nru python3-defaults-3.6.3/debian/idle.desktop python3-defaults-3.9.4/debian/idle.desktop --- python3-defaults-3.6.3/debian/idle.desktop 2017-10-10 08:39:45.000000000 +0000 +++ python3-defaults-3.9.4/debian/idle.desktop 2018-06-08 22:16:26.000000000 +0000 @@ -1,9 +1,9 @@ [Desktop Entry] -Name=IDLE 3 +Name=IDLE Comment=Integrated DeveLopment Environment for Python3 -Exec=/usr/bin/idle %U +Exec=/usr/bin/idle %F TryExec=/usr/bin/idle -Icon=/usr/share/pixmaps/idle3.xpm +Icon=/usr/share/pixmaps/idle.xpm Terminal=false Type=Application Categories=Application;Development; diff -Nru python3-defaults-3.6.3/debian/python-policy.dbk python3-defaults-3.9.4/debian/python-policy.dbk --- python3-defaults-3.6.3/debian/python-policy.dbk 2017-09-01 06:38:08.000000000 +0000 +++ python3-defaults-3.9.4/debian/python-policy.dbk 1970-01-01 00:00:00.000000000 +0000 @@ -1,695 +0,0 @@ - - - - - Debian Python Policy - - Neil Schemenauer - nas@debian.org - - - Matthias Klose - doko@debian.org - - - Gregor Hoffleit - flight@debian.org - - - Josselin Mouette - joss@debian.org - - - Joe Wreschnig - piman@debian.org - - version 0.4.1.0 - - - This document describes the packaging of Python within the - Debian GNU/Linux distribution and the policy requirements for - packaged Python programs and modules. - - - 1999 2001 2003 2006 Software in the - Public Interest - - - This manual is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - - - This is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - the GNU General Public License for more details. - - - A copy of the GNU General Public License is available as - /usr/share/common-licences/GPL in the Debian GNU/Linux - distribution or on the World Wide Web at - The GNU Public Licence. - - - You can also obtain it by writing to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - - - Python Packaging -
- Versions - - At any given time, the package python will - represent the current default Debian Python version. - - - The default Debian Python version should alway be the latest stable - upstream release that can be integrated in the distribution. - - - Apart from the default version, legacy versions of Python - or beta versions of future releases - may be included as well in the distribution, as long as they - are needed by other packages, or as long as it seems - reasonable to provide them. (Note: For the scope of this - document, Python versions are synonymous to feature - releases, i.e. Python 2.0 and 2.0.1 are subminor versions of - the same Python version 2.0, but Python 2.1 and 2.2 are - indeed different versions.) - - - For any version, the main package must be called - pythonX.Y. - - - - The set of currently supported python versions can be found - in /usr/share/python/debian_defaults. - - -
- -
- Main package - - For every Python version provided in the distribution, the - package pythonX.Y - shall comprise a complete distribution for - deployment of Python scripts and applications. The - package includes the binary - /usr/bin/pythonX.Y and - all modules of the upstream Python distribution. - - - Excluded are any modules that depend on - non-required packages, they will be provided in - separate packages. Some tools and files for the - development of Python modules are split off in a - separate package - pythonX.Y-dev. - Documentation will be provided separately as well. - - - At any time, the python package must contain - a symlink /usr/bin/python to the the appropriate binary - /usr/bin/pythonX.Y. The - python package must also depend on the - appropriate pythonX.Y - to ensure this binary is installed. The version of the - python package must be greater than or equal to - X.Y and smaller than X.Y+1. - -
- -
- Python Interpreter -
- Interpreter Name - - Python scripts depending on the default Python version (see ) or not depending on a specific Python version should - use python (unversioned) as the interpreter name. - - - Python scripts that only work with a specific Python version must - explicitly use the versioned interpreter name - (pythonX.Y). - -
-
- Interpreter Location - - The preferred specification for the Python interpreter is - /usr/bin/python or - /usr/bin/pythonX.Y. - This ensures that a Debian installation of python is used - and all dependencies on additional python modules are met. - - - If a maintainer would like to provide the user with the - possibility to override the Debian Python interpreter, he - may want to use /usr/bin/env python or - /usr/bin/env pythonX.Y. - However this is not advisable as it bypasses Debian's dependency - checking and makes the package vulnerable to incomplete local - installations of python. - -
-
- -
- Module Path - - The module search path for Debian has been amended to - include a directory tree in /usr/local at the beginning of - the path. By default, sys.path is searched in the following - order: - -/usr/lib/pythonXY.zip -/usr/lib/pythonX.Y -/usr/lib/pythonX.Y/plat-linux2 -/usr/lib/pythonX.Y/lib-tk -/usr/lib/pythonX.Y/lib-dynload -/usr/local/lib/pythonX.Y/site-packages -/usr/lib/pythonX.Y/site-packages -/var/lib/python-support/pythonX.Y -/usr/lib/pythonX.Y/site-packages/module-dir -/usr/lib/site-python - - - - The use of the /usr/lib/site-python directory - is deprecated. The directory may be dropped from the path in - a future version. The /usr/lib/pythonXY.zip - archive appeared in python2.3; it is not currently used in - Debian. Modules should not install directly to the - /var/lib/python-support directory; it is for - use by . - -
- -
- Documentation - - Python documentation is split out in separate packages - pythonX.Y-doc. The package - python-doc will always provide the documentation - for the default Debian Python version. - - - TODO: Policy for documentation of third party packages. - -
-
- - - Packaged Modules - - The goal of these policies is to reduce the work necessary for - Python transitions. Python modules are internally very - dependent on a specific Python version. However, we want to - automate recompiling modules when possible, either during the - upgrade itself (re-bytecompiling pyc and pyo files) or shortly - thereafter with automated rebuilds (to handle C - extensions). These policies encourage automated dependency - generation and loose version bounds whenever possible. - -
- Types of Python Modules - - There are two kinds of Python modules, "pure" Python - modules, and extension modules. Pure Python modules are - Python source code that works across many versions of - Python. Extensions are C code compiled and linked against a - specific version of the libpython library, and so can only - be used by one version of Python. - - - Python packages are directories containing at least a - __init__.py, other modules, extensions and - packages (A package in the Python sense is unrelated to a - Debian package). Python packages must be packaged into the - same directory (as done by upstream). Splitting components - of a package across directories changes the import order and - may confuse documentation tools and IDEs. - - - There are two ways to distribute Python modules. Public - modules are installed in one of the directories listed - in . They are accessible to any - program. Private modules are installed in a directory such - as /usr/share/packagename - or /usr/lib/packagename. They are - generally only accessible to a specific program or suite of - programs included in the same package. - -
-
- Module Package Names - - Public modules should be packaged with a name - of python-foo, - where foo is the name of the module. Such a - package should support the current Debian Python version, - and more if possible (there are several tools to help - implement this, see ). For - example, if Python 2.3, 2.4, and 2.5 are supported, the - Python command - -import foo - - should import the module when the user is running any - of /usr/bin/python2.3, /usr/bin/python2.4, - and /usr/bin/python2.5. This requirement also - applies to extension modules; binaries for all the supported - Python versions should be included in a single package. - -
-
- Specifying Supported Versions - - The XS-Python-Version field - in debian/control specifies the versions of - Python supported by the package. This is used to track - packages during Python transitions, and is also used by some - packaging scripts to automatically generate appropriate - Depends and Provides lines. The format of the field may be - one of the following: - -XS-Python-Version: all -XS-Python-Version: current -XS-Python-Version: current, >= X.Y -XS-Python-Version: >= X.Y -XS-Python-Version: >= A.B, << X.Y -XS-Python-Version: A.B, X.Y - - Where "all" means the package supports any Python version - available, and "current" means it supports Debian's current - Python version. Explicit Versions or version ranges can also - be used. - - - Your control file should also have a line: - -XB-Python-Version: ${python:Versions} - - The python:Versions is substituted by the supported Python - versions of the binary package, based on - XS-Python-Version. (If you are not using - dh_python you will need to handle this - substitution yourself.) The format of the field - XB-Python-Version is the same as the - XS-Python-Version field for packages not containing - extensions. Packages with extensions must list the versions - explicitely. - - - If your package is used by another module or application - that requires a specific Python version, it should also - Provide: pythonX.Y-foo for - each version it supports. - -
- -
- Dependencies - - Packaged modules available for the default Python version - (or many versions including the default) as described - in must depend on "python - (>= X.Y)". If they - require other modules to work, they must depend on the - corresponding python-foo. They must not - depend on - any pythonX.Y-foo. - - - Packaged modules available for one particular version of Python must - depend on the corresponding - pythonX.Y package instead. - If they need other modules, they must depend on the corresponding - pythonX.Y-foo packages, and - must not depend on any python-foo. - -
- -
- Provides - - Provides in packages of the form - python-foo must be specified, - if the package contains an extension for more than one - python version. Provides should also be added on request of - maintainers who depend on a non-default python version. - - - Packaged modules available for one particular version of Python must - depend on the corresponding - pythonX.Y package instead. - If they need other modules, they must depend on the corresponding - pythonX.Y-foo packages, and - must not depend on any python-foo. - -
- -
- Modules Bytecompilation - - If a package provides any binary-independent modules - (foo.py files), the corresponding bytecompiled - modules (foo.pyc files) and optimized modules - (foo.pyo files) must not ship in the - package. Instead, they should be generated in the package's - postinst, and removed in the package's prerm. The package's - prerm has to make sure that both foo.pyc and - foo.pyo are removed. - - - A package should only byte-compile the files which belong to - the package. - - - The file /etc/python/debian_config allows - configuration how modules should be byte-compiled. The - postinst scripts should respect these settings. - - - Modules in private installation directories and in - /usr/lib/site-python should be byte-compiled, - when the default python version changes. - -
-
- - - Python Programs - -
- Programs using the default python - - Programs that can run with any version of Python must - begin with #!/usr/bin/python or #!/usr/bin/env - python (the former is preferred). They must also - specify a dependency on python, with a - versioned dependency if necessary. - - - If the program needs the python module foo, - it must depend on python-foo. - - -
- Programs Shipping Private Modules - - A program using /usr/bin/python as - interpreter can come up with private Python modules. These - modules should be installed in - /usr/share/module, or - /usr/lib/module if the modules are - architecture-dependent (e.g. extensions). - - - /usr/lib/site-python is deprecated and should - no longer be used for this purpose. - - - The rules explained in apply to - those private modules: the bytecompiled modules must not - be shipped with the package, they should be generated in - the package's postinst, using the current default Python - version, and removed in the prerm. Modules should be - bytecompiled using the current default Python version. - - - Programs that have private compiled extensions must either - handle multiple version support themselves, or declare a - tight dependency on the current Python version - (e.g. Depends: python (>= 2.4), python (<= 2.5). No - tools currently exist to alleviate this situation. - -
-
- -
- Programs Using a Particular Python Version - - A program which requires a specific version of Python must - begin with - #!/usr/bin/pythonX.Y (or - #!/usr/bin/env pythonX.Y). It - must also specify a dependency on - pythonX.Y and on - any pythonX.Y-foo - package providing necessary modules. It should not depend on - any python-foo package, unless it - requires a specific version of the package (since virtual - packages cannot be versioned). If this is the case, it - should depend on both the virtual package and the main - package (e.g. Depends: python2.4-foo, python-foo (>= - 1.0)). - - - The notes on installation directories and bytecompilation - for programs that support any version of Python also apply - to programs supporting only a single Python version. Modules - to be bytecompiled should use the same Python version as the - package itself. - -
-
- - - Programs Embedding Python - -
- Building Embedded Programs - - Programs which embed a Python interpreter must declare a - Build-Depends on - pythonX.Y-dev, where - pythonX.Y is the python version the program - builds against. It should be the current default python version - unless the program doesn't work correctly with this version. - -
- -
- Embedded Python Dependencies - - Dependencies for programs linking against the shared Python - library will be automatically created by - dpkg-shlibdeps. The - libpythonX.Y.so.Z library - the program is built against is provided by the - pythonX.Y package. - -
-
- - - Interaction with Locally Installed Python Versions - - As long as you don't install other versions of Python in your - path, Debian's Python versions won't be affected by a new - version. - - - If you install a different subrelease of the version of python - you've got installed, you'll need to be careful to install all - the modules you use for that version of python too. - - - - - - Build Dependencies - - Build dependencies for Python dependent packages must be - declared for every Python version that the package is built - for. The python-all-dev should be used when - building modules for any or all Python versions. To build for - a specific version or versions, Build-Depend on - pythonX.Y-dev. - - - Some applications and pure Python modules may be able to - depend only on python - or python-all and not require the -dev - packages. - - - - Build-Depend on at least: - -Build-Depends: python2.3 (>= 2.3-1) -Build-Depends: python2.4 (>= 2.4-1) -Build-Depends: python (>= 2.3.5-7) -Build-Depends: python-all - -Build-Depends: python2.3-dev (>= 2.3-1) -Build-Depends: python2.4-dev (>= 2.4-1) -Build-Depends: python-dev (>= 2.3.5-7) -Build-Depends: python-all-dev - - - - If you use either python-support or - python-central you must additionally - Build-Depend on those. If you are using dh_python - at all, you must Build-Depend on python, as - debhelper does not depend on it. - - - - - Packaging Tools - - This section describes the various tools to help package - Python programs and modules for Debian. Although none of these - tools are mandatory, their use is strongly encouraged, as the - above policy has been designed with them in mind (and vice - versa). This appendix is just an overview. If you use these - tools, you should read their full documentation. - -
- python-support - - The python-support system provides a simple way to - bytecompile pure Python modules and manage dependencies. It - integrates with debhelper. When using - python-support, you should install your modules - to /usr/share/python-support/package - rather than the standard Python directories. python-support - will then handle compiling the modules and making - appropriate symbolic links for installed Python versions to - find them, - substitute ${python:Depends}, ${python:Versions}, - and ${python:Provides} in your control file, and - manage bytecompilation in your postinst/prerm. - - - To use it, call dh_pysupport - before dh_python, and make sure you've - installed the modules in the right place: - -PREFIX := debian/python-package/usr -... -install: - ... - ./setup.py install --no-compile \ - --install-lib=$(PREFIX)/share/python-support/python-package -binary-indep: build install - ... - dh_pysupport - dh_python - ... - - - - python-support can also manage private modules. To use this - feature, pass a list of directories to be managed by - python-support to dh_pysupport - and dh_python. python-support cannot handle - compiled extensions. - -
- -
- python-central - - python-central provides another way to manage Python - modules. It integrates with debhelper, - but can also be used without it. When using python-central, - you should install your modules normally. It will then move - them to its private directory, and manage the same things - python-support does. - - - To use it, call dh_pycentral - before dh_python: - -install: - ... - ./setup.py install - -binary-indep: build install - ... - dh_pycentral - dh_python - ... - - - - python-central can handle compiled extensions for multiple - Python versions. If you want python-central to handle - private modules, you must pass the list of directories - containing them to dh_python (but - not dh_pycentral). - - - If python-central should not move the files to its private - directory, useDH_PYCENTRAL=nomove dh_pycentral - instead. - - - Examples for source packages using python-central are - pyenchant, python-imaging (modules and extensions), - pyparallel (modules only). - -
- -
- CDBS - - FIXME: Someone familiar with CDBS should write this part. - -
- -
- - - Upgrade Procedure - - This section describes the procedure for the upgrade when the - default python version is changed in the unstable - distribution, requiring recompilation of many python-related - packages. - - - - - - Have a long and heated discussion. - - - - - The Debian Python maintainer decides for the new default Debian - Python version and announces the upgrade. - - - - - Upload of the python core metapackages python, - python-dev, python-doc and - several python-module, depending on - the new pythonX.Y, - pythonX.Y-dev and so on. - - - - - The release team schedules rebuilds for packages that - may need it. Packages that require manual work get - updated and uploaded. - - - - - -
diff -Nru python3-defaults-3.6.3/debian/rules python3-defaults-3.9.4/debian/rules --- python3-defaults-3.6.3/debian/rules 2017-10-10 06:41:40.000000000 +0000 +++ python3-defaults-3.9.4/debian/rules 2021-04-06 17:28:56.000000000 +0000 @@ -22,10 +22,13 @@ distrelease := $(shell lsb_release -cs) # requiered python3.x version -UPSTRVER := 3.6.3-1~ +UPSTRVER := 3.9.4-0~ + +# required versions of python3-lib2to3 and python3-distutils +STDLIBVER := 3.9.4-0~ ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric precise quantal raring saucy trusty)) - bd_i586 = dpkg-dev (>= 1.17.11), python3.6 (>= 3.6.3-1~), + bd_i586 = dpkg-dev (>= 1.17.11), python3.9:any (>= 3.9.4-0~), else bd_i586 = dpkg-dev (>= 1.16.1~), endif @@ -52,20 +55,24 @@ touch stamp-build stamp-doc-policy: - xsltproc --nonet --novalid debian/html.xsl debian/python-policy.dbk \ - | w3m -o display_charset=UTF-8 -cols 70 -dump -no-graph -T text/html > python-policy.txt - mv -f python-policy.txt debian/ - rm -rf debian/python-policy.html - mkdir python-policy.html - ( cd python-policy.html; xsltproc --nonet --novalid ../debian/chunk.xsl ../debian/python-policy.dbk ) - mv -f python-policy.html debian/ + : # compact text version + $(MAKE) -C policy singlehtml SPHINXOPTS='-D html_theme_options.nosidebar=true' + ( \ + echo 'The HTML version of the Debian Python Policy can be found in the python3-dev package'; \ + html2text -utf8 -style pretty policy/_build/singlehtml/index.html; \ + ) > policy/_build/python-policy.txt + rm -rf policy/_build/singlehtml + + : # dh_sphinxdoc cannot handle singlehtml, so build both and then discard html + $(MAKE) -C policy html singlehtml touch stamp-doc-policy -stamp-doc: #stamp-doc-policy +stamp-doc: stamp-doc-policy touch stamp-doc control-file: sed -e "s/@UPSTRVER@/$(UPSTRVER)/g" \ + -e "s/@STDLIBVER@/$(STDLIBVER)/g" \ -e "s/@IPKGVER@/$(IPKGVER)/g" \ -e "s/@NVER@/$(NVER)/g" \ -e "s/@VER@/$(VER)/g" \ @@ -105,8 +112,7 @@ rm -f stamp-* rm -f patch-stamp* - rm -f debian/python-policy.txt - rm -rf debian/python-policy.html + rm -rf policy/_build rm -f faq/*.h2 faq/*.html set -e;\ @@ -198,6 +204,13 @@ mkdir -p debian/idle/usr/share/applications cp -p debian/idle.desktop debian/idle/usr/share/applications/ + : # provide the 2to3-3 a and 2to3-3.1 defaults + mkdir -p debian/2to3/usr/bin + install -m 755 debian/2to3.py debian/2to3/usr/bin/2to3 + + mkdir -p debian/2to3/usr/share/man/man1 + install -m 644 debian/2to3.1 debian/2to3/usr/share/man/man1/2to3.1 + # dh_installdebconf -i $(NOPKGS) dh_lintian -i dh_installdocs -i $(NOPKGS) --all debian/README.Debian @@ -217,7 +230,7 @@ dh_builddeb -i $(NOPKGS) # Build architecture-dependent files here. -binary-arch: build install +binary-arch: build install stamp-doc dh_testdir -a dh_testroot -a dh_installman -a @@ -225,12 +238,9 @@ : # provide the python and python.1 defaults mkdir -p debian/python3-minimal/usr/bin ln -sf python$(VER) debian/python3-minimal/usr/bin/python3 - ln -sf python$(VER)m debian/python3-minimal/usr/bin/python3m mkdir -p debian/python3-minimal/usr/share/man/man1 ln -sf python$(VER).1.gz \ debian/python3-minimal/usr/share/man/man1/python3.1.gz - ln -sf python$(VER)m.1.gz \ - debian/python3-minimal/usr/share/man/man1/python3m.1.gz : # mkdir -p debian/python3-minimal/usr/share/python3 @@ -264,22 +274,30 @@ debian/python3/usr/share/man/man1/pdb3.1.gz mkdir -p debian/python3/usr/share/doc/python3 -ifeq (0,1) - cp -a debian/python-policy.{html,dbk,txt} \ - debian/python/usr/share/doc/python3/ -endif + cp -p policy/_build/python-policy.txt \ + debian/python3/usr/share/doc/python3/ + + mkdir -p debian/python3-dev/usr/share/doc/python3 + : # dh_sphinxdoc cannot handle singlehtml, so build both and then discard html + cp -a policy/_build/html/* \ + debian/python3-dev/usr/share/doc/python3/ + dh_sphinxdoc -v -p python3-dev + rm -rf debian/python3-dev/usr/share/doc/python3/_sources + rm -f debian/python3-dev/usr/share/doc/python3/*.html + rm -f debian/python3-dev/usr/share/doc/python3/objects.inv + + cp -p policy/_build/singlehtml/index.html \ + debian/python3-dev/usr/share/doc/python3/python-policy.html + ln -sf python-policy.html \ + debian/python3-dev/usr/share/doc/python3/index.html mkdir -p debian/python3/usr/share/pixmaps ln -sf python$(VER).xpm debian/python3/usr/share/pixmaps/python3.xpm -ifeq (0,1) - : # add symlinks to policy files - mkdir -p debian/python/usr/share/doc/python$(VER) - for ext in html dbk.gz txt.gz; do \ - ln -sf ../python/python-policy.$$ext \ - debian/python/usr/share/doc/python$(VER)/python-policy.$$ext; \ - done -endif + : # add symlinks to policy text file + mkdir -p debian/python3/usr/share/doc/python$(VER) + ln -sf ../python3/python-policy.txt.gz \ + debian/python3/usr/share/doc/python$(VER)/python-policy.txt.gz ifeq (0,1) mkdir -p debian/python3/usr/share/apps/konsole @@ -288,41 +306,41 @@ : # provide the python3-config default mkdir -p debian/python3-dev/usr/bin - ln -sf python$(VER)m-config debian/python3-dev/usr/bin/python3m-config - mkdir -p debian/python3-dev/usr/share/man/man1 - ln -sf python$(VER)m-config.1.gz \ - debian/python3-dev/usr/share/man/man1/python3m-config.1.gz ln -sf python$(VER)-config debian/python3-dev/usr/bin/python3-config + mkdir -p debian/python3-dev/usr/share/man/man1 ln -sf python$(VER)-config.1.gz \ debian/python3-dev/usr/share/man/man1/python3-config.1.gz : # provide pkgconfig defaults - mkdir -p debian/python3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig - ln -sf python-$(VER).pc debian/python3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3.pc - mkdir -p debian/python3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig - ln -sf python-$(VER)-dbg.pc debian/python3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3-dbg.pc - -ifeq (0,1) - : # provide pyconfig.h in the non-multiarch location. - mkdir -p debian/python3-dev/usr/include/python$(VER)m - ln -sf ../$(DEB_HOST_MULTIARCH)/python$(VER)m/pyconfig.h \ - debian/python3-dev/usr/include/python$(VER)m/pyconfig.h - mkdir -p debian/python3-dbg/usr/include/python$(VER)dm - ln -sf ../$(DEB_HOST_MULTIARCH)/python$(VER)dm/pyconfig.h \ - debian/python3-dbg/usr/include/python$(VER)dm/pyconfig.h -endif + mkdir -p debian/libpython3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig + ln -sf python-$(VER).pc \ + debian/libpython3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3.pc + + mkdir -p debian/libpython3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig + ln -sf python-$(VER)-dbg.pc \ + debian/libpython3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3-dbg.pc + ln -sf python-$(VER)d.pc \ + debian/libpython3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3d.pc + + ln -sf python-$(VER)-embed.pc \ + debian/libpython3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3-embed.pc + + ln -sf python-$(VER)d-embed.pc \ + debian/libpython3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3d-embed.pc + ln -sf python-$(VER)d-embed.pc \ + debian/libpython3-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python3-dbg-embed.pc : # provide the python-dbg and python-dbg.1 defaults mkdir -p debian/python3-dbg/usr/bin - ln -sf python$(VER)dm debian/python3-dbg/usr/bin/python3dm - ln -sf python$(VER)dm-config debian/python3-dbg/usr/bin/python3dm-config + ln -sf python$(VER)d debian/python3-dbg/usr/bin/python3d + ln -sf python$(VER)d-config debian/python3-dbg/usr/bin/python3d-config ln -sf python$(VER)-dbg debian/python3-dbg/usr/bin/python3-dbg ln -sf python$(VER)-dbg-config debian/python3-dbg/usr/bin/python3-dbg-config mkdir -p debian/python3-dbg/usr/share/man/man1 - ln -sf python$(VER)dm.1.gz \ - debian/python3-dbg/usr/share/man/man1/python3dm.1.gz - ln -sf python$(VER)dm-config.1.gz \ - debian/python3-dbg/usr/share/man/man1/python3dm-config.1.gz + ln -sf python$(VER)d.1.gz \ + debian/python3-dbg/usr/share/man/man1/python3d.1.gz + ln -sf python$(VER)d-config.1.gz \ + debian/python3-dbg/usr/share/man/man1/python3d-config.1.gz ln -sf python$(VER)-dbg.1.gz \ debian/python3-dbg/usr/share/man/man1/python3-dbg.1.gz ln -sf python$(VER)-dbg-config.1.gz \ @@ -339,59 +357,44 @@ : # provide the DEB_HOST_GNU_TYPE/DEB_HOST_MULTIRACH python-config defaults mkdir -p debian/libpython3-dev/usr/bin - ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)m-config \ - debian/libpython3-dev/usr/bin/$(DEB_HOST_MULTIARCH)-python3m-config ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-config \ debian/libpython3-dev/usr/bin/$(DEB_HOST_MULTIARCH)-python3-config mkdir -p debian/libpython3-dev/usr/share/man/man1 - ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)m-config.1.gz \ - debian/libpython3-dev/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3m-config.1.gz ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-config.1.gz \ debian/libpython3-dev/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3-config.1.gz ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) - ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)m-config \ - debian/libpython3-dev/usr/bin/$(DEB_HOST_GNU_TYPE)-python3m-config ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-config \ debian/libpython3-dev/usr/bin/$(DEB_HOST_GNU_TYPE)-python3-config - ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)m-config.1.gz \ - debian/libpython3-dev/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3m-config.1.gz ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-config.1.gz \ debian/libpython3-dev/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3-config.1.gz endif mkdir -p debian/libpython3-dbg/usr/bin - ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)dm-config \ - debian/libpython3-dbg/usr/bin/$(DEB_HOST_MULTIARCH)-python3dm-config + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)d-config \ + debian/libpython3-dbg/usr/bin/$(DEB_HOST_MULTIARCH)-python3d-config ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-dbg-config \ debian/libpython3-dbg/usr/bin/$(DEB_HOST_MULTIARCH)-python3-dbg-config mkdir -p debian/libpython3-dbg/usr/share/man/man1 - ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)dm-config.1.gz \ - debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3dm-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)d-config.1.gz \ + debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3d-config.1.gz ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-dbg-config.1.gz \ debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python3-dbg-config.1.gz ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) - ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)dm-config \ - debian/libpython3-dbg/usr/bin/$(DEB_HOST_GNU_TYPE)-python3dm-config + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)d-config \ + debian/libpython3-dbg/usr/bin/$(DEB_HOST_GNU_TYPE)-python3d-config ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-dbg-config \ debian/libpython3-dbg/usr/bin/$(DEB_HOST_GNU_TYPE)-python3-dbg-config - ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)dm-config.1.gz \ - debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3dm-config.1.gz + ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)d-config.1.gz \ + debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3d-config.1.gz ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-dbg-config.1.gz \ debian/libpython3-dbg/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python3-dbg-config.1.gz endif - : # provide the pyvenv and pyvenv.1 defaults - mkdir -p debian/python3-venv/usr/bin - ln -sf pyvenv-$(VER) debian/python3-venv/usr/bin/pyvenv - mkdir -p debian/python3-venv/usr/share/man/man1 - ln -sf pyvenv-$(VER).1.gz \ - debian/python3-venv/usr/share/man/man1/pyvenv.1.gz - dh_lintian -a dh_installdocs -a $(NOPKGS) --all debian/README.Debian dh_installchangelogs -a $(NOPKGS) - for p in all all-dev all-dbg dbg dev venv; do \ + for p in all all-dev all-dbg dbg dev venv full; do \ case $$p in idle*) : ;; *) p=python3-$$p; esac; \ rm -rf debian/$$p/usr/share/doc/$$p; \ ln -sf python3 debian/$$p/usr/share/doc/$$p; \ diff -Nru python3-defaults-3.6.3/debian/valgrind-python.supp python3-defaults-3.9.4/debian/valgrind-python.supp --- python3-defaults-3.6.3/debian/valgrind-python.supp 2012-12-03 21:49:53.000000000 +0000 +++ python3-defaults-3.9.4/debian/valgrind-python.supp 2018-06-05 21:35:36.000000000 +0000 @@ -6,9 +6,9 @@ # The file Misc/valgrind-python.supp is placed in an modified form into the # directory /usr/lib/valgrind as python.supp. There's no need to to add it # with the --suppressions option. -# The unmodified file is found in /usr/share/doc/python2.4/ +# The unmodified file is found in /usr/share/doc/python3.6/ # -# The python2.4-dbg build has been compiled with -DPy_USING_MEMORY_DEBUGGER +# The python3.6-dbg build has been compiled with -DPy_USING_MEMORY_DEBUGGER # so you can safely comment out the suppressions for PyObject_Free and # PyObject_Realloc. # --------------------------------------------------------------------------- @@ -17,67 +17,476 @@ # # cd python/dist/src # valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \ -# ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network +# ./python -E ./Lib/test/regrtest.py -u gui,network # # You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER -# to use the preferred suppressions with Py_ADDRESS_IN_RANGE. +# to use the preferred suppressions with address_in_range. # # If you do not want to recompile Python, you can uncomment # suppressions for PyObject_Free and PyObject_Realloc. # -# See /usr/share/doc/python2.4/README.valgrind for more information. +# See Misc/README.valgrind for more information. # all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif { ADDRESS_IN_RANGE/Invalid read of size 4 Memcheck:Addr4 - fun:Py_ADDRESS_IN_RANGE + fun:address_in_range } { ADDRESS_IN_RANGE/Invalid read of size 4 Memcheck:Value4 - fun:Py_ADDRESS_IN_RANGE + fun:address_in_range +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64) + Memcheck:Value8 + fun:address_in_range } { ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value Memcheck:Cond - fun:Py_ADDRESS_IN_RANGE + fun:address_in_range } +# +# Leaks (including possible leaks) +# Hmmm, I wonder if this masks some real leaks. I think it does. +# Will need to fix that. +# + { - ADDRESS_IN_RANGE/Invalid read of size 4 - Memcheck:Addr4 - fun:PyObject_Free + Suppress leaking the GIL. Happens once per process, see comment in ceval.c. + Memcheck:Leak + fun:malloc + fun:PyThread_allocate_lock + fun:PyEval_InitThreads } { - ADDRESS_IN_RANGE/Invalid read of size 4 + Suppress leaking the GIL after a fork. + Memcheck:Leak + fun:malloc + fun:PyThread_allocate_lock + fun:PyEval_ReInitThreads +} + +{ + Suppress leaking the autoTLSkey. This looks like it shouldn't leak though. + Memcheck:Leak + fun:malloc + fun:PyThread_create_key + fun:_PyGILState_Init + fun:Py_InitializeEx + fun:Py_Main +} + +{ + Hmmm, is this a real leak or like the GIL? + Memcheck:Leak + fun:malloc + fun:PyThread_ReInitTLS +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:realloc + fun:_PyObject_GC_Resize + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_New + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_NewVar + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +# +# Non-python specific leaks +# + +{ + Handle pthread issue (possibly leaked) + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls_storage + fun:_dl_allocate_tls +} + +{ + Handle pthread issue (possibly leaked) + Memcheck:Leak + fun:memalign + fun:_dl_allocate_tls_storage + fun:_dl_allocate_tls +} + +###{ +### ADDRESS_IN_RANGE/Invalid read of size 4 +### Memcheck:Addr4 +### fun:PyObject_Free +###} +### +###{ +### ADDRESS_IN_RANGE/Invalid read of size 4 +### Memcheck:Value4 +### fun:PyObject_Free +###} +### +###{ +### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 +### Memcheck:Addr8 +### fun:PyObject_Free +###} +### +###{ +### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 +### Memcheck:Value8 +### fun:PyObject_Free +###} +### +###{ +### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value +### Memcheck:Cond +### fun:PyObject_Free +###} + +###{ +### ADDRESS_IN_RANGE/Invalid read of size 4 +### Memcheck:Addr4 +### fun:PyObject_Realloc +###} +### +###{ +### ADDRESS_IN_RANGE/Invalid read of size 4 +### Memcheck:Value4 +### fun:PyObject_Realloc +###} +### +###{ +### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 +### Memcheck:Addr8 +### fun:PyObject_Realloc +###} +### +###{ +### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 +### Memcheck:Value8 +### fun:PyObject_Realloc +###} +### +###{ +### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value +### Memcheck:Cond +### fun:PyObject_Realloc +###} + +### +### All the suppressions below are for errors that occur within libraries +### that Python uses. The problems to not appear to be related to Python's +### use of the libraries. +### + +{ + Generic ubuntu ld problems + Memcheck:Addr8 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +{ + Generic gentoo ld problems + Memcheck:Cond + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so +} + +{ + DBM problems, see test_dbm + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_close +} + +{ + DBM problems, see test_dbm + Memcheck:Value8 + fun:memmove + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + DBM problems, see test_dbm + Memcheck:Cond + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + DBM problems, see test_dbm + Memcheck:Cond + fun:memmove + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + GDBM problems, see test_gdbm + Memcheck:Param + write(buf) + fun:write + fun:gdbm_open + +} + +{ + ZLIB problems, see test_gzip + Memcheck:Cond + obj:/lib/libz.so.1.2.3 + obj:/lib/libz.so.1.2.3 + fun:deflate +} + +{ + Avoid problems w/readline doing a putenv and leaking on exit + Memcheck:Leak + fun:malloc + fun:xmalloc + fun:sh_set_lines_and_columns + fun:_rl_get_screen_size + fun:_rl_init_terminal_io + obj:/lib/libreadline.so.4.3 + fun:rl_initialize +} + +### +### These occur from somewhere within the SSL, when running +### test_socket_sll. They are too general to leave on by default. +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:memset +###} +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:memset +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:MD5_Update +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:MD5_Update +###} + +# Fedora's package "openssl-1.0.1-0.1.beta2.fc17.x86_64" on x86_64 +# See http://bugs.python.org/issue14171 +{ + openssl 1.0.1 prng 1 + Memcheck:Cond + fun:bcmp + fun:fips_get_entropy + fun:FIPS_drbg_instantiate + fun:RAND_init_fips + fun:OPENSSL_init_library + fun:SSL_library_init + fun:init_hashlib +} + +{ + openssl 1.0.1 prng 2 + Memcheck:Cond + fun:fips_get_entropy + fun:FIPS_drbg_instantiate + fun:RAND_init_fips + fun:OPENSSL_init_library + fun:SSL_library_init + fun:init_hashlib +} + +{ + openssl 1.0.1 prng 3 + Memcheck:Value8 + fun:_x86_64_AES_encrypt_compact + fun:AES_encrypt +} + +# +# All of these problems come from using test_socket_ssl +# +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_bin2bn +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_num_bits_word +} + +{ + from test_socket_ssl Memcheck:Value4 - fun:PyObject_Free + fun:BN_num_bits_word } { - ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + from test_socket_ssl Memcheck:Cond - fun:PyObject_Free + fun:BN_mod_exp_mont_word } { - ADDRESS_IN_RANGE/Invalid read of size 4 - Memcheck:Addr4 - fun:PyObject_Realloc + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont } { - ADDRESS_IN_RANGE/Invalid read of size 4 + from test_socket_ssl + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libcrypto.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:RSA_verify +} + +{ + from test_socket_ssl Memcheck:Value4 - fun:PyObject_Realloc + fun:RSA_verify } { - ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + from test_socket_ssl + Memcheck:Value4 + fun:DES_set_key_unchecked +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_encrypt2 +} + +{ + from test_socket_ssl Memcheck:Cond - fun:PyObject_Realloc + obj:/usr/lib/libssl.so.0.9.7 } + +{ + from test_socket_ssl + Memcheck:Value4 + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BUF_MEM_grow_clean +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:memcpy + fun:ssl3_read_bytes +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:SHA1_Update +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:SHA1_Update +} + +{ + test_buffer_non_debug + Memcheck:Addr4 + fun:PyUnicodeUCS2_FSConverter +} + +{ + test_buffer_non_debug + Memcheck:Addr4 + fun:PyUnicode_FSConverter +} + +{ + wcscmp_false_positive + Memcheck:Addr8 + fun:wcscmp + fun:_PyOS_GetOpt + fun:Py_Main + fun:main +} + +# Additional suppressions for the unified decimal tests: +{ + test_decimal + Memcheck:Addr4 + fun:PyUnicodeUCS2_FSConverter +} + +{ + test_decimal2 + Memcheck:Addr4 + fun:PyUnicode_FSConverter +} + diff -Nru python3-defaults-3.6.3/Makefile python3-defaults-3.9.4/Makefile --- python3-defaults-3.6.3/Makefile 2013-08-03 07:34:39.000000000 +0000 +++ python3-defaults-3.9.4/Makefile 2020-03-22 11:05:33.000000000 +0000 @@ -29,8 +29,8 @@ manpages: $(MANPAGES) -pdebuild: - pdebuild --debbuildopts -I +sbuild: + sbuild --debbuildopts -I # TESTS tests: diff -Nru python3-defaults-3.6.3/policy/build-dependencies.rst python3-defaults-3.9.4/policy/build-dependencies.rst --- python3-defaults-3.6.3/policy/build-dependencies.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/build-dependencies.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,32 @@ +Build Dependencies +================== + +Build dependencies for Python-dependent packages must be declared for +every Python version that the package is built for. + +The ``python3-all-dev`` should be used when building extensions for any +or all Python 3 versions. +The ``python-all-dev`` should be used when building extensions for any +or all Python 2 versions. +To build for a specific version or versions, declare ``Build-Depends`` +on :samp:`python{X}.{Y}-dev`. + +Some applications and pure Python modules may be able to avoid +dependency on the ``-dev`` packages, and declare ``Build-Depends`` on +the runtime environment only +(``python3``, ``python3-all``, ``python2``, ``python2-all``). +A package that does not require the ``-dev`` packages must not declare +``Build-Depends`` on them. + +Declare ``Build-Depends`` on at least:: + + Build-Depends: python2.7 + Build-Depends: python2.6 (>= 2.6-1) + Build-Depends: python (>= 2.6.6-9) + Build-Depends: python-all + + Build-Depends: python2.7-dev + Build-Depends: python3.5-dev (>= 3.5.1-1) + Build-Depends: python-dev (>= 2.6.6-9) + Build-Depends: python-all-dev + Build-Depends: python3-all-dev (>= 3.2) diff -Nru python3-defaults-3.6.3/policy/conf.py python3-defaults-3.9.4/policy/conf.py --- python3-defaults-3.6.3/policy/conf.py 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/conf.py 2022-02-27 22:18:31.000000000 +0000 @@ -0,0 +1,59 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'Debian Python Policy' +copyright = '1999-2021, Software in the Public Interest' +author = 'Debian Python Policy Authors' + +# The full version, including alpha/beta/rc tags +release = '0.12.0.0' + +master_doc = 'index' + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +rst_prolog = """ +.. |copyright| replace:: {} +""".format(copyright) + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'nature' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] diff -Nru python3-defaults-3.6.3/policy/copyright.rst python3-defaults-3.9.4/policy/copyright.rst --- python3-defaults-3.6.3/policy/copyright.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/copyright.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,35 @@ +Copyright +========= + +|copyright| + +Authors: + * Neil Schemenauer + * Matthias Klose + * Gregor Hoffleit + * Josselin Mouette + * Joe Wreschnig + * Loïc Minier + * Scott Kitterman + * Barry Warsaw + * Ben Finney + * Neil Williams + * Stefano Rivera + +This manual is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +This is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. + +A copy of the GNU General Public License version 2 is available as +:file:`/usr/share/common-licences/GPL-2` in the Debian GNU/Linux system, +or on the World Wide Web at `GNU General Public License, version 2 +`_. + +You can also obtain it by writing to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. diff -Nru python3-defaults-3.6.3/policy/embedded-python.rst python3-defaults-3.9.4/policy/embedded-python.rst --- python3-defaults-3.6.3/policy/embedded-python.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/embedded-python.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,19 @@ +Programs Embedding Python +========================= + +Building Embedded Programs +-------------------------- + +Any package that installs a program which embeds a Python interpreter +must declare ``Build-Depends`` on :samp:`python{X}.{Y}-dev`, where +:samp:`{X}.{Y}` is the Python version the program builds against. +It should be the current default Python version unless the program does +not work correctly with this version. + +Embedded Python Dependencies +---------------------------- + +Dependencies for programs linking against the shared Python library will +be automatically created by ``dpkg-shlibdeps``. +The :samp:`libpython{X}.{Y}.so.{Z}` library the program is built against +is provided by the :samp:`python{X}.{Y}` package. diff -Nru python3-defaults-3.6.3/policy/index.rst python3-defaults-3.9.4/policy/index.rst --- python3-defaults-3.6.3/policy/index.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/index.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,39 @@ +Abstract +======== + +This document describes the packaging of Python within the Debian +GNU/Linux distribution and the policy requirements for packaged Python +programs and modules. + +Contents +======== + +.. toctree:: + :numbered: + :maxdepth: 3 + + copyright + python3 + interpreter + packaged-modules + python-programs + embedded-python + locally-installed-python + +.. toctree:: + :caption: Appendix + :name: Appendix + :numbered: + :maxdepth: 3 + + build-dependencies + packaging-tools + upgrade-procedure + this-document + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff -Nru python3-defaults-3.6.3/policy/interpreter.rst python3-defaults-3.9.4/policy/interpreter.rst --- python3-defaults-3.6.3/policy/interpreter.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/interpreter.rst 2021-03-02 06:27:23.000000000 +0000 @@ -0,0 +1,306 @@ +Python Packaging +================ + +Versions +-------- +At any given time, the binary package ``python3`` will represent the +current default Debian Python 3 version; the binary package ``python`` +will represent the current default Debian Python 2 version, for as long +as it exists. +As far as is reasonable, Python 3 and Python 2 should be treated as +separate runtime systems with minimal interdependencies. + +In some cases, Python policy explicitly references Python helper tools. +For Debian Stretch, the ``dh-python`` package provides the only such +tools; earlier helpers have been removed from Debian. + +It is a design goal to fully specify required interfaces and functions +in policy for Python 3 and to avoid enshrining specific implementation +details in policy. +Except as noted, policy for Python 2 is the same as Python 3 with the +exception of the different major version number as needed to distinguish +them. + +The default Debian Python version, for each of Python 3 and Python 2, +should always be the latest stable upstream version that can be fully +integrated in Debian. + +There may be newer supported or unsupported versions included in Debian +if they are not fully integrated for a particular release. + +Apart from the default version, legacy versions of Python or beta +releases of future upstream versions may be included as well in Debian, +as long as they are needed by other packages, or as long as it seems +reasonable to provide them. + +Note: For the scope of this document, a Python version is synonymous +with all micro versions within that minor version. +e.g. Python 3.5.0 and 3.5.1 are micro versions of the same Python +version 3.5, but Python 3.4 and 3.5 are indeed different versions. + +For any version, the main binary package must be called +:samp:`python{X}.{Y}`. + +The set of currently supported Python 3 versions can be found in +:file:`/usr/share/python3/debian_defaults`; the supported interface to +this information is through :file:`/usr/bin/py3versions`. +The set of currently supported Python 2 versions can be found in +:file:`/usr/share/python/debian_defaults`; the supported interface to +this information is :file:`/usr/bin/pyversions`. + +These files are in Python ``configparser`` format. +They define (in the ``DEFAULT`` section) the following options: + +``default-version`` + The name of the interpreter for the current default Debian Python. +``supported-versions`` + The set of interpreter names currently supported and for which + modules should be built and byte-compiled. + This includes ``default-version``. +``old-versions`` + The set of interpreter names which might still be on the system but + for which modules should not be built. +``unsupported-versions`` + The set of interpreter names which should not be supported at all, + that is modules should not be built or byte-compiled for these. + This includes (is a superset of) ``old-versions``. + +Newer versions might also appear in ``unsupported-versions`` before +being moved to ``supported-versions``. + +.. _main-packages: + +Main packages +------------- + +For every Python version provided in Debian, the binary package +:samp:`python{X}.{Y}` shall provide a complete distribution for +*deployment* of Python scripts and applications. +The package must ensure that the binary :file:`/usr/bin/python{X}.{Y}` +is provided. + +Installation of :samp:`python{X}.{Y}` shall provide the modules of the +upstream Python distribution with some exceptions. + +Excluded are modules that cannot be included for licensing reasons, for +dependency tracking purposes (for example the GPL-licensed ``gdbm`` +module), or that should not be included for packaging reasons (for +example the ``tk`` module which depends on Xorg and the ``venv`` module +which depends on wheels to bootstrap pip). +Modules that would interfere with system package management (for example +``ensurepip``, when used outside virtual environments) are modified to +print a message explaining the problem and recommending alternatives. + +Excluded are modules that cannot be included for licensing reasons (for +example the ``profile`` module), for dependency tracking purposes (for +example the GPL-licensed ``gdbm`` module), or that should not be +included for packaging reasons (for example the ``tk`` module which +depends on Xorg). + +Some tools and files for the *development* of Python modules are split +off in a separate binary package :samp:`python{X}.{Y}-dev`. + +Modules only used for *building* of Python modules (e.g. ``distutils`` +and ``lib2to3``) are split into separate packages. +The ``python3-venv`` binary package depends on these. + +Documentation will be provided separately as well. + +At any time, the ``python3`` binary package must ensure that +:file:`/usr/bin/python3` is provided, as a symlink to the current +:samp:`python3.{Y}` executable. +The package must depend on the :samp:`python3.{Y}` package that installs +the executable. + +A ``python3-full`` binary package must ensure that the entire Python +standard library is available, including all modules split into separate +packages (but excluding modules excluded from Debian for licensing +reasons). +This package exists for the convenience of python developers, and must +not be used in dependencies, recommendations and build dependencies by +python module or application packages. + +The version of the ``python3`` package must be greater than or equal to +:samp:`3.{Y}` and lower than :samp:`3.{Y+1}`. + +The ``python`` and ``python-dbg`` binary packages are to be removed for +Bullseye. +If any Python 2 packages remain in Bullseye, these must depend on +``python2`` or ``python2-dbg``. +The ``python2`` package must depend on the :samp:`python2.{Y}` package +that installs the executable :file:`/usr/bin/python2`. +The version of the ``python2`` package must be greater than or equal to +:samp:`2.{Y}` and lower than :samp:`2.{Y+1}`. +The ``python2`` must not provide :file:`/usr/bin/python`. + +For as long as it remains supported, the ``python`` binary package must +ensure that :file:`/usr/bin/python2` is provided, as a symlink to the +current :samp:`python2.{Y}` executable. +The package must depend on the :samp:`python2.{Y}` package that installs +the executable. + +The ``python`` binary package must also ensure that +:file:`/usr/bin/python` is provided, as a symlink to the current +:samp:`python2.{Y}` executable. +See :pep:`394` for details. + +The version of the ``python`` package must be greater than or equal to +:samp:`2.{Y}` and lower than :samp:`2.{Y+1}`. + +Minimal packages +---------------- + +For every Python version provided in Debian, the binary package +:samp:`python{X}.{Y}-minimal` might exist and should not be depended +upon by other packages except the Python runtime packages themselves. + +Python Interpreter +------------------ + +.. _interpreter-name: + +Interpreter Name +^^^^^^^^^^^^^^^^ + +The different Python major versions require different interpreters +(see :ref:`main-packages`). + +Python scripts that require the default Python 3 version should specify +``python3`` as the interpreter name. + +Python scripts that require the default Python 2 version should specify +``python2`` as the interpreter name for as long as this remains supported. + +Python scripts should not specify ``python`` as the interpreter name +even if they do not require any particular version of Python as the +script would stop working upon removal of the Python 2 stack. + +Python scripts that only work with a specific Python minor version must +explicitly use the versioned interpreter name (:samp:`python{X}.{Y}`). + +.. _interpreter-location: + +Interpreter Location +^^^^^^^^^^^^^^^^^^^^ + +Python scripts should specify the Debian Python interpreter, to ensure +that the Debian Python installation is used and all dependencies on +additional Python modules are met. + +The preferred specification for the Python 3 interpreter is +:file:`/usr/bin/python3` (or :file:`/usr/bin/python3.{Y}` if it requires +Python :samp:`3.{Y}`). + +The preferred specification for the Python 2 interpreter is +:file:`/usr/bin/python2` (or :file:`/usr/bin/python2.{Y}` if it requires +Python :samp:`2.{Y}`). + +Scripts requiring the default Python 2 version must not specify the +interpreter :file:`/usr/bin/python` as such scripts will fail when the +unversioned interpreter binary :file:`/usr/bin/python` is removed. + +Maintainers should not override the Debian Python interpreter using +:samp:`/usr/bin/env {name}`. +This is not advisable as it bypasses Debian's dependency checking and +makes the package vulnerable to incomplete local installations of +Python. + +.. _module-path: + +Module Path +----------- + +By default, Python modules are searched in the directories listed in the +:envvar:`PYTHONPATH` environment variable and in the ``sys.path`` Python +variable. +For all supported Debian releases, ``sys.path`` does not include a +:file:`/usr/lib/python{X}{Y}.zip` entry. + +Directories with private Python modules must be absent from the ``sys.path``. + +Public Python 3 modules must be installed in the system Python 3 modules +directory, :file:`/usr/lib/python3/dist-packages`. + +Public Python 2 modules must be installed in the system Python 2 modules +directory :file:`/usr/lib/python2.{Y}/dist-packages`, where +:samp:`2.{Y}` is the Python 2 version. + +A special directory is dedicated to public Python modules installed by +the local administrator, :file:`/usr/local/lib/python3/dist-packages` +for all Python 3 versions, +:file:`/usr/local/lib/python2.{Y}/dist-packages` for Python 2. + +For local installation of Python modules by the system administrator, +special directories are reserved. +The directory :file:`/usr/local/lib/python3/site-packages` is in the +Python 3 runtime module search path. +The directory :file:`/usr/local/lib/python2.{Y}/site-packages` is in the +Python :samp:`2.{Y}` runtime module search path. + +Additional information on appending site-specific paths to the module +search path is available in the official documentation of the ``site`` +module. + +Python modules which work with multiple supported Python 2 versions must +install to version-specific locations, for instance +:file:`/usr/lib/python2.6/dist-packages/foo.py` and +:file:`/usr/lib/python2.7/dist-packages/foo.py`. +These should point to a common file. + +Architecture-independent public Python 3 modules must be installed to +:file:`/usr/lib/python3/dist-packages`. + +Architecture-independent public Python 2 modules should be installed to +:file:`/usr/lib/python2.7/dist-packages`. +The historical location for this was :file:`/usr/share/pyshared`. +Since Python 2.7 is the last Python 2 version and the only supported +version in Wheezy and later releases, a version-specific location is +sufficient. + +Hooks for updates to installed runtimes +--------------------------------------- + +The ``python3`` binary package has special hooks to allow other packages +to act upon updates to the installed runtimes. + +This mechanism is required to handle changes of the default Python +runtime in some packages and to enable the Python packaging helpers. + +There are three supported hook types which come in the form of scripts +which are invoked from the maintainer scripts of the Python runtime +packages when specific installations, removals, or upgrades occur. + +#. :file:`/usr/share/python3/runtime.d/{*}.rtinstall`: + These are called when a runtime is installed or becomes supported. + The first argument is ``rtinstall``, the second argument is the + affected runtime (for example :samp:`python{X}.{Y}`) and the third + and fourth argument are the old and new version of this packaged + runtime if this runtime was already installed but unsupported. + +#. :file:`/usr/share/python3/runtime.d/{*}.rtremove`: + These are called when a runtime is removed or stops being supported. + The first argument is ``rtremove``, and the second argument is the + affected runtime (for example :samp:`python{X}.{Y}`). + +#. :file:`/usr/share/python3/runtime.d/{*}.rtupdate`: + These are called when the default runtime changes. + The first argument is either ``pre-rtupdate``, called before changing + the default runtime, or ``rtupdate``, called when changing the + default runtime, or ``post-rtupdate``, called immediately afterwards. + The second argument is the old default runtime (for example + :samp:`python{X}.{Y}`), and the third argument is the new default + runtime (for example :samp:`python{X}.{Z}`). + +Documentation +------------- + +Python documentation is split out in separate binary packages +:samp:`python{X}.{Y}-doc`. + +The binary package ``python3-doc`` will always provide the documentation +for the default Debian Python 3 version. +The binary package ``python2-doc`` will always provide the documentation +for the default Debian Python 2 version, for as long as that remains +supported. + +TODO: Policy for documentation of third party packages. diff -Nru python3-defaults-3.6.3/policy/locally-installed-python.rst python3-defaults-3.9.4/policy/locally-installed-python.rst --- python3-defaults-3.6.3/policy/locally-installed-python.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/locally-installed-python.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,9 @@ +Interaction with Locally Installed Python Versions +================================================== + +As long as you don't install other versions of Python in your path, +Debian's Python versions won't be affected by a new version. + +If you install a different micro version of the version of Python you +have got installed, you will need to be careful to install all the +modules you use for that version of Python too. diff -Nru python3-defaults-3.6.3/policy/make.bat python3-defaults-3.9.4/policy/make.bat --- python3-defaults-3.6.3/policy/make.bat 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/make.bat 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff -Nru python3-defaults-3.6.3/policy/Makefile python3-defaults-3.9.4/policy/Makefile --- python3-defaults-3.6.3/policy/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/Makefile 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff -Nru python3-defaults-3.6.3/policy/packaged-modules.rst python3-defaults-3.9.4/policy/packaged-modules.rst --- python3-defaults-3.6.3/policy/packaged-modules.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/packaged-modules.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,266 @@ +Packaged Modules +================ + +The goal of these policies is to reduce the work necessary for Python +transitions. +Python modules are internally very dependent on a specific Python +version. +However, we want to automate recompiling modules when possible, either +during the upgrade itself (re-compiling bytecode files :file:`{*}.pyc` +and :file:`{*}.pyo`) or shortly thereafter with automated rebuilds (to +handle C extensions). +These policies encourage automated dependency generation and loose +version bounds whenever possible. + +Types of Python Modules +----------------------- + +There are two kinds of Python modules, "pure" Python modules, and +extension modules. +Pure Python modules are Python source code that generally works across +many versions of Python. +Extensions are C code compiled and linked against a specific version of +the Python runtime, and so can only be used by one version of Python. + +Debian Python does not link extensions to ``libpython`` (as is done in +some operating systems). +Symbols are resolved by :file:`/usr/bin/python{X}.{Y}` which is not +linked to ``libpython``. + +Python packages are a way of structuring Python’s module namespace by +using "dotted module names". +See `Python's glossary +`_ for details on +how packages are defined in Python terms (a package in the Python sense +is unrelated to a Debian package). +Python packages must be packaged into the same directory (as done by +upstream). +Splitting components of a package across directories changes the import +order and may confuse documentation tools and IDEs. + +There are two ways to distribute Python modules. +Public modules are installed in a public directory as listed in +:ref:`module-path`. +They are accessible to any program. +Private modules are installed in a private directory such as +:file:`/usr/share/{package-name}` or :file:`/usr/lib/{package-name}`. +They are generally only accessible to a specific program or suite of +programs included in the same package. + +Wheels +------ + +:pep:`427` defines a built-package format called "wheels", which is a +Zip format archive containing Python code and a :file:`{*}.dist-info` +metadata directory, in a single file named with the ``.whl`` suffix. +As Zip files, wheels containing pure Python can be put on ``sys.path`` +and modules in the wheel can be imported directly by Python's ``import`` +statement. +(Importing extension modules from wheels is not yet supported as of +Python 3.4.) + +Except as described below, packages must not build or provide wheels. +They are redundant to the established way of providing Python libraries +to Debian users, take no advantage of distro-based tools, and are less +convenient to use. +E.g. they must be explicitly added to ``sys.path``, cannot be easily +grepped, and stack traces through Zip files are more difficult to debug. + +A very limited set of wheel packages are available in the archive, but +these support the narrow purpose of enabling the ``pip``, +``virtualenv``, and ``pyvenv`` tools in a Debian policy compliant way. +These packages build their own dependent wheels through the use of the +``dirtbike`` "rewheeling" tool, which takes installed Debian packages +and turns them back into wheels. +Only universal wheels (i.e. pure-Python, Python 3 and 2 compatible +packages) are supported, with the exception of wheels of packages that +no longer support Python 2. +Wheels built for these packages are not required to be universal. +Since only the programs that require wheels need build them, only they +may provide ``-whl`` packages, e.g. ``python3-pip-whl``. + +When these binary packages are installed, :file:`{*}.whl` files must be +placed in the :file:`/usr/share/python-wheels` directory. +The location inside a virtual environment will be rooted in the virtual +environment, instead of :file:`/usr`. + +.. _module-package-names: + +Module Package Names +-------------------- + +Public Python modules must be packaged separately by major Python +version, to preserve run time separation between Python 2 and Python 3. + +Public Python 3 modules used by other packages must have their binary +package name prefixed with ``python3-``. +It is recommended to use this prefix for all packages with public +modules as they may be used by other packages in the future. + +The binary package for module :samp:`{foo}` should preferably be named +:samp:`python3-{foo}`, if the module name allows. +This is not required if the binary package installs multiple modules, in +which case the maintainer shall choose the name of the module which best +represents the package. + +For the purposes of package naming, the name that is used for a module +is the name that can be used with ``import``, which is not necessarily +the same as the name used in setuptools ``PKG-INFO`` and ``.egg-info`` +files and directories. +For example, the module described in :samp:`pyxdg-{*}.egg-info` is used +via ``import xdg``, so its package name is ``python3-xdg`` and not +``python3-pyxdg``. + +Some modules have names that contain underscores or capital letters, +which are not allowed in Debian package names. +The recommendation is to replace underscores with hyphen/minus and +capital letters with lower-case. +For example, the modules that can be used with ``import distro_info`` +and ``import Xlib`` are packaged as ``python3-distro-info`` and +``python3-xlib`` respectively. + +For subpackages such as :samp:`{foo.bar}`, the recommendation is to name +the binary package :samp:`python3-{foo.bar}`. + +Such a package should support the current Debian Python version, +and more if possible (there are several tools to help implement +this, see :ref:`packaging-tools`). +For example, if Python 3.3, 3.4, and 3.5 are supported, the Python +statement + +.. code-block:: python + + import foo + +should import the module when the program interpreter is any of +:file:`/usr/bin/python3.3`, :file:`/usr/bin/python3.4`, and +:file:`/usr/bin/python3.5`. +This requirement also applies to extension modules; binaries for all the +supported Python versions should be included in a single package. + +Packages intended for use with Django (``python3-django``) are installed +in the same namespace as other python packages for a variety of reasons. +Many such packages are named :samp:`django_{name}` upstream. +These are then packaged as :samp:`python3-django-{name}`. +This makes it clear that they are intended for use with Django and not +general purpose Python modules. +Debian maintainers are encouraged to work with their upstreams to +support consistent use of this approach. + +If the documentation for a module :samp:`{foo}` provided in +:samp:`python3-{foo}` is large enough that a separate binary package for +documentation is desired, then the documentation package should +preferably be named :samp:`python-{foo}-doc` (and in particular, not +:samp:`python3-{foo}-doc`). + +Specifying Supported Versions +----------------------------- + +The :file:`debian/control` source paragraph may contain optional fields +to specify the versions of Python the package supports. + +The optional ``X-Python3-Version`` field specifies the versions of +Python 3 supported. +When not specified, it defaults to all currently supported Python 3 +versions. + +Similarly, the optional fields ``X-Python-Version`` or +``XS-Python-Version`` were used to specify the versions of Python 2 +supported by the source package. +They are obsolete and must be removed. + +These fields are used by some packaging scripts to automatically +generate appropriate Depends and Provides lines. +The format of the field may be one of the following:: + + X-Python3-Version: >= X.Y + X-Python3-Version: >= A.B, << X.Y + XS-Python-Version: A.B, X.Y + +The keyword ``all`` is no longer to be used since using version numbers +is clearer than ``all`` and encodes more information. +The keyword ``all`` must be ignored for Python 3 versions. + +A comma-separated list of multiple individual versions (e.g. ``3.3, 3.4, +3.5``) in ``XS-Python-Version`` will continue to be supported, but +is not recommended. + +The use of multiple individual versions in ``X-Python-Version`` or +``X-Python3-Version`` is not supported for Wheezy and later releases. + +The keyword ``current`` has been deprecated and must not be used. +It must be ignored for Python 3 versions. + +The use of ``XB-Python-Version`` in the binary package paragraphs of +:file:`debian/control` file has been deprecated and should be removed in +the normal course of package updates. +It never achieved sufficient deployment to support its intended purpose +of managing Python transitions. +This purpose can be adequately accomplished by examining package +dependencies. + +Dependencies +------------ + +Any package that installs modules for the default Python version (or +many versions including the default) as described in +:ref:`module-package-names`, must declare a dependency on the default +Python runtime package. +If it requires other modules to work, the package must declare +dependencies on the corresponding packaged modules. +The package must not declare dependency on any version-specific Python +runtime or module package. + +For Python 3, the correct dependencies are :samp:`Depends: +python3 (>= 3.{Y})` and any corresponding :samp:`python3-{foo}` +packages. + +If any Python 2 packages remain, the correct dependencies are +:samp:`Depends: python2 (>= 2.{Y})` and any corresponding +:samp:`python2-{foo}` packages. + +Any package that installs Python modules or Python 3 binary extensions +must also declare a maximum version it supports as currently built. +This is accomplished by declaring a maximum version constraint strictly +less than one higher than the current maximum version, i.e. +:samp:`Depends: python3 (<< {X}.{Y})`. + +Provides +-------- + +Binary packages that declare Provides dependencies of the form +:samp:`python{X}.{Y}-foo` were never supported for Python 3. +They should be removed in the normal course of package updates. +Future provision of values for the substitution variable +``python:Provides`` is not guaranteed. + +.. _module-byte-compilation: + +Modules Byte-Compilation +------------------------ + +If a binary package provides any binary-independent modules +(:file:`{foo}.py` files), the corresponding byte-compiled modules +(:file:`{foo}.pyc` files) and optimized modules (:file:`{foo}.pyo` +files) must not ship in the package. +Instead, they should be generated in the package's post-install script, +and removed in the package's pre-remove script. +The package's :file:`prerm` has to make sure that both :file:`{foo}.pyc` +and :file:`{foo}.pyo` are removed. + +A binary package should only byte-compile the files which belong to the +package. + +The file :file:`/etc/python/debian_config` allows configuration how +modules should be byte-compiled. +The post-install scripts should respect these settings. + +Pure Python modules in private installation directories that are +byte-compiled with the default Python version must be forcefully +byte-compiled again when the default Python version changes. + +Public Python extensions should be bin-NMUed. + +Private Python extensions should be subject to binary NMUs every time +the default interpreter changes, unless the extension is updated through +a :file:`{*}.rtupdate` script. diff -Nru python3-defaults-3.6.3/policy/packaging-tools.rst python3-defaults-3.9.4/policy/packaging-tools.rst --- python3-defaults-3.6.3/policy/packaging-tools.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/packaging-tools.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,83 @@ +.. _packaging-tools: + +Packaging Tools +=============== + +This section describes the various tools to help package Python programs +and modules for Debian. +Although none of these tools are mandatory, their use is strongly +encouraged, as the above policy has been designed with them in mind (and +vice versa). +This appendix is just an overview. +If you use these tools, you should read their full documentation. + +distutils +--------- + +The standard Python ``distutils`` module has been modified in Debian to +change the default installation directory of public Python modules and +to add a new flag to the ``install`` command to override the default, +``--install-layout=``. + +Public Python modules installed with a modified distutils default to +:file:`/usr/local/lib/python{X}.{Y}/dist-packages` for Python 2.6 and +later. +This directory is seen by the system-provided Python 2.6. + +When using a local Python installation, the default is +:file:`/usr/local/lib/python{X}.{Y}/site-packages` which is only seen by +the local Python installation. + +Using the ``--install-layout=deb`` flag to the ``install`` command of +:file:`setup.py` with a system-provided Python 2.6 or later versions, +Python modules will be installed to +:file:`/usr/lib/python{X}.{Y}/dist-packages` which is only seen by the +system-provided Python, not by a local installation. + +setuptools +---------- + +The related Python ``setuptools`` module has been modified in Debian +along the same lines as ``distutils``. + +Upstream focus on developments and improvements for Python packaging +tools has largely shifted away from ``distutils`` and to ``setuptools``. +They offer a similar API and at some point in the future, ``setuptools`` +may fully replace ``distutils`` in Debian package builds. + +dh-python +--------- + +``dh-python`` provides extensions for ``debhelper`` to make it easier to +package Python modules and extensions. +They calculate Python dependencies, add maintainer scripts to byte +compile files, etc. +Their use is not mandatory, but they are recommended by the Debian +Python maintainers. +See `man dh_python3 `_ for +details. + +pybuild +------- + +Pybuild is a Debian Python specific build system that invokes various +build systems for requested Python versions in order to build modules +and extensions. +It supports automatically building for multiple Python versions. + +CDBS +---- + +The CDBS :file:`python-distutils.mk` class helps packaging of distutils +based Python packages. + +python-support (removed) +------------------------ + +``python-support`` provided another way to manage Python modules. +It has been removed from Debian Stretch and later releases. + +python-central (removed) +------------------------ +``python-central`` provided another way to manage Python modules. +It has been removed from Debian Jessie and later releases. diff -Nru python3-defaults-3.6.3/policy/python3.rst python3-defaults-3.9.4/policy/python3.rst --- python3-defaults-3.6.3/policy/python3.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/python3.rst 2021-03-02 08:04:48.000000000 +0000 @@ -0,0 +1,69 @@ +Completing the move to Python 3 +=============================== + +Debian has previously supported two Python stacks, one for Python 3 and +one for Python 2. +The goal for Debian is to reduce this to one stack, dropping the Python +2 stack and interpreter for the Bullseye release. + +:pep:`404` states that no more major Python 2 releases are planned, +although the latest released minor version 2.7 will see some extended +support, documented in :pep:`466`. + +Packages in Debian should use Python 3. +New packages must use Python 3 from the initial upload, new upstream +versions for existing packages must use Python 3. +If Python 2 is still supported in Bullseye, selected packages may +continue using Python 2 until Python 3 support is available for those +packages. +Please discuss all use of Python 2 on the debian-python mailing list +before uploading. + +#. Applications should use Python 3 and must not be packaged for Python + 2 as well. + If an application supports only Python 2, the application may need + to be removed from Debian so that it does not block removal of other + Python 2 packages. + +#. Python libraries need to support Python 3 and new versions must be + packaged for Python 3. + Existing Python 2 libraries must not be dropped before the last + reverse dependency is removed. + New Python 2 libraries must not be introduced. + +#. Python 3 should be used for the packaging if the packaging scripts + use Python. + +Removal of the unversioned packages +----------------------------------- + +Starting with the Debian 11 release (bullseye), the binary packages +``python``, ``python-minimal``, ``python-dev``, ``python-dbg`` and +``python-doc`` are removed. No package in the archive must use any of +these packages as build dependencies, dependencies, recommendations or +suggestions. + + +Unversioned python commands +--------------------------- + +For the Debian 11 release (bullseye), the :file:`/usr/bin/python` +command is provided in the ``python-is-python2`` package (pointing to +:file:`/usr/bin/python2`). The :file:`/usr/bin/python-config` and +:file:`/usr/bin/pydoc` commands are provided in the +``python-dev-is-python2`` package. These package are not installed by +default for new installations, but only for upgrades from the Debian +10 release (buster). These packages should be removed after an +upgrade. These packages will not be part of the Debian 12 release +(bookworm). + +The packages ``python-is-python3`` and ``python-dev-is-python3`` +provide the :file:`/usr/bin/python`, :file:`/usr/bin/python-config` +and :file:`/usr/bin/pydoc` commands pointing to Python3. These +packages can be installed by developers and users to use the +unversioned commands. NOTE: Locally installed software not yet ported +to Python3 is likely to break when installing these packages. + +The packages ``python-is-python3``, ``python-dev-is-python3``, +``python-is-python2`` and ``python-dev-is-python2`` must not be used +as build dependencies, dependencies, recommendations or suggestions. diff -Nru python3-defaults-3.6.3/policy/python-programs.rst python3-defaults-3.9.4/policy/python-programs.rst --- python3-defaults-3.6.3/policy/python-programs.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/python-programs.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,66 @@ +Python Programs +=============== + +Interpreter directive ("Shebang") +--------------------------------- + +Executables written for interpretation by Python must use an appropriate +interpreter directive, or "shebang", as the first line of the program. +This line should be of the form :samp:`#!{interpreter_location}`. +See :ref:`interpreter-name` for the interpreter name to use. + +As noted in :ref:`interpreter-location`, the form :samp:`#!/usr/bin/env +{interpreter_name}` is deprecated. + +Programs using the default Python +--------------------------------- + +A package that installs a program that can be run by any version of +Python 3 must declare a dependency on ``python3``, with a versioned +dependency if necessary. + +A package that installs a program that can be run by any version of +Python 2 must declare a dependency on ``python2``, with a versioned +dependency if necessary. + +If the program needs the public Python module ``foo``, the package must +depend on the binary package that installs the ``foo`` module. +See :ref:`module-package-names` for the naming of packages that install +public Python modules. + +Programs Shipping Private Modules +--------------------------------- + +A program that specifies ``python3`` as its interpreter may require its +own private Python modules. +These modules should be installed in :file:`/usr/share/{module}`, or +:file:`/usr/lib/{module}` if the modules are architecture-dependent +(e.g. extensions). + +The rules explained in :ref:`module-byte-compilation` apply to those +private modules: the byte-compiled modules must not be shipped with the +binary package, they should be generated in the package's post-install +script using the current default Python version, and removed in the +pre-remove script. +Modules should be byte-compiled using the current default Python +version. + +Programs that have private compiled extensions must either handle +multiple version support themselves, or declare a tight dependency on +the current Python version (e.g. ``Depends: python3 (>= 3.5), +python3 (<< 3.6)``. + +Programs Using a Particular Python Version +------------------------------------------ + +A program which requires a specific minor version of Python must specify +the versioned interpreter :samp:`python{X}.{Y}`. +The package that installs the programs must also specify a dependency on +:samp:`python{X}.{Y}` and on any packages that install necessary +modules. + +The notes on installation directories and byte-compilation for programs +that support any version of Python also apply to programs supporting +only a single Python version. +Modules to be byte-compiled should use the same Python version as the +package itself. diff -Nru python3-defaults-3.6.3/policy/this-document.rst python3-defaults-3.9.4/policy/this-document.rst --- python3-defaults-3.6.3/policy/this-document.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/this-document.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,9 @@ +This document +============= + +Source of this document is :file:`policy/` in git repository +`python3-defaults +`_. + +Propose changes to this policy on the `debian-python mailing list +`_ for review. diff -Nru python3-defaults-3.6.3/policy/upgrade-procedure.rst python3-defaults-3.9.4/policy/upgrade-procedure.rst --- python3-defaults-3.6.3/policy/upgrade-procedure.rst 1970-01-01 00:00:00.000000000 +0000 +++ python3-defaults-3.9.4/policy/upgrade-procedure.rst 2021-03-02 06:15:24.000000000 +0000 @@ -0,0 +1,57 @@ +Upgrade Procedure +================= + +This section describes the procedure for the upgrade when the +default Python version is changed in the Debian ``unstable`` release, +requiring recompilation of many Python-related packages. + +#. Selected pre-releases and release candidates of new Python versions + are uploaded to Debian ``experimental`` to support pre-transition + work and testing. + +#. Application and module maintainers make sourceful changes where + needed to prepare for the new Python version when needed. + +#. Have a long and heated discussion. + +#. The Debian Python maintainer and module/application maintainers + discuss the readiness for a new default Debian Python version and + associated packaging/policy changes. + Once there is some consensus, the Python maintainer announces the + upgrade and uploads to ``unstable``. + +#. Upload of the Python core meta-packages ``python3``, + ``python3-dev``, ``python3-doc`` and several + :samp:`python3-{module}`, depending on the new :samp:`python3.{Y}`, + :samp:`python3.{Y}-dev` and so on. + +#. The Debian release team schedules rebuilds for packages that may + need it. + Packages that require additional manual work get updated and + uploaded. + +The necessary package builds are typically done in three phases in order +to keep transitions as smooth as possible. +For Python 3, there is no general need to update architecture all +packages for a new Python 3 version. Only architecture any packages need +to be rebuilt. + +#. The new Python 3 version is added to supported versions and packages + that support multiple Python 3 versions are binNMUed. + They now support both the new and older Python 3 versions. + This requires transition assistance from the release team in the form + of a transition tracker and binNMU scheduling, but is not a + transition that can cause entanglements with other transitions in + Debian. + +#. Once the default Python 3 version is changed, binNMUs are done for + packages that only support one Python 3 version. + Some transient uninstallability is unavoidable. + This is a transition that can entangle other transitions in Debian + and requires more careful coordination with the release team. + +#. After the old Python 3 version is dropped from supported versions + then packages with multi-version support are binNMUed again to remove + support for the old Python 3 version. + This is not a true transition and only needs a tracker and binNMU + scheduling. diff -Nru python3-defaults-3.6.3/py3compile python3-defaults-3.9.4/py3compile --- python3-defaults-3.6.3/py3compile 2013-08-03 07:34:39.000000000 +0000 +++ python3-defaults-3.9.4/py3compile 2020-12-06 10:38:35.000000000 +0000 @@ -63,23 +63,45 @@ result = [] for fn in listdir(name): + if fn.startswith('.'): + continue with open(join(name, fn), 'r', encoding='utf-8') as lines: for line in lines: - type_, vrange, dname, pattern = line.split('|', 3) + if line.startswith('#'): + continue + line = line.rstrip('\n') + + try: + type_, vrange, dname, pattern = line.split('|', 3) + except ValueError: + pattern = '.*' + type_, vrange, dname = line.split('|', 2) + if type_ != 'file': + dname = dname.rstrip('/') + '/' # make sure it ends with slash vrange = parse_vrange(vrange) + versions = get_requested_versions(vrange, available=True) if not versions: # pattern doesn't match installed Python versions continue - pattern = pattern.rstrip('\n') - if type_ == 're': - pattern = compile_regexpr(None, None, pattern) + + if type_ == 're' or pattern: + try: + pattern = compile_regexpr(None, None, pattern) + except Exception: + log.warning('skipping invalid pattern in file %s, line: %s', fn, line) + continue + result.append((type_, versions, dname, pattern)) return result def get_exclude_patterns(directory='/', patterns=None, versions=None): """Return patterns for files that shouldn't be compiled in given dir.""" + + # make sure directory name ends with a slash + directory = directory.rstrip('/') + '/' + if versions is not None: # make sure it's a set (debsorted returns a list) versions = set(versions) @@ -103,24 +125,31 @@ def filter_files(files, e_patterns, compile_versions): """Generate (file, versions_to_compile) pairs.""" - for fn in files: + for fpath in files: valid_versions = set(compile_versions) # all by default for type_, vers, dname, pattern in e_patterns: - if type_ == 'dir' and fn.startswith(dname): + if not fpath.startswith(dname): + continue + rfpath = fpath[len(dname):] # relative to dname + + if type_ == 'dir': # fpath.startswith(dname) - see above + valid_versions = valid_versions - vers + elif type_ == 'file' and fpath == dname: valid_versions = valid_versions - vers - elif type_ == 're' and pattern.match(fn): + elif type_ == 're' and (pattern.match(fpath) or pattern.match(rfpath)): + # NOTE: directory is checked at the beginning of this loop valid_versions = valid_versions - vers # move to the next file if all versions were removed if not valid_versions: break if valid_versions: - public_dir = PUBLIC_DIR_RE.match(fn) + public_dir = PUBLIC_DIR_RE.match(fpath) if public_dir and len(public_dir.group(1)) != 1: - yield fn, set([getver(public_dir.group(1))]) + yield fpath, set([getver(public_dir.group(1))]) else: - yield fn, valid_versions + yield fpath, valid_versions ### COMPILE #################################################### @@ -129,7 +158,7 @@ version = vrepr(version) cmd = "/usr/bin/python%s%s -m py_compile -" \ % (version, ' -O' if optimize else '') - process = Popen(cmd, bufsize=1, shell=True, + process = Popen(cmd, bufsize=0, shell=True, stdin=PIPE, close_fds=True) workers[version] = process # keep the reference for .communicate() stdin = process.stdin @@ -253,7 +282,7 @@ e_patterns = get_exclude_patterns(item, options.regexpr, compile_versions) if not exists(item): - log.warn('No such file or directory: %s', item) + log.warning('No such file or directory: %s', item) else: log.debug('byte compiling %s using Python %s', item, compile_versions)