简体   繁体   中英

Python setup.py dependency links for GemFury packages

I have several Python packages successfully uploaded to GemFury using

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). I set out doing this by investigating how to update my setup.py to accommodate for this new source:

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.

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)"

Any ideas?

You need what I assume is a Gemfury Package Version ID.

You can find this by going to the Gemfury site and looking at the manual link to download the package.

Eg; 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.

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