Skip to content
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

poetry build gets slower the more files are in the project directory #7644

Open
3 of 4 tasks
DanielHabenicht opened this issue Mar 13, 2023 · 3 comments
Open
3 of 4 tasks
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@DanielHabenicht
Copy link

DanielHabenicht commented Mar 13, 2023

Poetry
Version: 1.4.0
Python:  3.10.4

Virtualenv
Python:         3.10.4
Implementation: CPython
Path:           /home/codespace/.cache/pypoetry/virtualenvs/example-p6HmNsBj-py3.10
Executable:     /home/codespace/.cache/pypoetry/virtualenvs/example-p6HmNsBj-py3.10/bin/python
Valid:          True

System
Platform:   linux
OS:         posix
Python:     3.10.4
Path:       /usr/local/python/3.10.4
Executable: /usr/local/python/3.10.4/bin/python3.10
  • pyproject.toml: poetry new defaults
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

With an increasing amount of files inside a project folder (let's say 50 000+) poetry build takes increasingly more time, e.g.:

Building example (0.1.0)
  - Building sdist
<Waiting for a few minutes>
  - Built example -0.1.0.tar.gz
  - Building wheel
  - Built example -0.1.0-py3-none-any.whl

I also found an issue from somebody on Stackoverflow, they reference a real world scenario of using node_modules somewhere in the project dir.

I know it is a real edge-case but it would still be nice if exluded files would not be considered at all.

Here is a short reproduction:

pip install poetry
poetry new example
cd example
mkdir folder
cd folder
for i in {1..70000}; do
  mkdir s"$i"
  touch s"$i"/file1.file
  touch s"$i"/file2.file
  touch s"$i"/file3.file
done

image

It just shows a small delay on my screenshot, but I have a real project where the delay is much more pronounced.

Using exclude = ["folder"] takes no effect on the speed of the build.

Just for my reference: https://github.com/DanielHabenicht/bug.poetry

@DanielHabenicht DanielHabenicht added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Mar 13, 2023
@dimbleby
Copy link
Contributor

dimbleby commented Mar 13, 2023

related python-poetry/poetry-core#499

(though I'd suggest that having 70,000210,000 files in your python project that actually aren't part of your python project might be best avoided!)

@DanielHabenicht
Copy link
Author

related python-poetry/poetry-core#499

(though I'd suggest that having 70,000210,000 files in your python project that actually aren't part of your python project might be best avoided!)

Yes, I can only second that. But sometimes one is generating a lot of test data and things accumulate™.
Nice that there is already a PR for this.

@rmarquis
Copy link

rmarquis commented Aug 9, 2023

Yes, I can only second that. But sometimes one is generating a lot of test data and things accumulate™.

This is actually our use case. This would be more of a convenient fix than something absolutely critical, but it would be nice to see the related PR reviewed.

@Secrus Secrus added the area/build-system Related to PEP 517 packaging (see poetry-core) label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants