Document how to use setup.cfg with find_packages and the src layout
See original GitHub issueWhen trying to create an MWE for #1436, I found it very hard to find the right syntax for using the src
layout from setup.cfg
. Here’s what I landed on:
[options]
package_dir=
=src
packages=find:
where=src
It would be nice to see this in the documentation somewhere as it’s a pretty common layout (and I daresay probably should be the preferred layout).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Package Discovery and Namespace Packages - Setuptools
cfg ), find_namespace_packages() (setup.py) and find (pyproject.toml) will scan all folders that you have in your project directory if you use a flat-layout....
Read more >python setuptools setup.cfg: Including main- and subpackages ...
Using the directory layout in your example, I found a couple configurations that worked. Both of these allowed me to import all modules...
Read more >Package Discovery and Namespace Package
To use it, consider the following directory. mypkg/ src/ pkg1/__init__.py pkg2/__init__.py additional/__init__.py setup.cfg #or setup.py.
Read more >Using Package Data in Python Projects with Setuptools
Including Package Data via setup.py/setup.cfg ... MANIFEST.in command “graft packagename” (or “graft src” if you're using a src/ layout).
Read more >python packaging: basic setup.py and declarative ... - YouTube
today I go over a basic setup.py for packaging a python package. I then show a few tools you can use to migrate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got it, setup.cfg must look like this:
This also works with pip 10.0.1 and setuptools 39.0.1.
Next stop: putting in a piece of documentation somewhere.