diff -Nru dh-python-6.20231223ubuntu2/README.rst dh-python-6.20240401/README.rst --- dh-python-6.20231223ubuntu2/README.rst 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/README.rst 2024-04-01 17:23:32.000000000 +0000 @@ -24,7 +24,6 @@ * ``dh_python3`` works on ``./debian/python3-foo/`` files and other binary packages that have ``${python3:Depends}`` in the ``Depends`` field. - It ignores Python 2.X and PyPy2 specific directories. See ``dh_python3`` manpage for more details. How it works diff -Nru dh-python-6.20231223ubuntu2/autoscripts/postinst-pypycompile dh-python-6.20240401/autoscripts/postinst-pypycompile --- dh-python-6.20231223ubuntu2/autoscripts/postinst-pypycompile 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/autoscripts/postinst-pypycompile 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -if command -v pypycompile >/dev/null 2>&1; then - pypycompile -p #PACKAGE# #ARGS# -elif pypy -m py_compile >/dev/null 2>&1; then - dpkg -L #PACKAGE# | grep '\.py$' | pypy -m py_compile - >/dev/null -fi diff -Nru dh-python-6.20231223ubuntu2/autoscripts/prerm-pypyclean dh-python-6.20240401/autoscripts/prerm-pypyclean --- dh-python-6.20231223ubuntu2/autoscripts/prerm-pypyclean 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/autoscripts/prerm-pypyclean 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -if command -v pypyclean >/dev/null 2>&1; then - pypyclean -p #PACKAGE# #ARGS# -else - dpkg -L #PACKAGE# | sed -En -e '/^(.*)\/(.+)\.py$/s,,rm "\1/__pycache__/\2".*,e' - find /usr/lib/pypy/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir -fi diff -Nru dh-python-6.20231223ubuntu2/debian/changelog dh-python-6.20240401/debian/changelog --- dh-python-6.20231223ubuntu2/debian/changelog 2024-03-03 21:39:32.000000000 +0000 +++ dh-python-6.20240401/debian/changelog 2024-04-01 17:23:32.000000000 +0000 @@ -1,16 +1,37 @@ -dh-python (6.20231223ubuntu2) noble; urgency=medium +dh-python (6.20240401) unstable; urgency=medium - * Drop the dependency on python3-distutils, - soon to disappear from python3-stdlib-extensions + [ Stefano Rivera ] + * Remove python3-distutils from dh-python Depends. It doesn't exist as a + package for 3.12, and is provided as a compatibility shim by setuptools. + (Closes: #1066833) + * Add support for testing with stestr. Thanks James Page for the patch. + (Closes: #883004) + + [ Julian Gilbey ] + * Add python3-flit-scm to list of build-dependencies requiring + SETUPTOOLS_SCM_PRETEND_VERSION (Closes: #1067822) + + -- Stefano Rivera Mon, 01 Apr 2024 13:23:32 -0400 + +dh-python (6.20240310) unstable; urgency=medium + + [ Jérémy Lal ] + * Fix pydist path in dh_python3 doc - -- Graham Inggs Sun, 03 Mar 2024 21:39:32 +0000 + [ Louis-Philippe Véronneau ] + * automatically set env var for python3-poetry-dynamic-versioning -dh-python (6.20231223ubuntu1) noble; urgency=medium + [ Niels Thykier ] + * Remove trivially removable code related to cpython << 3.11. This includes + some cpython2 code. [ Stefano Rivera ] - * Remove hard-coded 3.11 from tests, see #1064963 + * Remove hard-coded 3.11 from tests. (Closes: #1064963) + * Remove flit plugin, replaced by pyproject. (Closes: #1061309) + * Drop support for PyPy (2.7), long removed from the archive. + * Improve test cleaning. - -- Graham Inggs Wed, 28 Feb 2024 20:51:04 +0000 + -- Stefano Rivera Sun, 10 Mar 2024 11:41:23 -0400 dh-python (6.20231223) unstable; urgency=medium diff -Nru dh-python-6.20231223ubuntu2/debian/control dh-python-6.20240401/debian/control --- dh-python-6.20231223ubuntu2/debian/control 2024-03-03 17:19:49.000000000 +0000 +++ dh-python-6.20240401/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -1,8 +1,7 @@ Source: dh-python Section: python Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Piotr Ożarowski +Maintainer: Piotr Ożarowski Uploaders: Stefano Rivera , Build-Depends: @@ -25,6 +24,7 @@ Architecture: all Multi-Arch: foreign Depends: +# depend on setuptools to help packages migrate from distutils. Remove once 3.12 is default python3-setuptools, ${misc:Depends}, ${python3:Depends}, diff -Nru dh-python-6.20231223ubuntu2/dh/pybuild.pm dh-python-6.20240401/dh/pybuild.pm --- dh-python-6.20231223ubuntu2/dh/pybuild.pm 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dh/pybuild.pm 2024-04-01 17:23:32.000000000 +0000 @@ -127,7 +127,7 @@ # Without this, setuptools-scm tries to detect current # version from git tag, which fails for debian tags # (debian/) sometimes. - if ((grep /python3-(setuptools-scm|hatch-vcs)/, @deps) && !$ENV{'SETUPTOOLS_SCM_PRETEND_VERSION'}) { + if ((grep /python3-(setuptools-scm|flit-scm|hatch-vcs)/, @deps) && !$ENV{'SETUPTOOLS_SCM_PRETEND_VERSION'}) { my $changelog = Dpkg::Changelog::Debian->new(range => {"count" => 1}); $changelog->load("debian/changelog"); my $version = @{$changelog}[0]->get_version(); @@ -137,6 +137,18 @@ $ENV{'SETUPTOOLS_SCM_PRETEND_VERSION'} = $version; } + # When depends on python3-poetry-dynamic-versioning, set + # POETRY_DYNAMIC_VERSIONING_BYPASS to upstream version + if ((grep /python3-poetry-dynamic-versioning/, @deps) && !$ENV{'POETRY_DYNAMIC_VERSIONING_BYPASS'}) { + my $changelog = Dpkg::Changelog::Debian->new(range => {"count" => 1}); + $changelog->load("debian/changelog"); + my $version = @{$changelog}[0]->get_version(); + $version =~ s/-[^-]+$//; # revision + $version =~ s/^\d+://; # epoch + $version =~ s/~/-/; # ignore tilde versions + $ENV{'POETRY_DYNAMIC_VERSIONING_BYPASS'} = $version; + } + # When depends on python{3,}-pbr, set PBR_VERSION to upstream version # Without this, python-pbr tries to detect current # version from pkg metadata or git tag, which fails for debian tags @@ -157,7 +169,8 @@ $ENV{'PYBUILD_TEST_NOSE2'} ne '1' and $ENV{'PYBUILD_TEST_NOSE'} ne '1' and $ENV{'PYBUILD_TEST_CUSTOM'} ne '1' and - $ENV{'PYBUILD_TEST_TOX'} ne '1') { + $ENV{'PYBUILD_TEST_TOX'} ne '1' and + $ENV{'PYBUILD_TEST_STESTR'} ne '1') { if (grep {$_ eq 'tox'} @deps and $ENV{'PYBUILD_TEST_TOX'} ne '0') { push @py3opts, '--test-tox'} elsif (grep {$_ eq 'python3-pytest'} @deps and $ENV{'PYBUILD_TEST_PYTEST'} ne '0') { @@ -166,6 +179,8 @@ push @py3opts, '--test-nose2'} elsif (grep {$_ eq 'python3-nose'} @deps and $ENV{'PYBUILD_TEST_NOSE'} ne '0') { push @py3opts, '--test-nose'} + elsif (grep {$_ eq 'python3-stestr'} @deps and $ENV{'PYBUILD_TEST_STESTR'} ne '0') { + push @py3opts, '--test-stestr'} } my $py3all = 0; diff -Nru dh-python-6.20231223ubuntu2/dh_python3.rst dh-python-6.20240401/dh_python3.rst --- dh-python-6.20231223ubuntu2/dh_python3.rst 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dh_python3.rst 2024-04-01 17:23:32.000000000 +0000 @@ -62,7 +62,7 @@ #. If the *python3-bar* source package ships with a `debian/python3-bar.pydist` file (and uses dh_python3), this file will be included in the binary package as - `/usr/share/dh-python/dist/cpython3/python3-bar`. During the build + `/usr/share/python3/dist/python3-bar`. During the build of *python3-foo*, dh_python3 will then find and use the file. Both files have the same format described in diff -Nru dh-python-6.20231223ubuntu2/dhpython/__init__.py dh-python-6.20240401/dhpython/__init__.py --- dh-python-6.20231223ubuntu2/dhpython/__init__.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/__init__.py 2024-04-01 17:23:32.000000000 +0000 @@ -20,37 +20,24 @@ import re -PKG_PREFIX_MAP = {'cpython2': 'python', - 'cpython3': 'python3', - 'pypy': 'pypy'} +PKG_PREFIX_MAP = {'cpython3': 'python3'} # minimum version required for compile/clean scripts: -MINPYCDEP = {'cpython2': 'python2:any', - 'cpython3': 'python3:any', - 'pypy': 'pypy'} +MINPYCDEP = {'cpython3': 'python3:any'} PUBLIC_DIR_RE = { - 'cpython2': re.compile(r'.*?/usr/lib/python(2\.\d)(?:/|$)'), 'cpython3': re.compile(r'.*?/usr/lib/python(3(?:\.\d+)?)(?:/|$)'), - 'pypy': re.compile(r'.*?/usr/lib/pypy(?:/|$)')} +} INTERPRETER_DIR_TPLS = { - 'cpython2': r'.*/python2\.\d/', 'cpython3': r'.*/python3(?:\.\d+)?/', - 'pypy': r'.*/pypy/'} +} MULTIARCH_DIR_TPL = re.compile( '.*/([a-z][^/-]+-(?:linux|kfreebsd|gnu)(?:-[^/-]+)?)(?:/.*|$)') # Interpreter site-directories OLD_SITE_DIRS = { - 'cpython2': [ - '/usr/local/lib/python{}/site-packages', - '/usr/local/lib/python{}/dist-packages', - '/var/lib/python-support/python{}', - '/usr/lib/pymodules/python{}', - lambda version: '/usr/lib/python{}/site-packages'.format(version) - if version >= '2.6' else None], 'cpython3': [ '/usr/local/lib/python{}/site-packages', '/usr/local/lib/python{}/dist-packages', @@ -58,56 +45,36 @@ '/usr/lib/python{}/dist-packages', '/var/lib/python-support/python{}', '/usr/lib/pymodules/python{}'], - 'pypy': [ - '/usr/local/lib/pypy/site-packages', - '/usr/local/lib/pypy/dist-packages', - '/usr/lib/pypy/site-packages']} +} # PyDist related PYDIST_DIRS = { - 'cpython2': '/usr/share/python/dist/', 'cpython3': '/usr/share/python3/dist/', - 'pypy': '/usr/share/pypy/dist/'} +} PYDIST_OVERRIDES_FNAMES = { - 'cpython2': 'debian/pydist-overrides', 'cpython3': 'debian/py3dist-overrides', - 'pypy': 'debian/pypydist-overrides'} +} PYDIST_DPKG_SEARCH_TPLS = { # implementation: (dpkg -S query, regex filter) - 'cpython2': ('*/{}-?*.*-info', - r'/(python2\..|pyshared)/.*.(egg|dist)-info$'), 'cpython3': ('*python3/*/{}-?*.*-info', r'.(egg|dist)-info$'), - 'pypy': ('*/pypy/dist-packages/{}-?*.*-info', r'.(egg|dist)-info$'), } # DebHelper related DEPENDS_SUBSTVARS = { - 'cpython2': '${python:Depends}', 'cpython3': '${python3:Depends}', - 'pypy': '${pypy:Depends}', } PKG_NAME_TPLS = { - 'cpython2': ('python-', 'python2.'), 'cpython3': ('python3-', 'python3.'), - 'pypy': ('pypy-',) } RT_LOCATIONS = { - 'cpython2': '/usr/share/python/runtime.d/', 'cpython3': '/usr/share/python3/runtime.d/', - 'pypy': '/usr/share/pypy/runtime.d/', } RT_TPLS = { - 'cpython2': ''' -if [ "$1" = rtupdate ]; then -\tpyclean {pkg_arg} {dname} -\tpycompile {pkg_arg} {args} {dname} -fi''', 'cpython3': ''' if [ "$1" = rtupdate ]; then \tpy3clean {pkg_arg} {dname} \tpy3compile {pkg_arg} {args} {dname} fi''', - 'pypy': '' } diff -Nru dh-python-6.20231223ubuntu2/dhpython/_defaults.py dh-python-6.20240401/dhpython/_defaults.py --- dh-python-6.20231223ubuntu2/dhpython/_defaults.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/_defaults.py 2024-04-01 17:23:32.000000000 +0000 @@ -26,20 +26,19 @@ from subprocess import Popen, PIPE SUPPORTED = { - 'cpython2': [(2, 7)], 'cpython3': [(3, 8)], - 'pypy': [(4, 0)]} +} DEFAULT = { - 'cpython2': (2, 7), 'cpython3': (3, 8), - 'pypy': (4, 0)} +} log = logging.getLogger('dhpython') def cpython_versions(major): result = [None, None] - ver = '' if major == 2 else '3' + assert major > 2 + ver = str(major) supported = environ.get("DEBPYTHON{}_SUPPORTED".format(ver)) default = environ.get("DEBPYTHON{}_DEFAULT".format(ver)) if not supported or not default: @@ -75,17 +74,11 @@ print(stdout) -cpython2 = cpython_versions(2) cpython3 = cpython_versions(3) -if cpython2[0]: - DEFAULT['cpython2'] = cpython2[0] if cpython3[0]: DEFAULT['cpython3'] = cpython3[0] -if cpython2[1]: - SUPPORTED['cpython2'] = cpython2[1] if cpython3[1]: SUPPORTED['cpython3'] = cpython3[1] -#from_file('/usr/bin/pypy') if __name__ == '__main__': diff -Nru dh-python-6.20231223ubuntu2/dhpython/build/base.py dh-python-6.20240401/dhpython/build/base.py --- dh-python-6.20231223ubuntu2/dhpython/build/base.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/build/base.py 2024-04-01 17:23:32.000000000 +0000 @@ -273,9 +273,15 @@ tox_cmd.append('{args}') return ' '.join(tox_cmd) + elif self.cfg.test_stestr: + return ( + 'cd {build_dir};' + 'stestr --config {dir}/.stestr.conf init;' + 'PYTHON=python{version} stestr --config {dir}/.stestr.conf run' + ) elif self.cfg.test_custom: return 'cd {build_dir}; {args}' - elif args['version'] == '2.7' or args['version'] >> '3.1' or args['interpreter'] == 'pypy': + else: # Temporary: Until Python 3.12 is established, and packages without # test suites have explicitly disabled tests. args['ignore_no_tests'] = True diff -Nru dh-python-6.20231223ubuntu2/dhpython/build/plugin_distutils.py dh-python-6.20240401/dhpython/build/plugin_distutils.py --- dh-python-6.20231223ubuntu2/dhpython/build/plugin_distutils.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/build/plugin_distutils.py 2024-04-01 17:23:32.000000000 +0000 @@ -63,8 +63,7 @@ class BuildSystem(Base): DESCRIPTION = 'Distutils build system' SUPPORTED_INTERPRETERS = {'python', 'python3', 'python{version}', - 'python-dbg', 'python3-dbg', 'python{version}-dbg', - 'pypy'} + 'python-dbg', 'python3-dbg', 'python{version}-dbg'} REQUIRED_FILES = [_setup_tpl] OPTIONAL_FILES = {'setup.cfg': 1, 'requirements.txt': 1, diff -Nru dh-python-6.20231223ubuntu2/dhpython/build/plugin_flit.py dh-python-6.20240401/dhpython/build/plugin_flit.py --- dh-python-6.20231223ubuntu2/dhpython/build/plugin_flit.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/build/plugin_flit.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,152 +0,0 @@ -# Copyright © 2012-2020 Piotr Ożarowski -# © 2020 Scott Kitterman -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -from pathlib import Path -import copy -import logging -import os -import os.path as osp -import shutil -import sysconfig -try: - from flit.install import Installer -except ImportError: - Installer = object - -from dhpython.build.base import Base, shell_command - -log = logging.getLogger('dhpython') - - -class DebianInstaller(Installer): - def install_directly(self, destdir, installdir): - """Install a module/package into package directory, and create its - scripts. - """ - if installdir[:1] == os.sep: - installdir = installdir[1:] - - vars_ = copy.copy(sysconfig.get_config_vars()) - vars_['base'] = destdir + vars_['base'] - try: - dirs = sysconfig.get_paths(scheme='deb_system', vars=vars_) - except KeyError: - # Debian hasn't patched sysconfig schemes until 3.10 - # TODO: Introduce a version check once sysconfig is patched. - dirs = sysconfig.get_paths(scheme='posix_prefix', vars=vars_) - - dirs['purelib'] = dirs['platlib'] = osp.join(destdir, installdir) - os.makedirs(dirs['purelib'], exist_ok=True) - os.makedirs(dirs['scripts'], exist_ok=True) - - dst = osp.join(dirs['purelib'], osp.basename(self.module.path)) - if osp.lexists(dst): - if osp.isdir(dst) and not osp.islink(dst): - shutil.rmtree(dst) - else: - os.unlink(dst) - - src = str(self.module.path) - if self.module.is_package: - log.info("Installing package %s -> %s", src, dst) - shutil.copytree(src, dst) - self._record_installed_directory(dst) - else: - log.info("Installing file %s -> %s", src, dst) - shutil.copy2(src, dst) - self.installed_files.append(dst) - - scripts = self.ini_info.entrypoints.get('console_scripts', {}) - if scripts: - log.info("Installing scripts to %s", dirs['scripts']) - self.install_scripts(scripts, dirs['scripts']) - - log.info("Writing dist-info %s", dirs['purelib']) - self.write_dist_info(dirs['purelib']) - # Remove direct_url.json - contents are not useful or reproduceable - for path in Path(dirs['purelib']).glob("*.dist-info/direct_url.json"): - path.unlink() - - -class BuildSystem(Base): - DESCRIPTION = 'Flit build system' - SUPPORTED_INTERPRETERS = {'python3', 'python{version}'} - REQUIRED_FILES = ['pyproject.toml'] - OPTIONAL_FILES = {} - CLEAN_FILES = Base.CLEAN_FILES | {'build'} - - def detect(self, context): - """Return certainty level that this plugin describes the right build - system - - This method uses cls.{REQUIRED}_FILES (pyroject.toml) as well as - checking to see if build-backend is set to flit_core.buildapi. - - Score is 85 if both are present (to allow manually setting distutils to - score higher if set). - - :return: 0 <= certainty <= 100 - :rtype: int - """ - if Installer is object: - return 0 - - result = super().detect(context) - if result > 100: - return 100 - return result - - def clean(self, context, args): - super().clean(context, args) - if osp.exists(args['interpreter'].binary()): - log.debug("removing '%s' (and everything under it)", - args['build_dir']) - if osp.isdir(args['build_dir']): - shutil.rmtree(args['build_dir']) - return 0 # no need to invoke anything - - def configure(self, context, args): - # Flit does not support binary extensions - return 0 # Not needed for flit - - def build(self, context, args): - log.warning("The pybuild flit plugin is deprecated, " - "please use the pyproject plugin instead.") - my_dir = Path(args['dir']) - install_kwargs = {'user': False, 'symlink': False, 'deps': 'none'} - DebianInstaller.from_ini_path(my_dir / 'pyproject.toml', - **install_kwargs).install_directly( - args['build_dir'], '') - # These get byte compiled too, although it's not logged. - return 0 # Not needed for flit - - def install(self, context, args): - my_dir = Path(args['dir']) - install_kwargs = {'user': False, 'symlink': False, 'deps': 'none'} - DebianInstaller.from_ini_path(my_dir / 'pyproject.toml', - **install_kwargs).install_directly( - args['destdir'], - args['install_dir']) - return 0 # Not needed for flit' - - @shell_command - def test(self, context, args): - return super().test(context, args) diff -Nru dh-python-6.20231223ubuntu2/dhpython/debhelper.py dh-python-6.20240401/dhpython/debhelper.py --- dh-python-6.20231223ubuntu2/dhpython/debhelper.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/debhelper.py 2024-04-01 17:23:32.000000000 +0000 @@ -58,13 +58,9 @@ self.packages = {} self.build_depends = {} self.python_version = None - # Note that each DebHelper instance supports ONE interpreter type only - # it's not possible to mix cpython2, cpython3 and pypy here self.impl = impl self.command = { - 'cpython2': 'dh_python2', 'cpython3': 'dh_python3', - 'pypy': 'dh_pypy', }[impl] skip_tpl = set() for name, tpls in PKG_NAME_TPLS.items(): @@ -115,11 +111,6 @@ if len(self.python_version.split(',')) > 2: raise ValueError('too many arguments provided for ' 'X-Python3-Version: min and max only.') - elif self.impl == 'cpython2': - if 'x-python-version' in paragraphs[0]: - self.python_version = paragraphs[0]['x-python-version'] - elif 'xs-python-version' in paragraphs[0]: - self.python_version = paragraphs[0]['xs-python-version'] build_depends = [] for field in ('build-depends', 'build-depends-indep', @@ -167,7 +158,7 @@ continue if not binary_package.startswith(PKG_NAME_TPLS[impl]): - # package doesn't have common prefix (python-, python3-, pypy-) + # package doesn't have common prefix (python3-) # so lets check if Depends/Recommends contains the # appropriate substvar if (substvar not in paragraph.get('depends', '') diff -Nru dh-python-6.20231223ubuntu2/dhpython/depends.py dh-python-6.20240401/dhpython/depends.py --- dh-python-6.20231223ubuntu2/dhpython/depends.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/depends.py 2024-04-01 17:23:32.000000000 +0000 @@ -37,27 +37,13 @@ bdep = self.bdep = bdep or {} self.is_debug_package = dbgpkg = package.endswith('-dbg') - # TODO: move it to PyPy and CPython{2,3} classes self.ipkg_vtpl = 'python%s-dbg' if dbgpkg else 'python%s' - if impl == 'cpython3': - self.ipkg_tpl = 'python3-dbg' if dbgpkg else 'python3' - elif impl == 'cpython2': - self.ipkg_tpl = 'python2-dbg' if dbgpkg else 'python2' - elif impl == 'pypy': - self.ipkg_tpl = 'pypy-dbg' if dbgpkg else 'pypy' - self.ipkg_vtpl = 'pypy%s-dbg' if dbgpkg else 'pypy%s' - if impl == 'pypy': - self.ipkg_tpl_ma = self.ipkg_tpl - self.ipkg_vtpl_ma = self.ipkg_vtpl - else: - self.ipkg_tpl_ma = self.ipkg_tpl + ':any' - self.ipkg_vtpl_ma = self.ipkg_vtpl + ':any' + self.ipkg_tpl = 'python3-dbg' if dbgpkg else 'python3' + self.ipkg_tpl_ma = self.ipkg_tpl + ':any' + self.ipkg_vtpl_ma = self.ipkg_vtpl + ':any' self.python_dev_in_bd = 'python-dev' in bdep or\ 'python-all-dev' in bdep or\ - 'python2-dev' in bdep or\ - 'python2-all-dev' in bdep or\ - 'python2.7-dev' in bdep or\ 'python3-dev' in bdep or\ 'python3-all-dev' in bdep @@ -139,23 +125,6 @@ if maxv: self.depend("%s (<< %s)" % (tpl_tmp, maxv)) - if self.impl == 'cpython2' and stats['public_vers']: - # additional Depends to block python package transitions - sorted_vers = sorted(stats['public_vers']) - minv = sorted_vers[0] - maxv = sorted_vers[-1] - if minv <= default(self.impl): - self.depend("%s (>= %s~)" % (tpl_ma, minv)) - if maxv >= default(self.impl): - self.depend("%s (<< %s)" % (tpl_ma, maxv + 1)) - - if self.impl == 'pypy' and stats.get('ext_soabi'): - # TODO: make sure alternative is used only for the same extension names - # ie. for foo.ABI1.so, foo.ABI2.so, bar.ABI3,so, bar.ABI4.so generate: - # pypy-abi-ABI1 | pypy-abi-ABI2, pypy-abi-ABI3 | pypy-abi-ABI4 - self.depend('|'.join(soabi.replace('-', '-abi-') - for soabi in sorted(stats['ext_soabi']))) - if stats['ext_vers']: # TODO: what about extensions with stable ABI? sorted_vers = sorted(stats['ext_vers']) @@ -172,7 +141,7 @@ self.depend(MINPYCDEP[self.impl]) for ipreter in stats['shebangs']: - self.depend("%s%s" % (ipreter, '' if self.impl == 'pypy' else ':any')) + self.depend("%s:any" % ipreter) supported_versions = supported(self.impl) default_version = default(self.impl) diff -Nru dh-python-6.20231223ubuntu2/dhpython/fs.py dh-python-6.20240401/dhpython/fs.py --- dh-python-6.20231223ubuntu2/dhpython/fs.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/fs.py 2024-04-01 17:23:32.000000000 +0000 @@ -65,18 +65,6 @@ except OSError: pass - # move files from /usr/include/pythonX.Y/ to …/pythonX.Ym/ - if interpreter.symlinked_include_dir: - srcdir = "debian/%s%s" % (package, interpreter.symlinked_include_dir) - if srcdir and isdir(srcdir): - dstdir = "debian/%s%s" % (package, interpreter.include_dir) - log.debug('moving files from %s to %s', srcdir, dstdir) - share_files(srcdir, dstdir, interpreter, options) - try: - os.removedirs(srcdir) - except OSError: - pass - def share_files(srcdir, dstdir, interpreter, options): """Try to move as many files from srcdir to dstdir as possible.""" @@ -278,7 +266,6 @@ if self.is_unwanted_dir(dpath): rmtree(dpath) dirs.remove(name) - continue if self.is_dist_dir(root): self.handle_dist_dir(root, file_names) @@ -336,7 +323,7 @@ else: self.current_result.setdefault('shebangs', set()).add(res) - if fext == 'py' and self.handle_public_module(fpath) is not False: + if fext == 'py': self.current_result['compile'] = True if not dirs and not self.current_private_dir: @@ -438,9 +425,6 @@ # pylint: disable=unused-argument return None - def handle_public_module(self, fpath): - pass - def is_bin_dir(self, dpath): """Check if dir is one from PATH ones.""" # dname = debian/packagename/usr/games diff -Nru dh-python-6.20231223ubuntu2/dhpython/interpreter.py dh-python-6.20240401/dhpython/interpreter.py --- dh-python-6.20231223ubuntu2/dhpython/interpreter.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/interpreter.py 2024-04-01 17:23:32.000000000 +0000 @@ -63,7 +63,7 @@ :attr name: pypy or python (even for python3 and python-dbg) or empty string :attr version: interpreter's version :attr debug: -dbg version of the interpreter - :attr impl: implementation (cpytho2, cpython3 or pypy) + :attr impl: implementation (cpython3 or pypy) :attr options: options parsed from shebang :type path: str :type name: str @@ -116,17 +116,15 @@ if self.version: if self.version.major == 3: self.__dict__['impl'] = 'cpython3' - else: - self.__dict__['impl'] = 'cpython2' elif value == 'pypy': - self.__dict__['impl'] = 'pypy' + if self.version: + if self.version.major == 3: + self.__dict__['impl'] = 'pypy3' elif name == 'version' and value is not None: value = Version(value) if not self.impl and self.name == 'python': if value.major == 3: self.impl = 'cpython3' - else: - self.impl = 'cpython2' if name in ('path', 'name', 'impl', 'options') and value is None: pass elif name == 'debug': @@ -152,7 +150,7 @@ return self.name version = version or self.version or '' if consider_default_ver and (not version or version == self.default_version): - version = '3' if self.impl == 'cpython3' else '2' + version = '3' if self.debug: return 'python{}-dbg'.format(version) return self.name + str(version) @@ -223,10 +221,6 @@ >>> i = Interpreter('python') >>> i.sitedir(version='3.1') '/usr/lib/python3/dist-packages/' - >>> i.sitedir(version='2.5') - '/usr/lib/python2.5/site-packages/' - >>> i.sitedir(version=Version('2.7')) - '/usr/lib/python2.7/dist-packages/' >>> i.sitedir(version='3.1', gdb=True, package='python3-foo') 'debian/python3-foo/usr/lib/debug/usr/lib/python3/dist-packages/' >>> i.sitedir(version=Version('3.2')) @@ -236,14 +230,9 @@ version = Version(version or self.version) except Exception as err: raise ValueError("cannot find valid version: %s" % err) - if self.impl == 'pypy': - path = '/usr/lib/pypy/dist-packages/' - elif version << Version('2.6'): - path = "/usr/lib/python%s/site-packages/" % version - elif version << Version('3.0'): - path = "/usr/lib/python%s/dist-packages/" % version - else: - path = '/usr/lib/python3/dist-packages/' + if version << Version('3.0'): + raise ValueError(f"The version {version} is no longer supported") + path = '/usr/lib/python3/dist-packages/' if gdb: path = "/usr/lib/debug%s" % path @@ -288,6 +277,8 @@ def should_ignore(self, path): """Return True if path is used by another interpreter implementation.""" + if len(INTERPRETER_DIR_TPLS) == 1: + return cache_key = 'should_ignore_{}'.format(self.impl) if cache_key not in self.__class__._cache: expr = [v for k, v in INTERPRETER_DIR_TPLS.items() if k != self.impl] @@ -325,8 +316,6 @@ def magic_number(self, version=None): """Return magic number.""" version = Version(version or self.version) - if self.impl == 'cpython2': - return '' result = self._execute('import imp; print(imp.get_magic())', version) return eval(result) @@ -375,13 +364,11 @@ def include_dir(self): """Return INCLUDE_DIR path. - >>> Interpreter('python2.7').include_dir # doctest: +SKIP - '/usr/include/python2.7' + >>> Interpreter('python3.8').include_dir # doctest: +SKIP + '/usr/include/python3.8' >>> Interpreter('python3.8-dbg').include_dir # doctest: +SKIP '/usr/include/python3.8d' """ - if self.impl == 'pypy': - return '/usr/lib/pypy/include' try: result = self._get_config()[2] if result: @@ -408,31 +395,8 @@ return result @property - def symlinked_include_dir(self): - """Return path to symlinked include directory.""" - if self.impl in ('cpython2', 'pypy') or self.debug \ - or self.version >> '3.7' or self.version << '3.3': - # these interpreters do not provide symlink, - # others provide it in libpython3.X-dev - return - try: - result = self._get_config()[2] - if result: - if result.endswith('m'): - return result[:-1] - else: - # there's include_dir, but no "m" - return - except Exception: - result = '/usr/include/{}'.format(self.name) - log.debug('cannot get include path', exc_info=True) - return result - - @property def library_file(self): """Return libfoo.so file path.""" - if self.impl == 'pypy': - return '' libpl, ldlibrary = self._get_config()[3:5] if ldlibrary.endswith('.a'): # python3.1-dbg, python3.2, python3.2-dbg returned static lib @@ -486,20 +450,14 @@ tmp_multiarch = info['multiarch'] or multiarch result = info['name'] - if result.endswith('module') and result != 'module' and ( - self.impl == 'cpython3' and version >> '3.2' or - self.impl == 'cpython2' and version == '2.7'): + if result.endswith('module') and result != 'module' and self.impl == 'cpython3': result = result[:-6] if tmp_soabi: result = "{}.{}".format(result, tmp_soabi) - if tmp_multiarch and not (self.impl == 'cpython3' and version << '3.3') and tmp_multiarch not in soabi: + if tmp_multiarch and tmp_multiarch not in soabi: result = "{}-{}".format(result, tmp_multiarch) - elif self.impl == 'cpython2' and version == '2.7' and tmp_multiarch: - result = "{}.{}".format(result, tmp_multiarch) - if self.debug and self.impl == 'cpython2': - result += '_d' result += '.so' if fname == result: return @@ -512,29 +470,18 @@ 'python3-foo' >>> Interpreter('python3.8').suggest_pkg_name('foo_bar') 'python3-foo-bar' - >>> Interpreter('python2.7-dbg').suggest_pkg_name('bar') - 'python-bar-dbg' + >>> Interpreter('python3.8-dbg').suggest_pkg_name('bar') + 'python3-bar-dbg' """ name = name.replace('_', '-') - if self.impl == 'pypy': - return 'pypy-{}'.format(name) - version = '3' if self.impl == 'cpython3' else '' - result = 'python{}-{}'.format(version, name) + result = 'python3-{}'.format(name) if self.debug: result += '-dbg' return result def _get_config(self, version=None): version = Version(version or self.version) - # sysconfig module is available since Python 3.2 - # (also backported to Python 2.7) - if self.impl == 'pypy' or self.impl.startswith('cpython') and ( - version >> '2.6' and version << '3' - or version >> '3.1' or version == '3'): - cmd = 'import sysconfig as s;' - else: - cmd = 'from distutils import sysconfig as s;' - cmd += 'print("__SEP__".join(i or "" ' \ + cmd = 'import sysconfig as s; print("__SEP__".join(i or "" ' \ 'for i in s.get_config_vars('\ '"SOABI", "MULTIARCH", "INCLUDEPY", "LIBPL", "LDLIBRARY")))' conf_vars = self._execute(cmd, version).split('__SEP__') diff -Nru dh-python-6.20231223ubuntu2/dhpython/pydist.py dh-python-6.20240401/dhpython/pydist.py --- dh-python-6.20231223ubuntu2/dhpython/pydist.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/dhpython/pydist.py 2024-04-01 17:23:32.000000000 +0000 @@ -127,7 +127,7 @@ def load(impl): """Load information about installed Python distributions. - :param impl: interpreter implementation, f.e. cpython2, cpython3, pypy + :param impl: interpreter implementation, f.e. cpython3 :type impl: str """ fname = PYDIST_OVERRIDES_FNAMES.get(impl) diff -Nru dh-python-6.20231223ubuntu2/pybuild dh-python-6.20240401/pybuild --- dh-python-6.20231223ubuntu2/pybuild 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/pybuild 2024-04-01 17:23:32.000000000 +0000 @@ -241,8 +241,6 @@ '/usr/lib/python{version}/dist-packages' ).format(version=version, interpreter=i), 'home_dir': abspath(home_dir)}) - if interpreter == 'pypy': - args['install_dir'] = '/usr/lib/pypy/dist-packages/' env = dict(args.get('ENV', {})) pp = env.get('PYTHONPATH', context['ENV'].get('PYTHONPATH')) pp = pp.split(':') if pp else [] @@ -524,6 +522,9 @@ tests.add_argument('--test-tox', action='store_true', default=environ.get('PYBUILD_TEST_TOX') == '1', help='use tox in --test step') + tests.add_argument('--test-stestr', action='store_true', + default=environ.get('PYBUILD_TEST_STESTR') == '1', + help='use stestr in --test step') tests.add_argument('--test-custom', action='store_true', default=environ.get('PYBUILD_TEST_CUSTOM') == '1', help='use custom command in --test step') @@ -581,7 +582,7 @@ args.versions = versions if args.test_nose or args.test_nose2 or args.test_pytest or args.test_tox\ - or args.test_custom or args.system == 'custom': + or args.test_stestr or args.test_custom or args.system == 'custom': args.custom_tests = True else: args.custom_tests = False diff -Nru dh-python-6.20231223ubuntu2/pybuild.rst dh-python-6.20240401/pybuild.rst --- dh-python-6.20231223ubuntu2/pybuild.rst 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/pybuild.rst 2024-04-01 17:23:32.000000000 +0000 @@ -90,23 +90,25 @@ unittest's discover from standard library is used in test step by default. --test-nose - use nose module in test step, remember to add python-nose and/or - python3-nose to Build-Depends + use nose module in test step, remember to add python3-nose to + Build-Depends. --test-nose2 - use nose2 module in test step, remember to add python-nose2 and/or - python3-nose2 to Build-Depends + use nose2 module in test step, remember to add python3-nose2 to + Build-Depends. --test-pytest - use pytest module in test step, remember to add python-pytest and/or - python3-pytest to Build-Depends + use pytest module in test step, remember to add python3-pytest + to Build-Depends. --test-tox - use tox command in test step, remember to add tox - to Build-Depends. Requires tox.ini file + use tox command in test step, remember to add tox to + Build-Depends. + --test-stestr + use stestr command in test step, remember to add python3-stestr + to Build-Depends. --test-custom - use a custom command in the test step. The full test command is then - specified with `--test-args` or by setting the `PYBUILD_TEST_ARGS` - environment variable. Remember to add any needed packages to run the - tests to Build-Depends. - + use a custom command in the test step. The full test command is + then specified with `--test-args` or by setting the + `PYBUILD_TEST_ARGS` environment variable. Remember to add any + needed packages to run the tests to Build-Depends. testfiles ~~~~~~~~~ diff -Nru dh-python-6.20231223ubuntu2/pydist/README.PyDist dh-python-6.20240401/pydist/README.PyDist --- dh-python-6.20231223ubuntu2/pydist/README.PyDist 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/pydist/README.PyDist 2024-04-01 17:23:32.000000000 +0000 @@ -45,11 +45,6 @@ Python version or version range the line applies to. Examples: - * 2.6 (Python 2.6 only) - * 2.5- (Python 2.5 and newer) - * 2.5-2.7 (Python 2.5 or 2.6) - * -2.7 (Python 2.6 or older) - * 3.1 (Python 3.1 only) * 3.1- (Python 3.1 and newer) * 3.1-3.3 (Python 3.1 or 3.2) @@ -101,12 +96,6 @@ Complete examples: ~~~~~~~~~~~~~~~~~~ - * SQLAlchemy python-sqlalchemy (>= 0.5), python-sqlalchemy (<< 0.6) - * Mako python-mako; PEP386 - * foo -2.5 python-oldfoo; s/^/3:/ - * foo 2.5- python-foo; PEP440 - * Bar 2.6- - * SQLAlchemy python3-sqlalchemy (>= 0.5), python3-sqlalchemy (<< 0.6) * Mako python3-mako; PEP386 * foo -3.2 python3-oldfoo; s/^/3:/ diff -Nru dh-python-6.20231223ubuntu2/pydist/generate_fallback_list.py dh-python-6.20240401/pydist/generate_fallback_list.py --- dh-python-6.20231223ubuntu2/pydist/generate_fallback_list.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/pydist/generate_fallback_list.py 2024-04-01 17:23:32.000000000 +0000 @@ -41,16 +41,8 @@ 'http://ftp.debian.org/debian/dists/unstable/main/Contents-amd64.gz', ] -IGNORED_PKGS = {'python-setuptools', 'python3-setuptools', 'pypy-setuptools'} +IGNORED_PKGS = {'python3-setuptools'} OVERRIDES = { - 'cpython2': { - 'python': 'python', - 'setuptools': 'python-pkg-resources', - 'wsgiref': 'python (>= 2.5) | python-wsgiref', - 'argparse': 'python (>= 2.7) | python-argparse', - # not recognized due to .pth file (egg-info is in PIL/ and not in *-packages/) - 'pil': 'python-pil', - 'Pillow': 'python-pil'}, 'cpython3': { 'Cython': 'cython3', 'pil': 'python3-pil', @@ -58,21 +50,13 @@ 'pylint': 'pylint', 'setuptools': 'python3-pkg-resources', 'argparse': 'python3 (>= 3.2)'}, - 'pypy': {} } public_egg = re.compile(r''' /usr/ ( - (?P - (lib/python2\.[0-9]/((site)|(dist))-packages)| - (share/python-support/[^/]+) - )| (?P (lib/python3/dist-packages) - )| - (?P - (lib/pypy/dist-packages) ) ) /[^/]*\.(dist|egg)-info diff -Nru dh-python-6.20231223ubuntu2/tests/t301/debian/control dh-python-6.20240401/tests/t301/debian/control --- dh-python-6.20231223ubuntu2/tests/t301/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t301/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -4,6 +4,7 @@ Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~), python3-all Standards-Version: 3.9.0 +Rules-Requires-Root: no X-Python3-Version: >= 3.1, << 3.9 Architecture: all diff -Nru dh-python-6.20231223ubuntu2/tests/t301/debian/rules dh-python-6.20240401/tests/t301/debian/rules --- dh-python-6.20231223ubuntu2/tests/t301/debian/rules 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t301/debian/rules 2024-04-01 17:23:32.000000000 +0000 @@ -19,7 +19,7 @@ --suggests 'bar >= 1.0' clean: - rm -rf build + rm -rf build Foo.egg-info dh clean override_dh_auto_build: diff -Nru dh-python-6.20231223ubuntu2/tests/t302/debian/control dh-python-6.20240401/tests/t302/debian/control --- dh-python-6.20231223ubuntu2/tests/t302/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t302/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -4,6 +4,7 @@ Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~), python3-all-dev Standards-Version: 3.9.1 +Rules-Requires-Root: no X-Python3-Version: >= 3.2 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/t302/debian/rules dh-python-6.20240401/tests/t302/debian/rules --- dh-python-6.20231223ubuntu2/tests/t302/debian/rules 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t302/debian/rules 2024-04-01 17:23:32.000000000 +0000 @@ -28,3 +28,4 @@ touch debian/python3-foo/usr/include/python$(DEBPYTHON3_DEFAULT)/foo.h override_dh_auto_clean: + rm -rf Foo.egg-info diff -Nru dh-python-6.20231223ubuntu2/tests/t303/debian/control dh-python-6.20240401/tests/t303/debian/control --- dh-python-6.20231223ubuntu2/tests/t303/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t303/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -3,6 +3,7 @@ Priority: optional Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~), python3-all-dev +Rules-Requires-Root: no Standards-Version: 3.9.1 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/t304/debian/control dh-python-6.20240401/tests/t304/debian/control --- dh-python-6.20231223ubuntu2/tests/t304/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t304/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -4,6 +4,7 @@ Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python3 +Rules-Requires-Root: no Standards-Version: 3.9.3 Package: foo diff -Nru dh-python-6.20231223ubuntu2/tests/t305/debian/control dh-python-6.20240401/tests/t305/debian/control --- dh-python-6.20231223ubuntu2/tests/t305/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t305/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -4,6 +4,7 @@ Maintainer: Maximilian Engelhardt Build-Depends: debhelper (>= 12.9) Build-Depends-Indep: python3 +Rules-Requires-Root: no Standards-Version: 4.5.1 Package: foo5a diff -Nru dh-python-6.20231223ubuntu2/tests/t306/debian/control dh-python-6.20240401/tests/t306/debian/control --- dh-python-6.20231223ubuntu2/tests/t306/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t306/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -3,6 +3,7 @@ Priority: optional Maintainer: Maximilian Engelhardt Build-Depends: debhelper (>= 12.9), python3-all-dev:any +Rules-Requires-Root: no Standards-Version: 4.5.1 Package: foo diff -Nru dh-python-6.20231223ubuntu2/tests/t306/debian/rules dh-python-6.20240401/tests/t306/debian/rules --- dh-python-6.20231223ubuntu2/tests/t306/debian/rules 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t306/debian/rules 2024-04-01 17:23:32.000000000 +0000 @@ -12,3 +12,6 @@ override_dh_auto_install: python3 setup.py install --root=debian/foo/ --install-lib=/usr/share/foo/python + +override_dh_auto_clean: + rm -rf build Foo.egg-info diff -Nru dh-python-6.20231223ubuntu2/tests/t307/debian/control dh-python-6.20240401/tests/t307/debian/control --- dh-python-6.20231223ubuntu2/tests/t307/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/t307/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -3,6 +3,7 @@ Priority: optional Maintainer: Maximilian Engelhardt Build-Depends: debhelper (>= 12.9), python3-all-dev:any +Rules-Requires-Root: no Standards-Version: 4.5.1 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/ta01/debian/control dh-python-6.20240401/tests/ta01/debian/control --- dh-python-6.20231223ubuntu2/tests/ta01/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/ta01/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -6,6 +6,7 @@ , pybuild-plugin-pyproject , python3-all , python3-setuptools +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/ta02/debian/control dh-python-6.20240401/tests/ta02/debian/control --- dh-python-6.20231223ubuntu2/tests/ta02/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/ta02/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -7,6 +7,7 @@ , python3-all , python3-pytest , python3-setuptools +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/ta03/debian/control dh-python-6.20240401/tests/ta03/debian/control --- dh-python-6.20231223ubuntu2/tests/ta03/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/ta03/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -8,6 +8,7 @@ , python3-pytest , python3-tox , python3-setuptools +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/test_debhelper.py dh-python-6.20240401/tests/test_debhelper.py --- dh-python-6.20231223ubuntu2/tests/test_debhelper.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/test_debhelper.py 2024-04-01 17:23:32.000000000 +0000 @@ -133,15 +133,6 @@ self.assertEqual(list(self.dh.packages.keys()), ['python3-foo-ext', 'foo', 'recfoo']) - -class TestControlBlockParsingPy2(DebHelperTestCase): - control = CONTROL - impl = 'cpython2' - - def test_parses_packages(self): - self.assertEqual(list(self.dh.packages.keys()), ['python-foo']) - - class TestControlNoBinaryPackages(DebHelperTestCase): control = [ 'Source: foo-src', diff -Nru dh-python-6.20231223ubuntu2/tests/test_depends.py dh-python-6.20240401/tests/test_depends.py --- dh-python-6.20231223ubuntu2/tests/test_depends.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/test_depends.py 2024-04-01 17:23:32.000000000 +0000 @@ -21,15 +21,6 @@ return d -def py27(d): - """Mark all pydist entries as being for Python 2.7""" - for k, v in d.items(): - if isinstance(v, str): - d[k] = {'dependency': v} - d[k].setdefault('versions', {Version('2.7')}) - return d - - def prime_pydist(impl, pydist): """Fake the pydist data for impl. Returns a cleanup function""" from dhpython.pydist import load @@ -140,32 +131,6 @@ self.assertIn('python3-quux (>= 1.0~a1)', self.d.depends) -class TestRequiresPyPy(DependenciesTestCase): - impl = 'pypy' - options = FakeOptions(guess_deps=True) - pydist = { - 'bar': 'pypy-bar', - 'baz': {'dependency': 'pypy-baz', 'standard': 'PEP386'}, - 'quux': {'dependency': 'pypy-quux', 'standard': 'PEP440'}, - } - requires = { - 'debian/foo/usr/lib/pypy/dist-packages/foo.egg-info/requires.txt': ( - 'bar', - 'baz >= 1.0', - 'quux >= 1.0a1', - ) - } - - def test_depends_on_bar(self): - self.assertIn('pypy-bar', self.d.depends) - - def test_depends_on_baz(self): - self.assertIn('pypy-baz (>= 1.0)', self.d.depends) - - def test_depends_on_quux(self): - self.assertIn('pypy-quux (>= 1.0~a1)', self.d.depends) - - class TestRequiresCompatible(DependenciesTestCase): options = FakeOptions(guess_deps=True) pydist = { @@ -665,34 +630,6 @@ raise unittest.SkipTest('Not possible in requires.txt') -class TestEnvironmentMarkers27EggInfo(DependenciesTestCase): - options = FakeOptions(guess_deps=True) - impl = 'cpython2' - requires = { - 'debian/foo/usr/lib/python2.7/dist-packages/foo.egg-info/requires.txt': ( - "no_markers", - "[:os_name == 'posix']", - "os_posix", - "[:python_version >= '2.6']", - "python_version_ge26", - ) - } - pydist = py27({ - 'no_markers': 'python-no-markers', - 'os_posix': 'python-os-posix', - 'python_version_ge26': 'python-python-version-ge26', - }) - - def test_depends_on_unmarked_packages(self): - self.assertIn('python-no-markers', self.d.depends) - - def test_ignores_posix_packages(self): - self.assertNotInDepends('python-os-posix') - - def test_ignores_pyversion_packages(self): - self.assertNotInDepends('python-python-version-ge26') - - class TestIgnoresUnusedModulesDistInfo(DependenciesTestCase): options = FakeOptions(guess_deps=True, depends_section=['feature']) dist_info_metadata = { diff -Nru dh-python-6.20231223ubuntu2/tests/test_interpreter.py dh-python-6.20240401/tests/test_interpreter.py --- dh-python-6.20231223ubuntu2/tests/test_interpreter.py 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/test_interpreter.py 2024-04-01 17:23:32.000000000 +0000 @@ -13,54 +13,6 @@ if self._triplet: environ['DEB_HOST_MULTIARCH'] = self._triplet - @unittest.skipUnless(exists('/usr/bin/pypy'), 'pypy is not installed') - def test_pypy(self): - self.assertEqual( - sorted(Interpreter.parse('pypy').items()), - [('debug', None), ('name', 'pypy'), ('options', ()), ('path', ''), ('version', None)]) - self.assertEqual( - sorted(Interpreter.parse('#! /usr/bin/pypy --foo').items()), - [('debug', None), ('name', 'pypy'), ('options', ('--foo',)), ('path', '/usr/bin/'), ('version', None)]) - self.assertEqual( - Interpreter('pypy').sitedir(version='2.0'), - '/usr/lib/pypy/dist-packages/') - - @unittest.skipUnless(exists('/usr/bin/python2.6'), 'python2.6 is not installed') - def test_python26(self): - i = Interpreter('python2.6') - self.assertEqual(i.soabi(), '') - self.assertIsNone(i.check_extname('foo.so')) - self.assertIsNone(i.check_extname('foo.abi3.so')) - self.assertIsNone(i.check_extname('foo/bar/bazmodule.so')) - - @unittest.skipUnless(exists('/usr/bin/python2.6-dbg'), 'python2.6-dbg is not installed') - def test_python26dbg(self): - i = Interpreter('python2.6-dbg') - self.assertEqual(i.soabi(), '') - self.assertIsNone(i.check_extname('foo_d.so')) - self.assertEqual(i.check_extname('foo.so'), 'foo_d.so') - self.assertEqual(i.check_extname('foo/bar/bazmodule.so'), 'foo/bar/bazmodule_d.so') - - @unittest.skipUnless(exists('/usr/bin/python2.7'), 'python2.7 is not installed') - def test_python27(self): - i = Interpreter('python2.7') - self.assertEqual(i.soabi(), '') - self.assertEqual(i.check_extname('foo.so'), 'foo.MYARCH.so') - self.assertIsNone(i.check_extname('foo.MYARCH_d.so')) - self.assertIsNone(i.check_extname('foo.abi3.so')) - self.assertIsNone(i.check_extname('foo.OTHER.so')) # different architecture - self.assertEqual(i.check_extname('foo/bar/bazmodule.so'), 'foo/bar/baz.MYARCH.so') - - @unittest.skipUnless(exists('/usr/bin/python2.7-dbg'), 'python2.7-dbg is not installed') - def test_python27dbg(self): - i = Interpreter('python2.7-dbg') - self.assertEqual(i.soabi(), '') - self.assertEqual(i.check_extname('foo.so'), 'foo.MYARCH_d.so') - self.assertEqual(i.check_extname('foo_d.so'), 'foo.MYARCH_d.so') - self.assertIsNone(i.check_extname('foo.MYARCH_d.so')) - self.assertIsNone(i.check_extname('foo.OTHER_d.so')) # different architecture - self.assertEqual(i.check_extname('foo/bar/bazmodule.so'), 'foo/bar/baz.MYARCH_d.so') - @unittest.skipUnless(exists('/usr/bin/python3.1'), 'python3.1 is not installed') def test_python31(self): i = Interpreter('python3.1') @@ -245,10 +197,5 @@ self.assertEqual(i.check_extname('foo/bar/bazmodule.so'), r'foo/bar/baz.cpython-310d-MYARCH.so') - def test_version(self): - i = Interpreter(impl='cpython2') - self.assertEqual(str(i), 'python') - self.assertEqual(i.binary('2.7'), '/usr/bin/python2.7') - if __name__ == '__main__': unittest.main() diff -Nru dh-python-6.20231223ubuntu2/tests/tpb01/debian/control dh-python-6.20240401/tests/tpb01/debian/control --- dh-python-6.20231223ubuntu2/tests/tpb01/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/tpb01/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -7,6 +7,7 @@ , python3-setuptools , python3-cachy # , dh-python +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/tpb02/debian/control dh-python-6.20240401/tests/tpb02/debian/control --- dh-python-6.20231223ubuntu2/tests/tpb02/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/tpb02/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -7,6 +7,7 @@ , python3-all , pybuild-plugin-pyproject # , dh-python +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/tpb03/debian/control dh-python-6.20240401/tests/tpb03/debian/control --- dh-python-6.20231223ubuntu2/tests/tpb03/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/tpb03/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -7,6 +7,7 @@ , python3-setuptools , python3-setuptools-scm # , dh-python +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/tpb04/debian/control dh-python-6.20240401/tests/tpb04/debian/control --- dh-python-6.20231223ubuntu2/tests/tpb04/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/tpb04/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -8,6 +8,7 @@ , python3-cachy , tox # , dh-python +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/tpb05/debian/control dh-python-6.20240401/tests/tpb05/debian/control --- dh-python-6.20231223ubuntu2/tests/tpb05/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/tpb05/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -7,6 +7,7 @@ , python3-poetry-core , python3-pytest , pybuild-plugin-pyproject +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/tpb06/debian/control dh-python-6.20240401/tests/tpb06/debian/control --- dh-python-6.20231223ubuntu2/tests/tpb06/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/tpb06/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -6,6 +6,7 @@ , python3-all , python3-setuptools , pybuild-plugin-pyproject +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo diff -Nru dh-python-6.20231223ubuntu2/tests/tpb07/debian/control dh-python-6.20240401/tests/tpb07/debian/control --- dh-python-6.20231223ubuntu2/tests/tpb07/debian/control 2023-12-24 00:06:52.000000000 +0000 +++ dh-python-6.20240401/tests/tpb07/debian/control 2024-04-01 17:23:32.000000000 +0000 @@ -8,6 +8,7 @@ , python3-setuptools , pybuild-plugin-pyproject , tox (>= 4) +Rules-Requires-Root: no Standards-Version: 3.9.4 Package: python3-foo