snakebasket | A smarter , recursive pip | Cryptography library
kandi X-RAY | snakebasket Summary
kandi X-RAY | snakebasket Summary
At Prezi, Python applications make up a large portion of our web infrastructure. From our early beginnings, we have grown with Python as our primary language for web projects. We have seen many advantages and pitfalls of both the Python ecosystem and the language itself. To avoid some of the pitfalls, we write internal tools to support our Python development and ensure that we remain productive when working with our fast-growing codebase. snakebasket is one of those tools.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Run install command
- Prepare the files to install
- Add install requirement
- Install a requirements file
- Set options
- Build the tarbz file
- Build a single virtualenv
- Compress the virtualenv
- Run a virtualenv
- Gets the source requirement for a given dist
- Return a dict of tag_revs
- Dereference a revision from a git repository
- Install pip patches
snakebasket Key Features
snakebasket Examples and Code Snippets
Community Discussions
Trending Discussions on snakebasket
QUESTION
I’m having difficulties understanding and implementing a few details of Python packaging using pip
and setuptools
.
Suppose I have three projects, A
and B
and C
each of which is its own package and hosted in its own code repo. They also depend on each other, i.e. A
is imported by B
, and B
is imported by C
. Each package has a set of direct dependencies (i.e. directly imported other packages) and a set of indirect dependencies (i.e. packages imported by the directly dependent packages). These dependencies are a graph, not a tree.
For package A
, should setup.py contain only the directly dependent packages? Same for package B
? When I then pip install C
I noticed that B
gets installed, but not A
. I suppose that is because A
is an indirect dependency for C
.
I don’t really like the idea of storing a pip freeze
in each package (inflexible and conflicts loom), but it seems that pip
does not resolve the dependency graph recursively (see here). The snakebasket
project attempted to address that problem, but is stale now; the dependency-links option has been deprecated.
What is the proper and recommended way of handling this?
Addendum I forgot to mention that none of the packages (A
, B
, C
) are available through the official PyPi repo, but live in private Github repos. Thus, for example B
’s setup.py contains
ANSWER
Answered 2019-Apr-26 at 18:36For package A, should
setup.py
contain only the directly dependent packages?
Yes. Separation of concerns: every package should list dependencies it requires. Subpackages should care for themselves.
When I then
pip install C
I noticed that B gets installed, but not A.
Can you show an example? I have a different experience.
it seems that pip does not resolve the dependency graph recursively (see here).
The answer from 2015 is outdated. pip install
and pip download
installs and downloads dependencies recursively.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install snakebasket
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page