restore setuptools_scm write_to usage

This commit is contained in:
Ronny Pfannschmidt 2017-04-23 16:59:08 +02:00
parent 4242bf6262
commit e02cb6d7ce
3 changed files with 25 additions and 17 deletions

View File

@ -1,10 +1,8 @@
import pkg_resources
__all__ = ['__version__']
try:
__version__ = pkg_resources.get_distribution('pytest').version
except Exception:
from ._version import __version__
except ImportError:
# broken installation, we don't even try
# unknown only works because we do poor mans version compare
__version__ = 'unknown'

View File

@ -9,6 +9,10 @@ upload-dir = doc/en/build/html
[bdist_wheel]
universal = 1
[check-manifest]
ignore =
_pytest/_version.py
[metadata]
license_file = LICENSE

View File

@ -1,19 +1,23 @@
import os, sys
import os
import sys
import setuptools
import pkg_resources
from setuptools import setup, Command
classifiers = ['Development Status :: 6 - Mature',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Topic :: Software Development :: Testing',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities'] + [
('Programming Language :: Python :: %s' % x) for x in
'2 2.6 2.7 3 3.3 3.4 3.5 3.6'.split()]
classifiers = [
'Development Status :: 6 - Mature',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Topic :: Software Development :: Testing',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities',
] + [
('Programming Language :: Python :: %s' % x)
for x in '2 2.6 2.7 3 3.3 3.4 3.5 3.6'.split()
]
with open('README.rst') as fd:
long_description = fd.read()
@ -54,7 +58,9 @@ def main():
name='pytest',
description='pytest: simple powerful testing with Python',
long_description=long_description,
use_scm_version=True,
use_scm_version={
'write_to': '_pytest/_version.py',
},
url='http://pytest.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],