运行my setup.py时,将创建一个version.py文件,但不使用该文件中指定的版本。如何修复它以指定版本
这是我的设置.py:
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def parse_requirements(filename):
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]
install_reqs = parse_requirements(filename='requirements.txt')
setup(
name='eagle-py-framework', # Required
version=1.0, # Required
description='Eagle Python Framework', # Required
long_description=long_description, # Optional
author='asdf', # Optional
author_email='asdf',
url='asdf',
classifiers=[ # Optional
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required
install_requires=install_reqs, # Optional
)
我用来运行它的命令是:
python setup.py sdist
它创建的version.py文件仅包含以下内容:
__version__=
使用版本作为字符串
从这里开始->https://www.python.org/dev/peps/pep-0396/
https://docs.python.org/2/distutils/setupscript.html
相关问题 更多 >
编程相关推荐