Skip to content

Commit

Permalink
Improve discussion "Is setup.py deprecated?"
Browse files Browse the repository at this point in the history
Add alternative solutions for more commands.

GitHub: relates to #1415
  • Loading branch information
sinoroc committed Nov 27, 2023
1 parent 83223a0 commit 6b61ecf
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions source/discussions/setup-py-deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ And of course *setuptools* itself is not deprecated either.

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

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

* ``python setup.py install``
* ``python setup.py develop``
Expand All @@ -28,7 +28,7 @@ What commands should be used instead?
=====================================

+---------------------------------+----------------------------------------+
| Deprecated | Current recommendation |
| Deprecated | Recommendation |
+=================================+========================================+
| ``python setup.py install`` | ``python -m pip install .`` |
+---------------------------------+----------------------------------------+
Expand Down Expand Up @@ -79,6 +79,34 @@ The command ``python setup.py install`` was deprecated
in setuptools version *58.3.0*.


What about other commands?
==========================

.. rubric:: ``python setup.py test``

The recommendation is to use a test runner such as pytest_.

.. _pytest: https://docs.pytest.org/


.. rubric:: ``python setup.py check``, ``python setup.py register``, and ``python setup.py upload``

A trusted replacement is :ref:`twine`:

* ``python -m twine check``
* ``python -m twine register``
* ``python -m twine upload``


.. rubric:: ``python setup.py --version``

A possible replacement solution (among others) is to rely on setuptools-scm_:

* ``python -m setuptools-scm``

.. _setuptools-scm: https://setuptools-scm.readthedocs.io/en/latest/usage/#as-cli-tool


What about custom commands?
===========================

Expand Down

0 comments on commit 6b61ecf

Please sign in to comment.