From d011cd989c1d3d5906f2bffb8d68a9da88cab120 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Sat, 27 Oct 2018 15:40:30 +0100 Subject: Document using setup.cfg for src-layouts --- docs/setuptools.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'docs') diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 46103b25..3cde56ea 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -2400,6 +2400,34 @@ Metadata and options are set in the config sections of the same name. * Unknown keys are ignored. +Using a ``src/`` layout (storing packages in a subdirectory) +============================================================ + +If you use a `src` layout, as in, you package structure looks like this:: + + ├── src + │   └── mypackage + │   ├── __init__.py + │   └── mod1.py + ├── setup.py + └── setup.cfg + +You can set up your ``setup.cfg`` to automatically look up all your packages in +the subdirectory like this: + +.. code-block:: ini + + # This example contains just the necessary options for a src-layout, set up + # the rest of the file as described above. + + [options] + package_dir= + =src + packages=find: + + [options.packages.find] + where=src + Specifying values ================= -- cgit v1.2.1 From 7d129e6ba46ee01c25d6e6b463ec7df29e624670 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Sat, 27 Oct 2018 15:44:24 +0100 Subject: Correct typo --- docs/setuptools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 3cde56ea..f3a5f4ff 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -2403,7 +2403,7 @@ Metadata and options are set in the config sections of the same name. Using a ``src/`` layout (storing packages in a subdirectory) ============================================================ -If you use a `src` layout, as in, you package structure looks like this:: +If you use a ``src/`` layout, as in, you package structure looks like this:: ├── src │   └── mypackage -- cgit v1.2.1 From 009e0a92b463d444e48c17a3a636fc7c477dec71 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Sun, 28 Oct 2018 11:02:13 +0000 Subject: Edit wording --- docs/setuptools.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/setuptools.txt b/docs/setuptools.txt index f3a5f4ff..ae8a2eb7 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -2400,10 +2400,11 @@ Metadata and options are set in the config sections of the same name. * Unknown keys are ignored. -Using a ``src/`` layout (storing packages in a subdirectory) -============================================================ +Using a ``src/`` layout +======================= -If you use a ``src/`` layout, as in, you package structure looks like this:: +One commonly used package configuration has all the module source code in a +subdirectory (often called the ``src/`` layout), like this:: ├── src │   └── mypackage @@ -2412,7 +2413,7 @@ If you use a ``src/`` layout, as in, you package structure looks like this:: ├── setup.py └── setup.cfg -You can set up your ``setup.cfg`` to automatically look up all your packages in +You can set up your ``setup.cfg`` to automatically find all your packages in the subdirectory like this: .. code-block:: ini -- cgit v1.2.1