简体   繁体   English

GemFury包的Python setup.py依赖关系链接

[英]Python setup.py dependency links for GemFury packages

I have several Python packages successfully uploaded to GemFury using 我有几个Python包成功上传到GemFury使用

git push fury master

after having set my remote. 设置遥控器后。

Now I want to use these GemFury hosted packages in the builds of other packages (some on GemFury, others not). 现在我想在其他软件包的构建中使用这些GemFury托管软件包(一些在GemFury上,有些则不在)。 I set out doing this by investigating how to update my setup.py to accommodate for this new source: 我通过调查如何更新我的setup.py以适应这个新来源来做到这一点:

from setuptools import setup

setup(name='my_package',
      version='0.1',
      description='my_package package',
      url='https://bitbucket.org/me/my_package',
      packages=['my_package'],
      install_requires=[
            'package_on_gemfury==0.1',
            'pandas==0.19.0',
            'numpy==1.11.2',
      ],
      dependency_links=[
                  'https://pypi.fury.io/[KEY]/me/'
                  # 'https://pypi.fury.io/[KEY]/me/#egg=package_on_gemfury-0.1'
                  # 'https://pypi.fury.io/me/package_on_gemfury?auth=[KEY]'
      ],
      test_suite='nose2.collector.collector',
      tests_require=['nose2'],
      include_package_data=True,
      zip_safe=False)

Then I run this: 然后我运行这个:

sudo pip install .

It works if my_package is installed locally, but it will not pull from GemFury if not installed locally. 如果my_package是在本地安装的,它可以工作,但如果没有在本地安装,它将不会从GemFury中提取。

As you can see I tried several different ways to get the dependency links working properly, but nothing has worked. 正如您所看到的,我尝试了几种不同的方法来使依赖关系链接正常工作,但没有任何效果。 I get the following error: 我收到以下错误:

"Could not find a version that satisfies the requirement package_on_gemfury==0.1 (from my_package==0.1) (from versions: ) No matching distribution found for package_on_gemfury==0.1 (from my_package==0.1)" “找不到满足要求的版本package_on_gemfury == 0.1(来自my_package == 0.1)(来自版本:)没有找到package_on_gemfury == 0.1(来自my_package == 0.1)的匹配分布”

Any ideas? 有任何想法吗?

You need what I assume is a Gemfury Package Version ID. 您需要我假设的Gemfury包版本ID。

You can find this by going to the Gemfury site and looking at the manual link to download the package. 您可以通过访问Gemfury站点并查看手动链接来下载该软件包。

Eg; 例如; https://manage.fury.io/1/versions/ {x_here}/download?as=john https://manage.fury.io/1/versions/ {x_here} / download?as = john

Change your dependency link to the below. 将您的依赖关系链接更改为以下。

dependency_links=['https://pypi.fury.io/{gemfury_account_name}/-/{gemfury_package_version_id}/{package_name_and_version}?auth={gemfury_auth_hash}']

I solved this putting the following 我解决了这个问题

https://pypi.fury.io/[token]/[me]/[package_name]/

one for each package_name I need. 我需要的每个package_name一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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