Skip to content

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

Open
@DanielHabenicht

Description

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

Metadata

Assignees

No one assigned

    Labels

    area/build-systemRelated to PEP 517 packaging (see poetry-core)kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions