Package: click
Version: 0.5.0-7

Short story: Package needs python3-mock due to a wrong comparison in
upstream setup.py, can't install it without network and then fails to build
in the test phase.

At work, I'm rebuilding all packages in Debian testing. click fails there,
during the test phase. And while looking at debian/control in the source
package, I got confused.

debian/control has this in its Build-Depends:

 python3:any (>= 3.3) | python3-mock,

Now, I'm wondering what the reasoning behind this alternative would be (I
couldn't find how python3>=3.3 would provide python3-mock). And why
python3-mock isn't marked with (!nocheck)? It seems it's only used during
tests (which should be disabled by the `nocheck` build profile, I didn't
check yet if that happens. (I suspect python3-coverage is also only used
during tests and might not even be needed there - setuptools used to skip
coverage if not explicitly asked to run it and the coverage tooling wasn't
installed).

The reason the build fails during tests is that the machine running the
test has essentially no network access (Debian Policy allows such build
environments) and the test attempts to install mock from the network:

/usr/lib/python3/dist-packages/setuptools/dist.py:493: UserWarning:
Normalizing '0.5.0-8' to '0.5.0.post8'
  warnings.warn(tmpl.format(**locals()))
running test
WARNING: Testing via this command is deprecated and will be removed in a
future version. Users looking for a generic test entry point independent of
test runner are encouraged to use tox.
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116:
PkgResourcesDeprecationWarning: 2.3.0- is an invalid version and will not
be supported in a future release
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:27:
SetuptoolsDeprecationWarning: setuptools.installer is deprecated.
Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object
at 0xf63dfbe0>: Failed to establish a new connection: [Errno -3] Temporary
failure in name resolution')': /simple/mock/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object
at 0xf63dfcd0>: Failed to establish a new connection: [Errno -3] Temporary
failure in name resolution')': /simple/mock/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object
at 0xf63dfdd8>: Failed to establish a new connection: [Errno -3] Temporary
failure in name resolution')': /simple/mock/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object
at 0xf63dff28>: Failed to establish a new connection: [Errno -3] Temporary
failure in name resolution')': /simple/mock/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object
at 0xf63dffe8>: Failed to establish a new connection: [Errno -3] Temporary
failure in name resolution')': /simple/mock/
ERROR: Could not find a version that satisfies the requirement mock (from
versions: none)
ERROR: No matching distribution found for mock
error: Command '['/usr/bin/python3', '-m', 'pip',
'--disable-pip-version-check', 'wheel', '--no-deps', '-w',
'/tmp/tmpf8o5cnox', '--quiet', 'mock']' returned non-zero exit status 1.

####

Did fail to send this for an hour or so. And just looked at setup.py ->
This line is a problem:

if sys.version < "3.3":

sys.version is 3.10 - But:

>>> sys.version < "3.3"
True
>>> sys.version
'3.10.4 (main, May  6 2022, 11:23:40) [GCC 11.2.0]'

So this explain both why the package depends on mox only when python is <=
3.2+ and why it tries to install mock when

Kind regards,
Sven

Side note: Looks like `tox` and `mock` and probably `coverage`

Reply via email to