Python:如何使用 setuptools 连接到受保护的 svn 存储库 [英] Python: How to connect to a protected svn repository with setuptools

查看:42
本文介绍了Python:如何使用 setuptools 连接到受保护的 svn 存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to configure a setuptools.setup script. PyPI packages works fine but I don't manage to install the 'mypackage' module from my svn repository. I get the error:

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

  • 我是不是忘记了关于dependency_links 参数的一些重要信息?
  • 提供的参数(见下文)是否正常?
#!/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),像这样:

I think you need to add to add some information (#egg=myotherpackage) on the end of the dependency_links url, like this:

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

这是为了让 setuptools 知道它正在下载什么.

This is so that setuptools knows what it is downloading.

我用你的文件的修改版本进行了尝试,用我在互联网上找到的链接替换了你的 svn 链接:

I tried it with a modified version of your file, replacing your svn link with one I found on the 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 注释掉该行,并取消注释以/结尾的行时,这不起作用.

This worked for me. When I comment out the line with the #egg=setuptools-dev06, and uncomment the line that just ends with a / , that doesn't work.

这篇关于Python:如何使用 setuptools 连接到受保护的 svn 存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆