Open Zearin opened 8 years ago
(Edit: Added link to #12 for steps to reproduce.)
I just figured out that the issue is not include=[…]
, but rather the presence of a comma for either include
or exclude
.
So include=['cucumber']
works, but include=['cucumber', 'anything_else']
fails.
I don't think it's the ,
that's breaking this. find_packages is recursive in nature... I made another package inside the src directory and that seemed to work fine. (for your example mkdir anything_else && touch anything_else/__init__.py
)
I don't think it's the , that's breaking this. find_packages is recursive in nature...
Huh. I am unsure the issue is, then…
The reason I assumed it was a comment is because I originally had include=['cucumber', 'cucumber.*']
, but removing the second item resulted in no error.
For reference, the setuptools docs for find_packages
says:
Inclusion and exclusion patterns are package names, optionally including wildcards. For example,
find_packages(exclude=["*.tests"])
will exclude all packages whose last name part istests
. Or,find_packages(exclude=["*.tests", "*.tests.*"])
will also exclude any subpackages of packages namedtests
, but it still won’t exclude a top-leveltests
package or the children thereof. In fact, if you really want notests
packages at all, you’ll need something like this:
find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
Although I don’t really need cucumber.*
at the moment, I plan on restructuring the package hierarchy such that I will need it in the future.
(I was just learning how the hell setuptools decides which files to include or exclude, and messing around with pypackage.meta
until I figured out what’s what. I got the error and decided to report it here. I thought
When I got an error, I checked the official docs on find_packages
, and it looks like the arguments should be legal, so I decided to report this issue. I was excited when I thought I had found the cause of the error…but apparently not. (I’ve been staring at my screen too long. :P)
I just noticed:
exclude
, but So the dot (.
) is being replaced with os.sep
. If that’s happening right before printing the error, then I don’t think it’s the problem; but if it’s happening when parsing pypackage.meta
, perhaps that might be the cause…?
from reading the include docs, it makes me think it has more to do with the /
, since it uses fnmatch
In my
pypackage.meta
:When I run
py-build
, I get the following error:I realize that
exclude=[…]
is the more common kwarg tofind_packages
. However, according to the setuptools documentation “Usingfind_packages
”, thefind_packages
function accepts a starting dir, and “two lists of package name patterns to exclude and include”.(You can reproduce this bug using the same steps as described in #12. ☻ )