#1120248 python-magic: FTBFS: ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)

#1120248#5
Date:
2025-11-06 12:00:01 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202511/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:python-magic, so that this is still
visible in the BTS web page for this package.

Thanks.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: MIT License

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!
  self._finalize_license_expression()
running clean
removing '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build' (and everything under it)
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-3.13' does not exist -- can't clean it
   dh_autoreconf_clean -O--buildsystem=pybuild -O--test-tox
   dh_clean -O--buildsystem=pybuild -O--test-tox
 debian/rules binary
dh binary --buildsystem=pybuild --test-tox --with python3
   dh_update_autotools_config -O--buildsystem=pybuild -O--test-tox
   dh_autoreconf -O--buildsystem=pybuild -O--test-tox
   dh_auto_configure -O--buildsystem=pybuild -O--test-tox
I: pybuild base:311: python3.13 setup.py config
/usr/lib/python3/dist-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: MIT License

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!
  self._finalize_license_expression()
running config
   dh_auto_build -O--buildsystem=pybuild -O--test-tox
I: pybuild base:311: /usr/bin/python3 setup.py build
/usr/lib/python3/dist-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: MIT License

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!
  self._finalize_license_expression()
running build
running build_py
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/magic
copying magic/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/magic
copying magic/compat.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/magic
copying magic/loader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/magic
copying magic/__init__.pyi -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/magic
copying magic/py.typed -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/magic
   dh_auto_test -O--buildsystem=pybuild -O--test-tox
I: pybuild base:311: /usr/bin/python3 -c "import setuptools, runpy; runpy.run_path('setup.py')" bdist_wheel
/usr/lib/python3/dist-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: MIT License

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!
  self._finalize_license_expression()
running bdist_wheel
/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py:135: SetuptoolsDeprecationWarning: bdist_wheel.universal is deprecated
!!

        ********************************************************************************
        With Python 2.7 end-of-life, support for building universal wheels
        (i.e., wheels that support both Python 2 and Python 3)
        is being obviated.
        Please discontinue using this option, or if you still need it,
        file an issue with pypa/setuptools describing your use case.

        This deprecation is overdue, please update your project and remove deprecated
        calls to avoid build errors in the future.
        ********************************************************************************

!!
  self.finalize_options()
running build
running build_py
creating build/lib/magic
copying magic/__init__.py -> build/lib/magic
copying magic/compat.py -> build/lib/magic
copying magic/loader.py -> build/lib/magic
copying magic/__init__.pyi -> build/lib/magic
copying magic/py.typed -> build/lib/magic
/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py:90: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/magic
copying build/lib/magic/__init__.py -> build/bdist.linux-x86_64/wheel/./magic
copying build/lib/magic/py.typed -> build/bdist.linux-x86_64/wheel/./magic
copying build/lib/magic/__init__.pyi -> build/bdist.linux-x86_64/wheel/./magic
copying build/lib/magic/compat.py -> build/bdist.linux-x86_64/wheel/./magic
copying build/lib/magic/loader.py -> build/bdist.linux-x86_64/wheel/./magic
running install_egg_info
running egg_info
creating python_magic.egg-info
writing python_magic.egg-info/PKG-INFO
writing dependency_links to python_magic.egg-info/dependency_links.txt
writing top-level names to python_magic.egg-info/top_level.txt
writing manifest file 'python_magic.egg-info/SOURCES.txt'
reading manifest file 'python_magic.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no directories found matching 'tests'
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
adding license file 'LICENSE'
writing manifest file 'python_magic.egg-info/SOURCES.txt'
Copying python_magic.egg-info to build/bdist.linux-x86_64/wheel/./python_magic-0.4.27.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/python_magic-0.4.27.dist-info/WHEEL
creating 'dist/python_magic-0.4.27-py2.py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'magic/__init__.py'
adding 'magic/__init__.pyi'
adding 'magic/compat.py'
adding 'magic/loader.py'
adding 'magic/py.typed'
adding 'python_magic-0.4.27.dist-info/licenses/LICENSE'
adding 'python_magic-0.4.27.dist-info/METADATA'
adding 'python_magic-0.4.27.dist-info/WHEEL'
adding 'python_magic-0.4.27.dist-info/top_level.txt'
adding 'python_magic-0.4.27.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
I: pybuild base:311: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; tox -c /<<PKGBUILDDIR>>/tox.ini --sitepackages -e py313 -x testenv.passenv+=_PYTHON_HOST_PLATFORM --installpkg /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/python_magic-0.4.27-py2.py3-none-any.whl
py313: install_deps .pybuild/cpython3_3.13/build> python -I -m pip install coverage pytest '.[test]'
  error: subprocess-exited-with-error

  × installing build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fc479dde270>: Failed to establish a new connection: [Errno 111] Connection refused'))': /simple/setuptools/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fc479d8e5d0>: Failed to establish a new connection: [Errno 111] Connection refused'))': /simple/setuptools/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fc479d8e710>: Failed to establish a new connection: [Errno 111] Connection refused'))': /simple/setuptools/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fc479d8e850>: Failed to establish a new connection: [Errno 111] Connection refused'))': /simple/setuptools/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fc479d8e990>: Failed to establish a new connection: [Errno 111] Connection refused'))': /simple/setuptools/
      ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
      ERROR: No matching distribution found for setuptools>=40.8.0
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'file:///<<PKGBUILDDIR>>' when installing build dependencies
Processing /<<PKGBUILDDIR>>
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
py313: exit 1 (8.27 seconds) /<<PKGBUILDDIR>>> python -I -m pip install coverage pytest '.[test]' pid=112
  py313: FAIL code 1 (8.40 seconds)
  evaluation failed :( (8.46 seconds)
E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; tox -c /<<PKGBUILDDIR>>/tox.ini --sitepackages -e py313 -x testenv.passenv+=_PYTHON_HOST_PLATFORM --installpkg /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/python_magic-0.4.27-py2.py3-none-any.whl
dh_auto_test: error: pybuild --test --test-tox -i python{version} -p 3.13 returned exit code 13
make: *** [debian/rules:8: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------

#1120248#12
Date:
2026-05-23 10:19:50 UTC
From:
To:
Attached debdiff for an NMU (python-magic 0.4.27-3.1) that fixed build failure

Shanavas M

#1120248#19
Date:
2026-05-23 11:59:22 UTC
From:
To:
Shanavas M wrote...

One question though, although more a visual issue: You change the LC_ALL
settings, I realized this is necessary to avoid fatal errors from
pytest. But now this creates several (non-fatal) warnings from debhelper
(or rather: The Perl runtime debhelper is written in):

```
running install_scripts
   dh_installdocs -O--buildsystem=pybuild -O--test-pytest
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = "en_US.UTF-8",
        LC_CTYPE = "C.UTF-8",
        LC_NUMERIC = (unset),
        LC_COLLATE = "C.UTF-8",
        LC_TIME = (unset),
        LC_MESSAGES = (unset),
        LC_MONETARY = (unset),
        LC_ADDRESS = (unset),
        LC_IDENTIFICATION = (unset),
        LC_MEASUREMENT = (unset),
        LC_PAPER = (unset),
        LC_TELEPHONE = (unset),
        LC_NAME = (unset),
        LANG = "C.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("C.UTF-8").
```

If you have an idea how to deal with this in a sane way, I'm interested
in learning about it.

Kind regards,

    Christoph

#1120248#26
Date:
2026-05-23 12:54:04 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
python-magic, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1120248@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christoph Biedl <debian.axhn@manchmal.in-ulm.de> (supplier of updated python-magic package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 23 May 2026 14:14:14 +0200
Source: python-magic
Architecture: source
Version: 2:0.4.27-4
Distribution: unstable
Urgency: medium
Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Changed-By: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Closes: 1120248
Changes:
 python-magic (2:0.4.27-4) unstable; urgency=medium
 .
   * Use pytest instead of tox. Thanks Shanavas M. Closes: #1120248
Checksums-Sha1:
 774fb22ca163704b084821ce427906b420d4e89a 2045 python-magic_0.4.27-4.dsc
 49f8dc27df2e79f7d3bbd7457d4233aacfc999f4 4484 python-magic_0.4.27-4.debian.tar.xz
 2fdfab27689df52dd3fd5c26808128c0a1ab376b 6716 python-magic_0.4.27-4_powerpc.buildinfo
Checksums-Sha256:
 859bccbdb672adbb663e573b831813f2c0c8865a38d197f3f6952440ad4df5ed 2045 python-magic_0.4.27-4.dsc
 54f9adf51209cd7a1b218b96f9ac20f258bf781a7e071509e3b8b8b838c4d35c 4484 python-magic_0.4.27-4.debian.tar.xz
 98b0b447176f13612f8d07ea43c3de8cc38bac3f18ba04e3dfe6d0a4c9472940 6716 python-magic_0.4.27-4_powerpc.buildinfo
Files:
 2f7d0bafbc6283289983583b5571a1ba 2045 libs extra python-magic_0.4.27-4.dsc
 6cfb21eb8f29218070cbd31103a81ade 4484 libs extra python-magic_0.4.27-4.debian.tar.xz
 9539515e93969c09e76e84046702faad 6716 libs extra python-magic_0.4.27-4_powerpc.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEWXMI+726A12MfJXdxCxY61kUkv0FAmoRnq8ACgkQxCxY61kU
kv13yxAAnldGv5P8LH3Xw/ChAVfVasV0cxL5QCk5bs0G0uX4SmuJ8x4VfuoL5Fa4
pReyqA0mhihb0A2+ULhQkK55iqHc88xPj+L0FPv9HgcSEVvSi/v/sLiKG/FMpS+j
jevtvRzrL47dURUgFMpwKBJaFF6CgySHUF4Cv0Das8zoBsE7obeY9+uT2rzRtANn
PYvHWEIklXmatypKBCv+TsT3FXcIA7IXaObH8wkyRZGsIS3PYg+mMRUvnt3qNh6F
3a44dPDrceQy2V+ld5Ysx0S00EvM98HawCxgeINsCpJRZ2LlD3dQE3wDoVS6hqyO
K1qwKOwEbWK8L9vK8EILdmmMMMn2bhDlKUND7QiKk4Z3Ux9UtiCUCDf1VSWRL4eo
l2qA5p6oixc3Diffr2Si9Ewt2QFYI+xxJsm9RJxDnDNK1ljgLgbvYDaoHZ8cWhJo
75BTD+Lc9nm0h4bRAAuCxLnIPYuWhZJsDYtXTRZj/xum9ypg8gF0q/0sZiri1/9g
NgTqmx8076u2CVzbUfvrXJDP9QJbATm2l3nGifK4OPTI3L0xGYg/+zBuy9k89Dua
dFAYK7HAabccvR6Gx7BoVQfnfgpo+t0lyj9fSaKAsTqYM+uPjvq078Pp/6Y1+Mdz
vAy1dLw+5Bi/PrdMA3WJIu2RGmPtFchx4jS6ch7P1Vts8gjSDfE=
=nBrH
-----END PGP SIGNATURE-----