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.

Docs: Specify the types of requirement pip supports (internal details)

See original GitHub issue

What’s the problem this feature will solve? At the moment, there are a lot of subtle edge cases in what pip will accept as a “requirement” that are not well documented and/or are special cased in the code. There are a lot of adhoc terms (e.g., “direct requirement” and “unnamed requirement”) used in the code, and it is sometimes difficult to track down precise meanings.

Describe the solution you’d like Ideally, there should be a section in the documentation (or somewhere) that classifies all of the various “types” of thing that pip can be asked to install, and how they map to specific “requirement types” - part of the goal here should be to establish more consistent terminology, and have a central place where these terms are explained.

As noted above, terms like “direct requirement” and “unnamed requirement” would be good examples of terms that need clarification. Also, adding more clarity around how the requirement types pip handles map back to PEP 440 concepts would make it easier to reason about pip’s standards compliance.

Alternative Solutions Continue to document such details in the code, and/or infer behaviour from the code.

Additional context When building the new resolver, the interface will necessarily be based around passing a set of requirements from pip to the resolver. At the moment, a pip RequirementSet contains a lot of internal specifics, which would not make sense to include in an API that could be passed to a general resolver. Ideally the resolver API could be specified purely in terms of PEP 440 concepts (specifiers of the form NAME OP VERSION and direct references, NAME @ URL), but to do that we would need a clear mapping between pip’s concepts and the PEP’s.

This issue is intended as a place for discussion on how to model pip’s idea of requirements in a standards-compliant way.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
pfmoorecommented, Jan 13, 2020

Hmm, checking up on ResolveLib, which was on my TODO list of things to read up on, it looks like it fleshes out some of these abstractions already.

2reactions
pfmoorecommented, Jan 13, 2020

IMO if the source code is aligned with that model then it will be essentially self-documenting

Well, we should include the graph in our docs somewhere, at least - if only to help out people like me who can’t hold the full object graph in our heads 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requirements File Format - pip documentation v22.3.1
The requirements file format is closely tied to a number of internal details of pip (e.g., pip's command line options). The basic format...
Read more >
pip install — pip 10.0.0.dev0 documentation
pip supports installing from a package index using a requirement specifier. Generally speaking, a requirement specifier is composed of a project name followed ......
Read more >
Using Python's pip to Manage Your Projects' Dependencies
By default, pip uses PyPI to look for packages. But pip also gives you the option to define a custom package index. Using...
Read more >
Specifying dependencies in Python | Cloud Functions ...
There are two ways to specify dependencies for Cloud Functions written in Python: using the pip package manager's requirements.txt file or packaging local ......
Read more >
pip Documentation - Read the Docs
Each line of the requirements file indicates something to be installed, and like arguments to pip install, the following forms are supported ......
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