Can a Python package depend on a specific version control revision of another Python package?


Some useful Python packages are broken on pypi, and the only acceptable version is a particular revision in a revision control system. Can that be expressed in e.g

requires = 'svn://[email protected]' ?

By : joeforker


You can release packages of specific versions, but you have to distribute them together. There is no way to automatically download them with standard Python.

However, you can use Buildout and create a buildout.cfg that makes it possible to replicate the environment. It can check out and install specific revisions if you use extensions like mr.developer.

If you really require an obscure version of another package, and there's no way to make do with other versions, you might want to simply distribute that version of the package with your own. If necessary put it in your own namespace to ensure that your version is the one that is used.

I haven't figured out how to reference this from but pip can check out specific revisions of Python packages with a simple requirements file. With a requirements file called requires.txt, pip install -r requires.txt will install all the packages listed in that file (and their dependencies).

Here is part of my requirements file. The lines starting with -e check out specific revisions of packages from version control (git, svn, or mercurial), including my project, and install them in an editable form. pip freeze lists all installed packages in this format.


-e hg file:///home/me/my-private-project#egg=myproject
-e hg[email protected]#egg=WebOb
-e svn[email protected]#egg=SQLAlchemy
-e svn[email protected]#egg=z3c.saconfig
## The following requirements were added by pip --freeze:
... (many more)
By : joeforker

This video can help you solving your question :)
By: admin