#1001459 dh-python: SetuptoolsDeprecationWarning: setup.py install is deprecated

#1001459#5
Date:
2021-12-10 14:20:35 UTC
From:
To:
I have noticed the following warning when building a Python package:

running install_scripts
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running egg_info

I'm assuming that this call to setup.py install originates from
pybuild.

It's currently only a deprecation warning, but at some point it may
become a fatal error.

Best wishes,

   Julian

#1001459#10
Date:
2021-12-10 16:53:07 UTC
From:
To:
Hi Julian (2021.12.10_14:20:35_+0000)

We're adding support for the build mechanism soon. But that'll need some
testing before we can use it by default.

That's correct.

SR

#1001459#15
Date:
2021-12-11 17:56:22 UTC
From:
To:
Hi Stefano,

Great, thanks!  I guessed that you might already be aware of it, but
wanted to be on the safe side.

Best wishes,

   Julian

#1001459#20
Date:
2025-05-01 11:10:22 UTC
From:
To:
Upstream has indicated a desire to move fast on this:
https://github.com/pypa/setuptools/pull/4970#discussion_r2070159468
I've pushed back.

Stefano

#1001459#27
Date:
2025-12-25 03:40:57 UTC
From:
To:
Hi Stefano,

Stefano Rivera <stefanor@debian.org> (2025-05-01):

Thanks for doing so!

I've noticed a bunch of local packages using python3-pbr and dh-python
getting bigs walls of warnings when built in a trixie environment…

In bookworm that was subtle, e.g. for dh_auto_configure (also getting
very similar things for dh_auto_{build,install,clean}):

,---
|    dh_auto_configure -O--buildsystem=pybuild
| I: pybuild base:240: python3.11 setup.py config
| /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:146: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
|   warnings.warn(
| /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
|   warnings.warn(
| running config
`---

In trixie, not so subtle anymore (ditto for other dh_auto_*):

,---
| I: pybuild base:311: python3.13 setup.py config
| /usr/lib/python3/dist-packages/setuptools/__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
| !!
|
|         ********************************************************************************
|         Requirements should be satisfied by a PEP 517 installer.
|         If you are using pip, you can try `pip install --use-pep517`.
|         ********************************************************************************
|
| !!
|   dist.fetch_build_eggs(dist.setup_requires)
| /usr/lib/python3/dist-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.
| !!
|
|         ********************************************************************************
|         Please avoid running ``setup.py`` and ``easy_install``.
|         Instead, use pypa/build, pypa/installer or other
|         standards-based tools.
|
|         See https://github.com/pypa/setuptools/issues/917 for details.
|         ********************************************************************************
|
| !!
|   easy_install.initialize_options(self)
| /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()
| running config
`---

Is there some kind of migration guide to move away from setup.py, to
something that's well supported in Debian (in say trixie or later)?

Thanks for your time!


Season's greetings,