我最近開始用SetupTools打包我的第一個項目,并且大部分都取得了成功。setuptools與pip的依賴關系解決方案之間的差異
不幸的是,我遇到了一個令人困惑的情況 - 我的項目依賴于PyPI上沒有的單個文件模塊。我已經能夠使用dependency_links選項很容易地配置setup.py以便依賴那個模塊,并且一切正常......只要我使用setup.py來安裝它即可。如果我嘗試使用pip來安裝項目蛋,它在嘗試安裝模塊時失敗,假設它必須是預制的蛋存檔。相比之下,setup.py檢測到它是一個簡單的源文件,并從中產生一個蛋。
我的目標是讓我的項目在PyPI上可用,因此使用pip安裝它是很重要的;所以我的問題是...我做錯了什么?
我的理解是,setuptools本質上是達到目的的一種手段,最終是pip和PyPI,所以我覺得這兩個工具應該表現得如此不同。
setup.py和輸出的來自各工具相關部分如下:
debian清華源,setup(
name='particle-fish',
version='0.1.0',
description='Python Boilerplate contains all the boilerplate you need to create a Python package.',
long_description=readme + '\n\n' + history,
author='Lachlan Pease',
setup。author_email='[email?protected]',
url='https://github.com/predakanga/particle-fish',
packages=[
'particle.plugins'
],
include_package_data=True,
pip?install_requires=['particle', 'irccrypt', 'pycrypto'],
dependency_links=['http://www.bjrn.se/code/irccrypt/irccrypt.py#egg=irccrypt-1.0'],
license="BSD",
zip_safe=False,
keywords='particle-fish',
classifiers=[
清華,'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
Python清華源、'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
],
test_suite='tests',
tests_require=['pytest', 'mock', 'coverage', 'pytest-cov'],
pip添加清華鏡像源。cmdclass = {'test': PyTest},
)
從setup.py輸出安裝:
Installed /Users/lachlan/.virtualenvs/particle-fish/lib/python2.7/site-packages/particle_fish-0.1.0-py2.7.egg
Processing dependencies for particle-fish==0.1.0
Searching for irccrypt
setuptools下載、Best match: irccrypt 1.0
Downloading http://www.bjrn.se/code/irccrypt/irccrypt.py#egg=irccrypt-1.0
Processing irccrypt.py
Writing /var/tmp/easy_install-svPfHF/setup.cfg
Running setup.py -q bdist_egg --dist-dir /var/tmp/easy_install-svPfHF/egg-dist-tmp-Xq3OCt
zip_safe flag not set; analyzing archive contents...
安裝setuptools報錯,Adding irccrypt 1.0 to easy-install.pth file
從PIP輸出安裝:
Downloading/unpacking irccrypt (from particle-fish==0.1.0)
Downloading irccrypt.py
Cannot unpack file /private/var/tmp/pip-mCc6La-unpack/irccrypt.py (downloaded from /Users/lachlan/.virtualenvs/particle-staging/build/irccrypt, content-type: text/plain); cannot detect archive format
Cleaning up...
setuptools、Cannot determine archive format of /Users/lachlan/.virtualenvs/particle-staging/build/irccrypt
+0
你有什么版本的pip和setuptools? –
+0
Pip版本1.4.1和setuptools版本0.9.8分別 –
+0
setuptooling。升級到setuptools 1.1然后重新運行使sdist結果得到相同的結果 –
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态