Question

I want to shift to using the new GitHub Releases for my packages. I can't figure out what my download_url needs to be. The version is 1.3.5 I've tried various incarnations of the releases/tag/1.3.5, archive/1.3.5, and archive/1.3.5#egg=v1.3.5 to no avail.

My question is that in reading the PEP 438 - I know it's looking for simple-history-v1.3.5.EXT but can I force setup.py to use a specific url?

from setuptools import find_packages, setup
from simple_history import __version__

base_url = 'https://github.com/pivotal-energy-solutions/django-simple-history'

setup(name='simple_history',
      version=__version__,
      description='Store Django model history with the ability to revert back to a '
                  'specific change at any time. This includes capturing request.user',
      author='Steven Klass',
      author_email='sklass@pivotalenergysolutions.com',
      url=base_url,
      download_url='{0}/archive/{1}.tar.gz'.format(base_url, __version__),
      license='Apache License (2.0)',
      classifiers=[
          'Development Status :: 2 - Pre-Alpha',
          'Environment :: Web Environment',
          'Framework :: Django',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: Apache Software License',
          'Operating System :: OS Independent',
          'Programming Language :: Python',
          'Topic :: Software Development',
      ],
      packages=find_packages(exclude=['tests', 'tests.*']),
      package_data={'simple_history': ['static/js/*.js', 'templates/simple_history/*.html']},
      include_package_data=True,
      zip_safe=False,
      requires=['django (>=1.2)', ],
)

When I do an easy install it's saying its finding it but it always goes back to version 1.1. Can someone please clue me in on my problem.

$ easy_install -vvv simple_history
Searching for simple-history
Reading http://pypi.python.org/simple/simple_history/
Reading https://github.com/pivotal-energy-solutions/django-simple-history
Found link: https://github.com/pivotal-energy-solutions/django-simple-history/archive/master.zip
Found link: https://github.com/pivotal-energy-solutions/django-simple-history/archive/1.3.5.tar.gz
Found link: https://github.com/pivotal-energy-solutions/django-simple-history/archive/v1.3.3.tar.gz
Found link: https://pypi.python.org/packages/source/s/simple_history/simple_history-1.1.tar.gz#md5=b4c4bb2512904d7826a75f58cc9df651
Found link: https://pypi.python.org/packages/source/s/simple_history/simple_history-v1.3.3.tar.gz#md5=1564e23e982553b76a4ed7328fb5b812
Best match: simple-history 1.1
Was it helpful?

Solution

Please provide simple-history-1.3.5.tar.gz as a download for your release 1.3.5; in other words '{0}-{1}{2}'.format(packagename, version, ext)). See setuptools.package_index.interpret_distro_name for reference on how easy_install tries to parse the basename of the url.


Update:

In other words, if name your release on GitHub as <pypi package>-<version>. This will then allow it to get picked up automatically if you simply change your download_url to

download_url='{0}/releases'.format(base_url)
# or 
package_name='simple_history' # define it before setup()
download_url='{0}/archive/{1}-{2}'.format(base_url, package_name, __version__)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top