Python:如何使用setuptools连接到受保护的svn存储库

我正在尝试配置setuptools.setup脚本. PyPI包工作正常,但我没有设法从我的svn存储库安装’mypackage’模块.我收到错误:

找不到’myotherpackage’的索引页面(可能拼写错误?)

>我是否忘记了有关dependency_links参数的重要内容?
>提供的参数(见下文)好吗?

setup.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
version = '2.5'

setup(name='myotherpackage',
      description='My main package called myotherpackage',
      packages=find_packages(),
      version=version,
      zip_safe=False,
      include_package_data=True,
      install_requires=['nose','tweepy','myotherpackage'],
      dependency_links=['https://code.myrep.net/svn/experimenta/user/myotherpackage/'],
      test_suite='nose.collector', 
      test_require = 'nose',
      )

解决方法:

我想你需要在dependency_links url的末尾添加一些信息(#egg = myotherpackage),如下所示:

dependency_links=['https://code.myrep.net/svn/experimenta/user/myotherpackage/#egg=myotherpackage'],

这样setuptools就知道它正在下载什么.

我尝试使用您文件的修改版本,将您的svn链接替换为我在Internet上找到的链接:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
version = '2.5'

setup(name='myotherpackage',
      description='My main package called myotherpackage',
      packages=find_packages(),
      version=version,
      zip_safe=False,
      include_package_data=True,
      install_requires=['nose','tweepy','setuptools-dev06'],
      # works
      dependency_links=['http://svn.python.org/projects/sandbox/branches/setuptools-0.6/#egg=setuptools-dev06'],
      # doesn't work
      #dependency_links=['http://svn.python.org/projects/sandbox/branches/setuptools-0.6/'],
      test_suite='nose.collector',
      test_require = 'nose',
      )

这对我有用.当我用#egg = setuptools-dev06注释掉这一行时,取消注释以/结尾的行,这不起作用.

上一篇:让Python包以不同的名称安装自己


下一篇:python distutils / setuptools:如何排除模块,或者尊重svn:ignore标志