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

前端 未结 4 2017
孤街浪徒
孤街浪徒 2020-12-13 16:29

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 setup.p

4条回答
  •  庸人自扰
    2020-12-13 16:46

    I haven't figured out how to reference this from setup.py 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.

    requires.txt:

    -e hg+file:///home/me/my-private-project#egg=myproject
    -e hg+http://bitbucket.org/ianb/webob@tip#egg=WebOb
    -e svn+http://svn.sqlalchemy.org/sqlalchemy/trunk@6638#egg=SQLAlchemy
    -e svn+http://svn.zope.org/repos/main/z3c.saconfig/trunk@106508#egg=z3c.saconfig
    ## The following requirements were added by pip --freeze:
    APScheduler==1.01
    simplejson==2.0.9
    ... (many more)
    

提交回复
热议问题