Control: reassign -1 src:argparse-manpage
Control: found -1 argparse-manpage/1.2.2-1
Control: tags -1 patch sid bookworm
Control: severity -1 important
Control: affects -1 src:sasl-xoauth2 src:osm2pgsql
On Tue, 30 May 2023 18:34:24 -0400 Daniel Kahn Gillmor wrote:
On Fri 2023-04-07 22:14:44 +0200, Andreas Beckmann wrote:
> sasl-xoauth2/experimental FTBFS on all architectures:
> https://buildd.debian.org/status/package.php?p=sasl-xoauth2&suite=experimental
>
> ...
> debian/rules execute_after_dh_auto_build
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> mkdir -p completions manpages
> register-python-argcomplete --shell bash sasl-xoauth2-tool >
completions/sasl-xoauth2-tool
> argparse-manpage --pyfile obj-x86_64-linux-gnu/scripts/sasl-xoauth2-tool
--object parser \
> --author 'Tarick Bedeir' --author-email 'tar...@bedeir.com' --project-name
sasl-xoauth2 \
> --url https://github.com/tarickb/sasl-xoauth2 --output
manpages/sasl-xoauth2-tool.1
> Traceback (most recent call last):
> File "/usr/bin/argparse-manpage", line 5, in <module>
> from build_manpages.cli import main
> File "/usr/lib/python3/dist-packages/build_manpages/cli/__init__.py", line 5, in
<module>
> from build_manpages.build_manpage import ManPageWriter, get_parser
> File "/usr/lib/python3/dist-packages/build_manpages/build_manpage.py", line 10,
in <module>
> from distutils.core import Command
> ModuleNotFoundError: No module named 'distutils.core'
> make[1]: *** [debian/rules:11: execute_after_dh_auto_build] Error 1
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> make: *** [debian/rules:6: binary-arch] Error 2
> ...
I think this represents a missing dependency in
python3-argparse-manpage, which makes packages that build-depend on
python3-argparse-manpage to generate their manpages FTBFS.
distutils was removed from setuptools 60:
https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html#prefer-setuptools
Upstream dealt with this in v4:
https://github.com/praiskup/argparse-manpage/commit/3e10dac5702915b9b92fdc686bad690c1b15bf61
The package is still at 1.2.2, quite a way behind to simply cherry-pick
those changes.
I'm lowering the severity, because the package is not entirely unusable,
the osm2psql package uses it during the build to generate a manpage for
osm2pgsql-replication which still works because it uses selective imports:
from build_manpages.manpage import Manpage
from build_manpages.build_manpage import get_parser_from_file
Only the the build_manpage class is broken because it subclasses
distutils.Command and raises DistutilsOptionError.
The attached patch replaces the distutils imports with those for
setuptools, except the DistutilsOptionError exception which is replaced
with plain Exception.
Kind Regards,
Bas
--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
diff -Nru argparse-manpage-1.2.2/debian/changelog
argparse-manpage-1.2.2/debian/changelog
--- argparse-manpage-1.2.2/debian/changelog 2019-09-12 08:33:21.000000000
+0200
+++ argparse-manpage-1.2.2/debian/changelog 2023-05-31 05:53:15.000000000
+0200
@@ -1,3 +1,11 @@
+argparse-manpage (1.2.2-1.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Add patch to not use deprecated distutils module, removed in setuptools 60.
+ (closes: #1034065)
+
+ -- Bas Couwenberg <sebas...@debian.org> Wed, 31 May 2023 05:53:15 +0200
+
argparse-manpage (1.2.2-1) unstable; urgency=medium
* New upstream release.
diff -Nru argparse-manpage-1.2.2/debian/control
argparse-manpage-1.2.2/debian/control
--- argparse-manpage-1.2.2/debian/control 2019-09-12 08:24:48.000000000
+0200
+++ argparse-manpage-1.2.2/debian/control 2023-05-31 05:51:44.000000000
+0200
@@ -16,7 +16,7 @@
Package: python3-argparse-manpage
Architecture: all
-Depends: ${misc:Depends}, ${python3:Depends},
+Depends: ${misc:Depends}, ${python3:Depends}, python3-setuptools
Description: Automatically build a manpage from argparse
Generate a manual page in an automatic way from an ArgumentParser object,
so that the manpage matches to the automatically generated --help output.
diff -Nru argparse-manpage-1.2.2/debian/patches/no-distutils.patch
argparse-manpage-1.2.2/debian/patches/no-distutils.patch
--- argparse-manpage-1.2.2/debian/patches/no-distutils.patch 1970-01-01
01:00:00.000000000 +0100
+++ argparse-manpage-1.2.2/debian/patches/no-distutils.patch 2023-05-31
05:53:11.000000000 +0200
@@ -0,0 +1,74 @@
+Description: Don't use deprecated distutils module, removed in setuptools 60.
+Author: Bas Couwenberg <sebas...@debian.org>
+Bug-Debian: https://bugs.debian.org/1036963
+
+--- a/build_manpages/build_manpage.py
++++ b/build_manpages/build_manpage.py
+@@ -7,8 +7,7 @@ import datetime
+ import optparse
+ import argparse
+
+-from distutils.core import Command
+-from distutils.errors import DistutilsOptionError
++from setuptools import Command
+
+ from .manpage import Manpage
+
+@@ -216,9 +215,9 @@ class build_manpage(Command):
+
+ def finalize_options(self):
+ if self.output is None:
+- raise DistutilsOptionError('\'output\' option is required')
++ raise Exception('\'output\' option is required')
+ if self.parser is None and self.file_and_object is None:
+- raise DistutilsOptionError('\'parser\' or \'file-and-object\'
option is required')
++ raise Exception('\'parser\' or \'file-and-object\' option is
required')
+
+ self.ensure_string_list('seealso')
+
+--- a/build_manpages/build_manpages.py
++++ b/build_manpages/build_manpages.py
+@@ -7,10 +7,10 @@ import os
+
+ DEFAULT_CMD_NAME = 'build_manpages'
+
+-from distutils.core import Command
+-from distutils.errors import DistutilsOptionError
+ import shutil
+
++from setuptools import Command
++
+ try:
+ from configparser import ConfigParser
+ except ImportError:
+@@ -63,7 +63,7 @@ class build_manpages(Command):
+
+ def finalize_options(self):
+ if not self.manpages:
+- raise DistutilsOptionError('\'manpages\' option is required')
++ raise Exception('\'manpages\' option is required')
+
+ self.manpages_parsed = parse_manpages_spec(self.manpages)
+
+--- a/examples/old_format/setup.py
++++ b/examples/old_format/setup.py
+@@ -12,7 +12,7 @@
+ import os
+ import sys
+
+-from distutils.core import setup
++from setuptools import setup
+
+
+ # Just to make sure that build_manpage can be found.
+--- a/examples/raw-description/setup.py
++++ b/examples/raw-description/setup.py
+@@ -15,7 +15,7 @@ from build_manpages.build_manpages \
+ import build_manpages, get_build_py_cmd, get_install_cmd
+
+ from setuptools.command.install import install
+-from distutils.command.build import build
++from setuptools.command.build import build
+
+ setup(
+ name='example',
diff -Nru argparse-manpage-1.2.2/debian/patches/series
argparse-manpage-1.2.2/debian/patches/series
--- argparse-manpage-1.2.2/debian/patches/series 1970-01-01
01:00:00.000000000 +0100
+++ argparse-manpage-1.2.2/debian/patches/series 2023-05-31
05:46:01.000000000 +0200
@@ -0,0 +1 @@
+no-distutils.patch