Skip to content

Commit ac9170d

Browse files
authored
Merge branch 'main' into upgrade-contribution
2 parents 3b21964 + caeae8f commit ac9170d

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

source/guides/distributing-packages-using-setuptools.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
Packaging and distributing projects
55
===================================
66

7-
This section covers the basics of how to configure, package and distribute your
8-
own Python projects. It assumes that you are already familiar with the contents
9-
of the :doc:`/tutorials/installing-packages` page.
7+
This section covers some additional details on configuring, packaging and
8+
distributing Python projects with ``setuptools`` that aren't covered by the
9+
introductory tutorial in :doc:`/tutorials/packaging-projects`. It still assumes
10+
that you are already familiar with the contents of the
11+
:doc:`/tutorials/installing-packages` page.
1012

1113
The section does *not* aim to cover best practices for Python project
1214
development as a whole. For example, it does not provide guidance or tool

source/tutorials/packaging-projects.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,16 @@ be required, but can be omitted with newer versions of setuptools and pip.
329329
There are many more than the ones mentioned here. See
330330
:doc:`/guides/distributing-packages-using-setuptools` for more details.
331331

332+
.. warning::
333+
334+
You may see some existing projects or other Python packaging tutorials that
335+
import their ``setup`` function from ``distutils.core`` rather than
336+
``setuptools``. This is a legacy approach that installers support
337+
for backwards compatibility purposes [1]_, but using the legacy ``distutils`` API
338+
directly in new projects is strongly discouraged, since ``distutils`` is
339+
deprecated as per :pep:`632` and will be removed from the standard library
340+
in Python 3.12.
341+
332342
Creating README.md
333343
------------------
334344

@@ -624,3 +634,14 @@ some things you can do:
624634
* Read about :doc:`/guides/packaging-binary-extensions`.
625635
* Consider alternatives to :ref:`setuptools` such as :ref:`flit`, :ref:`hatch`,
626636
and :ref:`poetry`.
637+
638+
----
639+
640+
.. [1] Some legacy Python environments may not have ``setuptools``
641+
pre-installed, and the operators of those environments may still be
642+
requiring users to install packages by running ``setup.py install``
643+
commands, rather than providing an installer like ``pip`` that
644+
automatically installs required build dependendencies. These
645+
environments will not be able to use many published packages until the
646+
environment is updated to provide an up to date Python package
647+
installation client (e.g. by running ``python -m ensurepip``).

0 commit comments

Comments
 (0)