question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Associate dependency with source

See original GitHub issue

I have two entries in my pyproject.toml of the following form.

dependencies = [
    ...
    "internal-package~=1.0",
]

[[tool.pdm.source]]
url = "https://gitlab.company.com/api/v4/projects/309/packages/pypi/simple"
verify_ssl = true
name = "custom-packages-1"

This possibly causes a name collision issue if somebody uploads a package called internal-package to pypi: (will pdm use the package from pypi or from my custom source? It also appears to slow down pdm, as I presume pdm is searching for requests, pandas etc. in my custom source instead of only on pypi.

Both of these issues could be solved if there were a way to associate a particular dependency with a particular source.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
frostmingcommented, Aug 16, 2021

@ElijahSink Unfortunately the former, pip fetches candidates from all indexes and sorts them together to get the best match. We already have a plan to implement our own package finder to replace pip’s. So let’s leave it for this release and do improvements in the future.

2reactions
pawamoycommented, Aug 10, 2021

Another mitigation for this dependency confusion issue is to follow some pattern for naming your internal packages, such as reducing the chances a public package uses the same name. Something like org-team-project-name. You’d have to keep this pattern and name private/hidden/secret of course (not public).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to better manage dependencies with artifact repositories
Learn how to automate key dependency management tasks by combining an artifact repository with the ActiveState Platform.
Read more >
Source Dependency - an overview | ScienceDirect Topics
The network dependency model accurately defines fine-grained dependencies between the various network components. Given that service nodes comprise agents and ...
Read more >
Aggregating Javadocs from Dependency Sources
Dependency-driven javadoc aggregation works by resolving the sources for included dependencies, then including these sources in the javadoc ...
Read more >
Difference between association and dependency?
A dependency typically (but not always) implies that an object accepts another object as a method parameter, instantiates, or uses another object.
Read more >
How to manage build dependencies - IBM
So there is an indirect build dependency between the program source and the ... the DependencyScanner checks to see whether the file is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found