Skip to content

Commit

Permalink
docs(package-discovery): improve consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
mkniewallner committed Jan 1, 2025
1 parent 9cd4247 commit 1d5ea90
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/userguide/package_discovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Package Discovery and Namespace Packages
========================================

.. note::
a full specification for the keywords supplied to ``setup.cfg`` or
``setup.py`` can be found at :doc:`keywords reference </references/keywords>`
A full specification for the keywords supplied to ``setup.cfg`` or
``setup.py`` can be found at :doc:`keywords reference </references/keywords>`.

.. important::
The examples provided here are only to demonstrate the functionality
Expand Down Expand Up @@ -45,7 +45,7 @@ Normally, you would specify the packages to be included manually in the followin
setup(
# ...
packages=['mypkg', 'mypkg.subpkg1', 'mypkg.subpkg2']
packages=["mypkg", "mypkg.subpkg1", "mypkg.subpkg2"]
)
Expand Down Expand Up @@ -268,15 +268,15 @@ the provided tools for package discovery:
[options]
packages = find:
#or
# OR
packages = find_namespace:
.. tab:: setup.py

.. code-block:: python
from setuptools import find_packages
# or
# OR
from setuptools import find_namespace_packages
Expand Down Expand Up @@ -327,7 +327,7 @@ in ``src`` that start with the name ``pkg`` and not ``additional``:
[options]
packages = find:
package_dir =
=src
= src
[options.packages.find]
where = src
Expand All @@ -345,8 +345,8 @@ in ``src`` that start with the name ``pkg`` and not ``additional``:
setup(
# ...
packages=find_packages(
where='src',
include=['pkg*'], # alternatively: `exclude=['additional*']`
where="src",
include=["pkg*"], # alternatively: `exclude=["additional*"]`
),
package_dir={"": "src"}
# ...
Expand Down Expand Up @@ -431,7 +431,7 @@ distribution, then you will need to specify:
[options]
package_dir =
=src
= src
packages = find_namespace:
[options.packages.find]
Expand All @@ -450,7 +450,7 @@ distribution, then you will need to specify:
setup(
# ...
packages=find_namespace_packages(where='src'),
packages=find_namespace_packages(where="src"),
package_dir={"": "src"}
# ...
)
Expand Down Expand Up @@ -542,7 +542,7 @@ And the ``namespace_packages`` keyword in your ``setup.cfg`` or ``setup.py``:
setup(
# ...
namespace_packages=['timmins']
namespace_packages=["timmins"]
)
And your directory should look like this
Expand All @@ -568,7 +568,7 @@ file contains the following:

.. code-block:: python
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
The project layout remains the same and ``pyproject.toml/setup.cfg`` remains the same.

Expand Down

0 comments on commit 1d5ea90

Please sign in to comment.