1

我想转向为我的包使用新的GitHub 版本。我无法弄清楚我download_url需要什么。该版本是1.3.5我尝试了 , 和 的各种化身,releases/tag/1.3.5archive/1.3.5无济于事archive/1.3.5#egg=v1.3.5

我的问题是,在阅读 PEP 438 - 我知道它正在寻找simple-history-v1.3.5.EXT但我可以强制 setup.py 使用特定的网址吗?

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)', ],
)

当我进行简单安装时,它说它找到了它,但它总是回到 1.1 版。有人可以帮我解决我的问题。

$ 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
4

1 回答 1

3

simple-history-1.3.5.tar.gz为您的发行版提供下载1.3.5;换句话说'{0}-{1}{2}'.format(packagename, version, ext))。请参阅setuptools.package_index.interpret_distro_name有关如何easy_install尝试解析basenameurl 的参考。


更新:

换句话说,如果将您在 GitHub 上的发布命名为<pypi package>-<version>. 如果您只需将其更改download_url

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__)
于 2013-07-13T07:44:03.820 回答