Skip to content

Commit 65939fa

Browse files
committed
Improve discussion "Is setup.py deprecated?"
Add alternative solutions for more commands. GitHub: relates to pypa#1415
1 parent 83223a0 commit 65939fa

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

source/discussions/setup-py-deprecated.rst

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ And of course *setuptools* itself is not deprecated either.
1616

1717
It is however deprecated to run ``python setup.py`` as a command line tool.
1818

19-
This means for example that the following commands **MUST NOT** be run anymore:
19+
This means that commands such as the following **MUST NOT** be run anymore:
2020

2121
* ``python setup.py install``
2222
* ``python setup.py develop``
@@ -28,7 +28,7 @@ What commands should be used instead?
2828
=====================================
2929

3030
+---------------------------------+----------------------------------------+
31-
| Deprecated | Current recommendation |
31+
| Deprecated | Recommendation |
3232
+=================================+========================================+
3333
| ``python setup.py install`` | ``python -m pip install .`` |
3434
+---------------------------------+----------------------------------------+
@@ -79,6 +79,33 @@ The command ``python setup.py install`` was deprecated
7979
in setuptools version *58.3.0*.
8080

8181

82+
What about other commands?
83+
==========================
84+
85+
.. rubric:: ``python setup.py test``
86+
87+
The recommendation is to use a test runner such as pytest_.
88+
89+
.. _pytest: https://docs.pytest.org/
90+
91+
92+
.. rubric:: ``python setup.py check`` and ``python setup.py upload``
93+
94+
A trusted replacement is :ref:`twine`:
95+
96+
* ``python -m twine check``
97+
* ``python -m twine upload``
98+
99+
100+
.. rubric:: ``python setup.py --version``
101+
102+
A possible replacement solution (among others) is to rely on setuptools-scm_:
103+
104+
* ``python -m setuptools-scm``
105+
106+
.. _setuptools-scm: https://setuptools-scm.readthedocs.io/en/latest/usage/#as-cli-tool
107+
108+
82109
What about custom commands?
83110
===========================
84111

0 commit comments

Comments
 (0)