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 install takes too long and installs the package again unnecessarily #730

Closed
1 task done
Alexspayne opened this issue Dec 11, 2018 · 7 comments · Fixed by #2360
Closed
1 task done

Poetry install takes too long and installs the package again unnecessarily #730

Alexspayne opened this issue Dec 11, 2018 · 7 comments · Fixed by #2360
Labels
area/cli Related to the command line area/installer Related to the dependency installer kind/feature Feature requests/implementations
Milestone

Comments

@Alexspayne
Copy link

  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

I'm wondering why it takes 13-30 seconds to install my package (on two different machines).
This occurs when the package and it's dependencies are already installed.
`$ time poetry install -vvv
Using virtualenv: /Users/apayne/Envs/smithers
Installing dependencies from lock file

Nothing to install or update

  • Skipping markupsafe (1.1.0) Already installed
  • Skipping click (7.0) Already installed
  • Skipping itsdangerous (1.1.0) Already installed
  • Skipping jinja2 (2.10) Already installed
  • Skipping werkzeug (0.14.1) Already installed
  • Skipping aniso8601 (4.0.1) Already installed
  • Skipping flask (1.0.2) Already installed
  • Skipping jsonschema (2.6.0) Already installed
  • Skipping pytz (2018.7) Already installed
  • Skipping six (1.11.0) Already installed
  • Skipping flask-restplus (0.12.1) Already installed
  • Skipping passlib (1.7.1) Already installed
  • Skipping peewee (3.7.1) Already installed
  • Installing smithers (0.1.0)

real 0m29.542s
user 0m5.344s
sys 0m2.370s`

Smithers is the name of the package I'm installing with poetry. The installing smithers step takes the majority of the time. Is poetry doing anything but creating a symlink? I don't understand why this should take so long. If the package is already installed in editable mode, why does poetry try installing it again?

Much thanks!

@sdispater
Copy link
Member

The install command installs the current project in editable mode by internally creating a temporary setup.py file and executing pip install -e .. It does it each time install is executed to ensure that any new elements like entrypoints are properly installed.

I plan on adding an option to install to disable the installation of the current project.

@digitalresistor
Copy link
Contributor

@sdispater is there any reason for the use of a setup.py instead of creating the appropriate directory structure/updating the virtual env directly?

If there is a better ticket to mention this in, please let me know.

@sdispater
Copy link
Member

@bertjwregeer For pure python projects, we could do without the setup.py file. This would require creating the proper files and directories which are, as far as I know, an easy_install.pth in the site-packages directory of the virtualenv and the {project}.egg-info directory in the current directory project.

This is not possible however for packages with C extensions for instance. Poetry does not come with a compiler and as such has to rely on the setup.py file.

@digitalresistor
Copy link
Contributor

The current "hack" for Poetry to do C extensions is to add extra content to the setup.py that is generated, correct? If it can be detected when that is the case and only then do the setup.py way, that would be fantastic.

Building plugins to allow building Cython/C extensions for poetry would be even better, but that can come later.

@Alexspayne
Copy link
Author

My current workaround is to use the --dry-run argument as a default in my build script for development. I just override that argument when I actually want it to poetry install.

@sdispater
Copy link
Member

@bertjwregeer This is one way to go, yes, and an easy one. I can probably target that for the 1.0.0 release.

@sdispater sdispater added area/cli Related to the command line area/installer Related to the dependency installer kind/feature Feature requests/implementations labels Dec 15, 2018
@sdispater sdispater added this to the 1.0 milestone Dec 15, 2018
@sdispater sdispater modified the milestones: 1.0, Future Nov 19, 2019
@abn abn modified the milestones: Future, 1.1 Apr 29, 2020
@abn abn closed this as completed Apr 29, 2020
@abn abn linked a pull request Apr 29, 2020 that will close this issue
2 tasks
Copy link

github-actions bot commented Mar 3, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli Related to the command line area/installer Related to the dependency installer kind/feature Feature requests/implementations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants