Skip to content

Commit 49368ea

Browse files
committed
Merge branch 'main' into distribution-vs-import-package
2 parents 38675a1 + 6454a06 commit 49368ea

30 files changed

+395
-569
lines changed

.github/workflows/translation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
run: |
6666
git_hash=$(git rev-parse --short "${GITHUB_SHA}")
6767
git add --force locales/messages.pot
68+
git diff-index --quiet HEAD || \
6869
git commit \
6970
-m "Update messages.pot as of version ${git_hash}" \
7071
locales/messages.pot

source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@
141141
"dh-virtualenv": ("https://dh-virtualenv.readthedocs.io/en/latest/", None),
142142
"distlib": ("https://distlib.readthedocs.io/en/latest/", None),
143143
"flexx": ("https://flexx.readthedocs.io/en/latest/", None),
144+
"flit": ("https://flit.pypa.io/en/stable/", None),
144145
"nox": ("https://nox.thea.codes/en/latest/", None),
145146
"openstack": ("https://docs.openstack.org/glance/latest/", None),
146147
"packaging": ("https://packaging.pypa.io/en/latest/", None),
147-
"packaging.python.org": ("https://packaging.python.org/en/latest/", None),
148148
"pip": ("https://pip.pypa.io/en/latest/", None),
149149
"pipenv": ("https://pipenv.pypa.io/en/latest/", None),
150150
"piwheels": ("https://piwheels.readthedocs.io/en/latest/", None),

source/discussions/setup-py-deprecated.rst

Lines changed: 81 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
Is ``setup.py`` deprecated?
66
===========================
77

8-
No, :term:`setup.py` is not deprecated,
9-
it is a valid configuration file for :ref:`setuptools`
8+
No, :term:`setup.py` and :ref:`setuptools` are not deprecated.
9+
10+
Setuptools is perfectly usable as a :term:`build backend`
11+
for packaging Python projects.
12+
And :file:`setup.py` is a valid configuration file for :ref:`setuptools`
1013
that happens to be written in Python, instead of in *TOML* for example
1114
(a similar practice is used by other tools
1215
like *nox* and its :file:`nox.py` configuration file,
1316
or *pytest* and :file:`conftest.py`).
1417

15-
And of course *setuptools* itself is not deprecated either.
16-
17-
It is however deprecated to run ``python setup.py`` as a command line tool.
18+
However, ``python setup.py`` and the use of :file:`setup.py`
19+
as a command line tool are deprecated.
1820

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

2123
* ``python setup.py install``
2224
* ``python setup.py develop``
@@ -28,7 +30,7 @@ What commands should be used instead?
2830
=====================================
2931

3032
+---------------------------------+----------------------------------------+
31-
| Deprecated | Current recommendation |
33+
| Deprecated | Recommendation |
3234
+=================================+========================================+
3335
| ``python setup.py install`` | ``python -m pip install .`` |
3436
+---------------------------------+----------------------------------------+
@@ -79,6 +81,78 @@ The command ``python setup.py install`` was deprecated
7981
in setuptools version *58.3.0*.
8082

8183

84+
What about other commands?
85+
==========================
86+
87+
What are some replacements for the other ``python setup.py`` commands?
88+
89+
90+
``python setup.py test``
91+
------------------------
92+
93+
The recommendation is to use a test runner such as pytest_.
94+
95+
.. _pytest: https://docs.pytest.org/
96+
97+
98+
``python setup.py check``, ``python setup.py register``, and ``python setup.py upload``
99+
---------------------------------------------------------------------------------------
100+
101+
A trusted replacement is :ref:`twine`:
102+
103+
* ``python -m twine check --strict dist/*``
104+
* ``python -m twine register dist/*.whl`` [#not-pypi]_
105+
* ``python -m twine upload dist/*``
106+
107+
.. [#not-pypi] Not necessary, nor supported on :term:`PyPI <Python Package Index (PyPI)>`.
108+
But might be necessary on other :term:`package indexes <package index>` (for example :ref:`devpi`).
109+
110+
111+
``python setup.py --version``
112+
-----------------------------
113+
114+
A possible replacement solution (among others) is to rely on setuptools-scm_:
115+
116+
* ``python -m setuptools_scm``
117+
118+
.. _setuptools-scm: https://setuptools-scm.readthedocs.io/en/latest/usage/#as-cli-tool
119+
120+
121+
Remaining commands
122+
------------------
123+
124+
This guide does not make suggestions of replacement solutions for those commands:
125+
126+
.. hlist::
127+
:columns: 4
128+
129+
* ``alias``
130+
* ``bdist``
131+
* ``bdist_dumb``
132+
* ``bdist_egg``
133+
* ``bdist_rpm``
134+
* ``build``
135+
* ``build_clib``
136+
* ``build_ext``
137+
* ``build_py``
138+
* ``build_scripts``
139+
* ``clean``
140+
* ``dist_info``
141+
* ``easy_install``
142+
* ``editable_wheel``
143+
* ``egg_info``
144+
* ``install``
145+
* ``install_data``
146+
* ``install_egg_info``
147+
* ``install_headers``
148+
* ``install_lib``
149+
* ``install_scripts``
150+
* ``rotate``
151+
* ``saveopts``
152+
* ``setopt``
153+
* ``upload_docs``
154+
155+
82156
What about custom commands?
83157
===========================
84158

source/flow.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ required in the :file:`pyproject.toml` file. For example, you might specify:
9696

9797
* a ``[project]`` table containing project
9898
:doc:`Core Metadata </specifications/core-metadata/>`
99-
(name, version, author and so forth); see
100-
:doc:`Declaring project metadata </specifications/declaring-project-metadata/>`
101-
for more detail
99+
(name, version, author and so forth),
100+
101+
* a ``[tool]`` table containing tool-specific configuration options.
102+
103+
Refer to the :ref:`pyproject.toml guide <writing-pyproject-toml>` for a
104+
complete guide to ``pyproject.toml`` configuration.
102105

103-
* a ``[tool]`` table containing tool-specific configuration options
104106

105107
Build artifacts
106108
===============

source/guides/analyzing-pypi-package-downloads.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PyPI does not display download statistics for a number of reasons: [#]_
3232
doesn't mean it's good; Similarly just because a project hasn't been
3333
downloaded a lot doesn't mean it's bad!
3434

35-
In short, because it's value is low for various reasons, and the tradeoffs
35+
In short, because its value is low for various reasons, and the tradeoffs
3636
required to make it work are high, it has been not an effective use of
3737
limited resources.
3838

0 commit comments

Comments
 (0)