-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building sdist is slow with wide exclude pattern #603
Labels
area/build-system
Related to PEP 517 packaging (see poetry-core)
kind/bug
Something isn't working as expected
Comments
Lothiraldan
added a commit
to Lothiraldan/poetry
that referenced
this issue
Nov 6, 2018
Before we build a potentially very big list of all the excluded file matching every exclude pattern, which could be a lot and then do a containment check on the resulting list. A first step to speed up the process is to returns a set instead of a list so containment checks will not be dependent to the number of matching files anymore. If the set still ends up being too large, introducing an intermediary solution that check if a file name match a glob pattern instead of expanding the glob pattern might be a good solution. Right now, it seems overkill in comparison of this patch. With this patch, building my project that exclude `nodes_modules/**/*` went from 4 minutes to 7 seconds. Fix python-poetry#603
sdispater
pushed a commit
that referenced
this issue
Nov 8, 2018
Before we build a potentially very big list of all the excluded file matching every exclude pattern, which could be a lot and then do a containment check on the resulting list. A first step to speed up the process is to returns a set instead of a list so containment checks will not be dependent to the number of matching files anymore. If the set still ends up being too large, introducing an intermediary solution that check if a file name match a glob pattern instead of expanding the glob pattern might be a good solution. Right now, it seems overkill in comparison of this patch. With this patch, building my project that exclude `nodes_modules/**/*` went from 4 minutes to 7 seconds. Fix #603
Just for information, commit cb79ffb further improve performances |
Cool! I will make sure to test it against my package! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area/build-system
Related to PEP 517 packaging (see poetry-core)
kind/bug
Something isn't working as expected
Issue
I'm working on a project with the following
pyproject.toml
: https://gist.github.com/Lothiraldan/2c0b5ce0171e8450490e3b493e7c2960 and I want to ship a React project inside my package.Include and exclude are working great, far easier to configure than
MANIFEST.IN
IMHO.My issue is that the builder code is walking all of the directories and for each file check that it's not in the excluded list. One of my exclude pattern is
"balto/web_interfaces/balto_react/node_modules/**/*"
which generates a lot of matching files. The length of the excluded file list is28761
in my case.This makes the following line https://github.com/sdispater/poetry/blob/master/poetry/masonry/builders/sdist.py#L281 quite slow. A build takes about 4 minutes on my laptop.
Here is a
py-spy
dump of the process:I have some ideas about how to make it faster, I will send some patches if that's okay.
The text was updated successfully, but these errors were encountered: