6

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?

Grant Bartel
  • 363
  • 1
  • 3
  • 21

2 Answers2

4

I solved this putting the following

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

one for each package_name I need.

  • I used this in serveral projects without problem (Python 3) dependency_links=[ 'https://pypi.fury.io/[token]/[me]/[package_name_1]/', 'https://pypi.fury.io/[token]/[me]/[package_name_2]/' ] EDIT: can't format as code lol sorry for this mess – Daniele Murroni Jan 14 '19 at 11:09
  • This solution worked for me. An entry in `dependency_links` like `f"https://pypi.fury.io/{gemfury_url_secret_token}/{organization_name}/{repository_name}/"` for each dependency. – Carl G May 06 '19 at 18:14
2

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.

E.g; 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}']
brettm
  • 179
  • 1
  • 9
  • It doesn't seem to work for me. I get the same error as before using `https://pypi.fury.io/my_account/-/0.1/package_on_gemfury-0.1?auth=[KEY]` and `https://pypi.fury.io/my_account/0.1/package_on_gemfury-0.1?auth=[KEY]`. Also your example doesn't work. – Grant Bartel Dec 21 '16 at 18:29
  • The number you have for {gemfury_package_version_id} in your URL (after /-/) wouldn't be 0.1 if thats what you tried. It was a 6 digit number for me, completely unrelated to my own package version. As mentioned login to Gemfury, and go to the page which allows you to manualy download the specific version of the package you are after. There will be a manual download button, which you hover over should show that number Im talking about. – brettm Dec 21 '16 at 23:29
  • Thanks, I see it now. Do you know if this number changes over time? I see that it's different per package. This also seems like an unsupported feature on GemFury's part and more of a hack. – Grant Bartel Dec 22 '16 at 08:55
  • Also, I have confirmed that the id extracted from the download link changes per package deployment. – Grant Bartel Dec 25 '16 at 15:07
  • Not sure if it changes over time per version published, at a guess I assume not? I agree very hacky, I had the exact same requirement as you recently and just needed it to work. Sent a message to Gemfury but have had no response. – brettm Dec 28 '16 at 00:52
  • Any reason for unanswered? Is there a better alternative? – brettm Jan 13 '17 at 00:28
  • Yes this works, but it's not robust IMO. There isn't a better answer now, but after contacting GemFury, they informed me it is something they're working on as it is a recent known issue. I will update here when it has been resolved, unless they beat me to it :) – Grant Bartel Jan 14 '17 at 11:51