diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-07-04 13:34:58 +0100 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-07-04 13:34:58 +0100 |
commit | 618f4ef94730b0d1756271a12b5ff7ea9f2beb16 (patch) | |
tree | cf8206194cc3c426dd4e403269d477f32d0fd675 /docs | |
parent | 233c986f690a1f1bef222dd6f7fad803c4f41a6d (diff) | |
parent | 03b06eef123cbbf22e21d1e7cb06a9c7503313bb (diff) | |
download | python-setuptools-git-618f4ef94730b0d1756271a12b5ff7ea9f2beb16.tar.gz |
Merge 'upstream/main' into feature/pep660
Diffstat (limited to 'docs')
-rw-r--r-- | docs/userguide/index.rst | 2 | ||||
-rw-r--r-- | docs/userguide/package_discovery.rst | 27 |
2 files changed, 12 insertions, 17 deletions
diff --git a/docs/userguide/index.rst b/docs/userguide/index.rst index e1563c91..d631c5d8 100644 --- a/docs/userguide/index.rst +++ b/docs/userguide/index.rst @@ -12,7 +12,7 @@ This document contains information to help Python developers through this process. Please check the :doc:`/userguide/quickstart` for an overview of the workflow. -Also note that ``setuptools`` is what is know in the community as :pep:`build +Also note that ``setuptools`` is what is known in the community as :pep:`build backend <517#terminology-and-goals>`, user facing interfaces are provided by tools such as :pypi:`pip` and :pypi:`build`. To use ``setuptools``, one must explicitly create a ``pyproject.toml`` file as described :doc:`/build_meta`. diff --git a/docs/userguide/package_discovery.rst b/docs/userguide/package_discovery.rst index 93419a24..2efc62b9 100644 --- a/docs/userguide/package_discovery.rst +++ b/docs/userguide/package_discovery.rst @@ -156,8 +156,7 @@ all modules and packages meant for distribution are placed inside this directory:: project_root_directory - ├── pyproject.toml - ├── setup.cfg # or setup.py + ├── pyproject.toml # AND/OR setup.cfg, setup.py ├── ... └── src/ └── mypkg/ @@ -190,8 +189,7 @@ flat-layout The package folder(s) are placed directly under the project root:: project_root_directory - ├── pyproject.toml - ├── setup.cfg # or setup.py + ├── pyproject.toml # AND/OR setup.cfg, setup.py ├── ... └── mypkg/ ├── __init__.py @@ -240,8 +238,7 @@ A standalone module is placed directly under the project root, instead of inside a package folder:: project_root_directory - ├── pyproject.toml - ├── setup.cfg # or setup.py + ├── pyproject.toml # AND/OR setup.cfg, setup.py ├── ... └── single_file_lib.py @@ -293,7 +290,7 @@ then returns a list of ``str`` representing the packages it could find. To use it, consider the following directory:: mypkg - ├── setup.cfg # and/or setup.py, pyproject.toml + ├── pyproject.toml # AND/OR setup.cfg, setup.py └── src ├── pkg1 │ └── __init__.py @@ -320,7 +317,7 @@ in ``src`` that start with the name ``pkg`` and not ``additional``: [options.packages.find] where = src include = pkg* - exclude = additional + # alternatively: `exclude = additional*` .. note:: ``pkg`` does not contain an ``__init__.py`` file, therefore @@ -334,8 +331,7 @@ in ``src`` that start with the name ``pkg`` and not ``additional``: # ... packages=find_packages( where='src', - include=['pkg*'], - exclude=['additional'], + include=['pkg*'], # alternatively: `exclude=['additional*']` ), package_dir={"": "src"} # ... @@ -353,8 +349,7 @@ in ``src`` that start with the name ``pkg`` and not ``additional``: [tool.setuptools.packages.find] where = ["src"] - include = ["pkg*"] - exclude = ["additional"] + include = ["pkg*"] # alternatively: `exclude = ["additional*"]` namespaces = false .. note:: @@ -412,7 +407,7 @@ Now, suppose you decide to package the ``foo`` part for distribution and start by creating a project directory organized as follows:: foo - ├── setup.cfg # and/or setup.py, pyproject.toml + ├── pyproject.toml # AND/OR setup.cfg, setup.py └── src └── timmins └── foo @@ -517,7 +512,7 @@ to `PEP 420 <https://www.python.org/dev/peps/pep-0420/>`_. It used to be more cumbersome to accomplish the same result. Historically, there were two methods to create namespace packages. One is the ``pkg_resources`` style supported by ``setuptools`` and the other one being ``pkgutils`` style offered by -``pkgutils`` module in Python. Both are now considered deprecated despite the +``pkgutils`` module in Python. Both are now considered *deprecated* despite the fact they still linger in many existing packages. These two differ in many subtle yet significant aspects and you can find out more on `Python packaging user guide <https://packaging.python.org/guides/packaging-namespace-packages/>`_. @@ -557,7 +552,7 @@ And your directory should look like this .. code-block:: bash foo - ├── setup.cfg # and/or setup.py, pyproject.toml + ├── pyproject.toml # AND/OR setup.cfg, setup.py └── src └── timmins ├── __init__.py @@ -577,7 +572,7 @@ file contains the following: __path__ = __import__('pkgutil').extend_path(__path__, __name__) -The project layout remains the same and ``setup.cfg`` remains the same. +The project layout remains the same and ``pyproject.toml/setup.cfg`` remains the same. ---- |