如何从私有bitbucket-git存储库安装python包命名空间 [英] How to install python package namespace from private bitbucket-git repository

查看:67
本文介绍了如何从私有bitbucket-git存储库安装python包命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个相关项目,我认为它们非常适合Python的命名空间-包装.我当前正在运行python 3.8,并创建了以下目录结构进行测试.

I have several related projects that I think will be a good fit for Python's namespace-packages. I'm currently running python 3.8, and have created the following directory structure for testing.

├── namespace-package-test.package1
│   ├── LICENSE.txt
│   ├── README.md
│   ├── setup.cfg
│   ├── setup.py
│   ├── src
│   │   └── pkg1
│   │       ├── cli
│   │       │   ├── __init__.py
│   │       │   └── pkg1_cli.py
│   │       └── __init__.py
│   └── tests
├── namespace-package-test.package2
│   ├── AUTHORS.rst
│   ├── CHANGELOG.rst
│   ├── LICENSE.txt
│   ├── README.md
│   ├── setup.cfg
│   ├── setup.py
│   ├── src
│   │   └── pkg2
│   │       ├── cli
│   │       │   ├── __init__.py
│   │       │   └── pkg2_cli.py
│   │       └── __init__.py
│   └── tests

整个项目都在位于以下位置的私有bitbucket(云)服务器上:

The entire project is on a private bitbucket (cloud) server at;

git@bitbucket.org:<my-company>/namespace-package-test.git

我只想在本地安装软件包1.我已经尝试过可以想到的每一次迭代,但是似乎没有什么可以帮助我.我收到未找到存储库错误或setup.py未找到错误.

I would like to install, locally, only package 1. I've tried every iteration I can imagine of the following, but nothing seems to get me there. I either get a repository not found error or a setup.py not found error.

pip install git+ssh://git@bitbucket.org:<my-company>/namespace-package-test.package1.git

  1. 这可能吗?
  2. 我的项目结构是否适合我的工作?
  3. pip install命令应该是什么样?
  4. 奖金,如果我只想使用pipx安装特定规范怎么办?

pipx install "namespace-package-test.package1[cli] @ git+ssh://git@bitbucket.org:<my-company>/namespace-package-test.package1.git"

推荐答案

我想我想出来了...为了后代的缘故

I think I figured it out ... for posterity sake

Pip安装(进入虚拟环境)

pip install git+ssh://git@bitbucket.org/<company name>/namespace-package-test.git/#subdirectory=namespace-package-test.package1

pipx安装-符合规范

pipx install "namespace-package-test.package1[cli] @ git+ssh://git@bitbucket.org/<company name>/namespace-package-test.git/#subdirectory=namespace-package-test.package1"

这篇关于如何从私有bitbucket-git存储库安装python包命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆