简体   繁体   中英

How to include projects in personal SCM repositories (not in pypi) to setup.py?

What's the idiomatic way to build python projects that depend on projects in other source control repositories (eg private projects not on pypi)?

Let's say I have a project foobar hosted at https://example.com/foobar.git and I want to include it in the setup.py of another project.

Is there something similar to maven's scm plugin, where I can specify something like Extension('foobar', scm='scm:git:https://example.com/foobar.git')

You can specify additional places to install dependencies from using the dependency_links option:

setup(
    ...
    dependency_links=[
        'git+https://example.com/spamneggs/foobar.git#egg=foobar-1.2.3'
    ]
    install_requires=[
        'foobar',
    ]
)

The dependency_links entry is used to find packages, and for SCM-stored packages the #egg=package-version fragment identifier lets tools know what package and what version will be found at that link.

See the "Dependencies that aren't in PyPI" chapter of the setuptools project documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM