[Python-modules-team] Bug#937411: pycparser: Python2 removal in sid/bullseye

Lukas Märdian slyon at ubuntu.com
Wed May 12 10:57:01 BST 2021


Package: pycparser
Version: 2.20-3
Followup-For: Bug #937411
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu impish ubuntu-patch
X-Debbugs-Cc: slyon at ubuntu.com
Control: tags -1 patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

I've dropped the python-pycparser package and python2 build-depends + python2
tests (in autopkgtest) for this package, to satisfy the python2-rm
transition. Also, I'm building the parse tables with the 'python3'
binary, explicitly.

Thanks for considering the patch.

   Lukas

-- System Information:
Debian Release: bullseye/sid
  APT prefers hirsute-updates
  APT policy: (500, 'hirsute-updates'), (500, 'hirsute-security'), (500, 'hirsute')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.11.0-16-generic (SMP w/4 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE:en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
diff -Nru pycparser-2.20/debian/control pycparser-2.20/debian/control
--- pycparser-2.20/debian/control	2020-08-05 03:56:14.000000000 +0200
+++ pycparser-2.20/debian/control	2021-05-12 11:12:08.000000000 +0200
@@ -6,8 +6,6 @@
 Build-Depends:
  debhelper-compat (= 12),
  dh-python (>= 1.20140511),
- python-ply,
- python2.7,
  python3-all,
  python3-ply
 Standards-Version: 4.5.0
@@ -16,15 +14,6 @@
 Vcs-Browser: https://salsa.debian.org/python-team/modules/pycparser
 Rules-Requires-Root: no
 
-Package: python-pycparser
-Architecture: all
-Depends: ${misc:Depends}, ${python-ply:Depends}, ${python:Depends}
-Suggests: cpp
-Description: C parser in Python
- pycparser is a complete parser of the C language, written in pure Python using
- the PLY parsing library. It parses C code into an AST and can serve as a
- front-end for C compilers or analysis tools.
-
 Package: python3-pycparser
 Architecture: all
 Depends: ${misc:Depends}, ${python3-ply:Depends}, ${python3:Depends}
diff -Nru pycparser-2.20/debian/rules pycparser-2.20/debian/rules
--- pycparser-2.20/debian/rules	2020-08-05 03:56:14.000000000 +0200
+++ pycparser-2.20/debian/rules	2021-05-12 11:12:08.000000000 +0200
@@ -1,24 +1,19 @@
 #!/usr/bin/make -f
 
-export PYBUILD_DESTDIR_python2=debian/python-pycparser
 export PYBUILD_DESTDIR_python3=debian/python3-pycparser
 export PYBUILD_TEST_ARGS={dir}/tests
 export PYBUILD_AFTER_TEST=rm -f {build_dir}/parser.out {build_dir}/lextab.py {build_dir}/yacctab.py
 
 %:
-	dh $@ --with python2,python3 --buildsystem pybuild
+	dh $@ --with python3 --buildsystem pybuild
 
 override_dh_auto_build: clean-source
-	cd pycparser && python2 _build_tables.py
+	cd pycparser && python3 _build_tables.py
 	dh_auto_build
 
 override_dh_auto_clean: clean-source
 	dh_auto_clean
 
-override_dh_python2:
-	dh_python2
-	dh_python-ply $$(find $(PYBUILD_DESTDIR_python2) -name '*tab.py')
-
 override_dh_python3:
 	dh_python3
 	dh_python3-ply $$(find $(PYBUILD_DESTDIR_python3) -name '*tab.py')
diff -Nru pycparser-2.20/debian/tests/control pycparser-2.20/debian/tests/control
--- pycparser-2.20/debian/tests/control	2020-08-05 03:56:14.000000000 +0200
+++ pycparser-2.20/debian/tests/control	2021-05-12 11:12:08.000000000 +0200
@@ -1,2 +1,2 @@
 Tests: unittests
-Depends: cpp, python2, python3-all, @
+Depends: cpp, python3-all, @
diff -Nru pycparser-2.20/debian/tests/unittests pycparser-2.20/debian/tests/unittests
--- pycparser-2.20/debian/tests/unittests	2020-08-05 03:56:14.000000000 +0200
+++ pycparser-2.20/debian/tests/unittests	2021-05-12 11:12:08.000000000 +0200
@@ -1,11 +1,11 @@
 #!/bin/sh
 set -efu
 
-pythons="$(pyversions -sv) $(py3versions -sv)"
+pythons="$(py3versions -sv)"
 
 cp -a tests $AUTOPKGTEST_TMP
 mkdir $AUTOPKGTEST_TMP/utils
-ln -s /usr/share/python-pycparser/fake_libc_include $AUTOPKGTEST_TMP/utils
+ln -s /usr/share/python3-pycparser/fake_libc_include $AUTOPKGTEST_TMP/utils
 cd "$AUTOPKGTEST_TMP"
 
 for py in $pythons; do


More information about the Python-modules-team mailing list