我正在尝试将一个开源库移植到Python 3.(SymPy,如果有人想知道的话.)
所以,我需要2to3在为Python 3构建时自动运行.为此,我需要使用distribute.因此,我需要移植当前系统(根据doctest)distutils.
不幸的是,我不知道什么是这些模块-之间的区别distutils,distribute,setuptools.文档是最好的粗略,因为它们似乎都是彼此的分支,旨在在大多数情况下兼容(但实际上,不是全部)......等等.
有人可以解释这些差异吗?我应该用什么?什么是最现代的解决方案?(Distribute顺便说一句,我也很欣赏一些关于移植的指南,但这有点超出了问题的范围......)
要创建一个python包setup.py,我有以下内容:
setup(
name='TowelStuff',
version='0.1.0',
author='J. Random Hacker',
author_email='jrh@example.com',
packages=['towelstuff', 'towelstuff.test'],
scripts=['bin/stowe-towels.py','bin/wash-towels.py'],
url='http://pypi.python.org/pypi/TowelStuff/',
license='LICENSE.txt',
description='Useful towel-related stuff.',
long_description=open('README.txt').read(),
install_requires=[
"Django >= 1.1.1",
"caldav == 0.1.4",
],
)
Run Code Online (Sandbox Code Playgroud)
所以我用我自己的包描述和信息重新制作了它.当我构建它时,我得到以下警告:
distutils/dist.py:267: UserWarning: Unknown distribution option:
Run Code Online (Sandbox Code Playgroud)
是否install_requires仅在某些版本的工作?
试图创建一个python包.似乎工作,但我得到一个警告.我的setup.py是:
#! /usr/bin/env python
from distutils.core import setup
setup(
name='myPKG',
version='0.02.01',
url='http://someURL.02.01',
packages=['scripts',
'statistics'],
author = 'Research-Team',
author_email = 'me@gmail.com',
description='This is my package',
scripts=['scripts/myScript.py'],
entry_points={'console_scripts' : ['myCommandlineName = scripts.myScript:testRequireDecorator']},
install_requires=['numpy >= 1.5.1', 'scipy >= 0.9.0', 'poster']
)
Run Code Online (Sandbox Code Playgroud)
我收到以下警告.为什么,具体来说,两个第一个用户警告?
root@TK: python setup.py sdist
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running sdist
running check
package init file 'scripts/__init__.py' not found (or not a regular file)
reading manifest template 'MANIFEST.in'
no previously-included directories found …Run Code Online (Sandbox Code Playgroud)