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

Add ability to specify package sources that are not scanned/used by default #4035

Closed
2 tasks done
jgentil opened this issue May 4, 2021 · 6 comments
Closed
2 tasks done
Labels
status/duplicate Duplicate issues

Comments

@jgentil
Copy link

jgentil commented May 4, 2021

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

Feature Request

When specifying additional sources in pyproject.toml as "secondary", the current behavior of Poetry is to include this source in all of it's scans for dependency resolution for adding or installing packages. This is almost entirely unnecessary in many cases, as a secondary source is normally only needed to install very specific packages and would not normally host any other packages from pypi (and if they do, it's likely not "secondary" then but "default".)

Since this behavior is already defined, I'd like to propose a third option, targeted which specifies that a source should be used only if a dependency definition explicitly specifies it in it's source parameter. That package's dependencies would be scanned from that repository, but it would be otherwise ignored.

One specific reason that this is desperately needed is that in several of my corporate projects, we use Azure DevOps artifacts system private PyPI. This system is notoriously slow and a small project's dependency resolution scan take upwards of 10 minutes with Poetry scanning it for every single project dependency. To mitigate this, we currently force source="pypi" in all dependency specifications to target it specifically.

@jgentil jgentil added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels May 4, 2021
@zevisert
Copy link

+1 for this!

Adding fuel to the fire, I can view the access log for my private package repository -- and poetry always scans [{tool.poetry.source = { default=false, secondary=true }] sources for all transitive dependencies, even if we use your source="pypi" mitigation.

I tested with a project that has no private dependencies, and by adding a new source, but without changing dependencies at all the poetry update time went from 0.32 to over 200 seconds!

@zevisert
Copy link

With transitive dependencies in mind, the only way I can think to address this is with your suggestion for a targeted or alike key in the tool.poetry.source table.

@zevisert
Copy link

zevisert commented Oct 7, 2021

I'd really love to move this feature forward! Every time I need to update packages at work I have to sit there watching poetry 1.1.11 take 300+ seconds in most of our projects to resolve dependencies is annoying when I think I have a PR I have can do it in less than 15..

I just heard about @python-poetry/triage Hi! 👋

@IWillPull
Copy link

I'm also experiencing it and having builds take 30+ minutes longer when using one secondary dependency sounds more like a bug, not a feature request.

@dimbleby
Copy link
Contributor

this should be absorbed into #6713

@neersighted neersighted added status/duplicate Duplicate issues and removed kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Oct 23, 2022
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2022
Copy link

github-actions bot commented Mar 1, 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 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants