Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
cdf8524e
Commit
cdf8524e
authored
May 20, 2020
by
alvyjudy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: made quickstart pkg section declarative
WIP
parent
04dbe6f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
docs/userguide/quickstart.txt
docs/userguide/quickstart.txt
+17
-12
No files found.
docs/userguide/quickstart.txt
View file @
cdf8524e
...
@@ -81,21 +81,26 @@ Automatic package discovery
...
@@ -81,21 +81,26 @@ Automatic package discovery
For simple projects, it's usually easy enough to manually add packages to
For simple projects, it's usually easy enough to manually add packages to
the ``packages`` keyword in ``setup.cfg``. However, for very large projects
the ``packages`` keyword in ``setup.cfg``. However, for very large projects
, it can be a big burden to keep the package list updated. ``setuptools``
, it can be a big burden to keep the package list updated. ``setuptools``
therefore provides tools to ease the burden.
therefore provides two convenient tools to ease the burden: ``find: `` and
``find_namespace: ``. To use it in your project:
``find_packages()`` takes a source directory and two lists of package name
.. code-block:: ini
patterns to exclude and include. It then walks the target directory, filtering
by inclusion patterns, and return a list of Python packages (any directory).
Finally, exclusion patterns are applied to remove matching packages.
For example::
[options]
#...
packages = find:
from setuptools import find_packages()
setup(
[options.packages.find] #optional
#...,
where="."
packages = find_packages()
include=['pkg1', 'pkg2']
)
exclude=['pkg3', 'pkg4']]
When you pass the above information, alongside other necessary ones,
``setuptools`` walks through the directory specified in ``where`` (default to
current directory) and filters the packages
it can find following the ``include`` (default to none), then remove
those that match the ``exclude`` and return a list of Python packages. Note
that each entry in the ``[options.packages.find]`` is optional.
For more details and advanced use, go to :ref:`package_discovery`
For more details and advanced use, go to :ref:`package_discovery`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment