如何将私有 Python 包列为 Conda 要求?
How to a list private Python packages as Conda requirement?
我需要创建和发送 conda
envs 来列出需要保持私有的包。使用 URL 列出对(公司内部)GitLab 实例的依赖关系会特别方便。
有没有办法使用 repo URL 向 conda
注册依赖项?还有其他方法可以包含 Python 包,您有源代码分发,但不能在常规频道上托管吗?
谢谢。
如果你事先知道什么需要保留私人船舶直接参考鸡蛋,或使用分区 index-urls
,和 extra-index-urls
,或在 conda-meta 中,如 here :
# requirements.txt
gevent
publicthing==1.2
someother==0.1
# private packages
file://package/egg/here
-e git+ssh://priv.gitlab.some.org/some/privpack.git#egg=privpack
--extra-index-url https://build.priv.gitlab.some.org/some/pypi/simple
我猜这里的 private 意味着 sdist/dist 构建像 tars、egg、wheels 这样的工件,有些 URI/URL 只能在本地网络上访问。
比如包的托管位置应该足以将某些东西标记为 "private"。就像构建工件是可用的,或者它们不是通过某种可用性机制。 (网络位置、本地构建、发布的二进制文件等)
使用 pypi/pip.
conda 元构建信息:
source:
- url: https://build.priv.gitlab.some.org/some/pypi/simple/privpack/a.tar.bz2
folder: stuff
- url: https://build.priv.gitlab.some.org/some/pypi/simple/privpack/b.tar.bz2
folder: stuff
示例:
- https://github.com/conda/conda-recipes
- https://github.com/conda/conda-recipes/blob/c2eb600f8545cd21aa9e50a8bb8a81df7fd3c915/r-packages/r-yaml/meta.yaml#L10
- https://github.com/conda/conda-recipes/blob/a796713805ac8eceed191c0cb475b51f4d00718c/python/pyserial/meta.yaml#L5
- https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#source-from-git
- https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#source-from-a-local-path
相关:
- https://docs.anaconda.com/anaconda-repository/admin-guide/install/config/config-client#kerberos-configuration
- https://docs.anaconda.com/anaconda-repository/admin-guide/install/config/kerberos-example
- https://docs.anaconda.com/anaconda-repository/admin-guide/install/config/config-client#pip-configuration
- https://pip.readthedocs.io/en/1.1/requirements.html#git
我需要创建和发送 conda
envs 来列出需要保持私有的包。使用 URL 列出对(公司内部)GitLab 实例的依赖关系会特别方便。
有没有办法使用 repo URL 向 conda
注册依赖项?还有其他方法可以包含 Python 包,您有源代码分发,但不能在常规频道上托管吗?
谢谢。
如果你事先知道什么需要保留私人船舶直接参考鸡蛋,或使用分区 index-urls
,和 extra-index-urls
,或在 conda-meta 中,如 here :
# requirements.txt
gevent
publicthing==1.2
someother==0.1
# private packages
file://package/egg/here
-e git+ssh://priv.gitlab.some.org/some/privpack.git#egg=privpack
--extra-index-url https://build.priv.gitlab.some.org/some/pypi/simple
我猜这里的 private 意味着 sdist/dist 构建像 tars、egg、wheels 这样的工件,有些 URI/URL 只能在本地网络上访问。
比如包的托管位置应该足以将某些东西标记为 "private"。就像构建工件是可用的,或者它们不是通过某种可用性机制。 (网络位置、本地构建、发布的二进制文件等)
使用 pypi/pip.
conda 元构建信息:
source:
- url: https://build.priv.gitlab.some.org/some/pypi/simple/privpack/a.tar.bz2
folder: stuff
- url: https://build.priv.gitlab.some.org/some/pypi/simple/privpack/b.tar.bz2
folder: stuff
示例:
- https://github.com/conda/conda-recipes
- https://github.com/conda/conda-recipes/blob/c2eb600f8545cd21aa9e50a8bb8a81df7fd3c915/r-packages/r-yaml/meta.yaml#L10
- https://github.com/conda/conda-recipes/blob/a796713805ac8eceed191c0cb475b51f4d00718c/python/pyserial/meta.yaml#L5
- https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#source-from-git
- https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#source-from-a-local-path
相关:
- https://docs.anaconda.com/anaconda-repository/admin-guide/install/config/config-client#kerberos-configuration
- https://docs.anaconda.com/anaconda-repository/admin-guide/install/config/kerberos-example
- https://docs.anaconda.com/anaconda-repository/admin-guide/install/config/config-client#pip-configuration
- https://pip.readthedocs.io/en/1.1/requirements.html#git