From 2cf422733c0fadb43a707eb6c942425f2cc312a1 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 19 Apr 2017 20:25:53 +0200 Subject: [PATCH] restore linting, drop _pytest._version for check-manifest --- _pytest/__init__.py | 6 ++++-- setup.py | 4 +--- tox.ini | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/_pytest/__init__.py b/_pytest/__init__.py index a6f201091..2599bd05a 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,5 +1,7 @@ __all__ = ['__version__'] +import pkg_resources + try: - from ._version import version as __version__ -except ImportError: + __version__ = pkg_resources.get_distribution('pytest').version +except Exception: __version__ = None # broken installation, we don't even try diff --git a/setup.py b/setup.py index 3cba379e4..73d42b73d 100644 --- a/setup.py +++ b/setup.py @@ -54,9 +54,7 @@ def main(): name='pytest', description='pytest: simple powerful testing with Python', long_description=long_description, - use_scm_version={ - 'write_to': '_pytest/_version.py', - }, + use_scm_version=True, url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff --git a/tox.ini b/tox.ini index cbb685705..d46e468c8 100644 --- a/tox.ini +++ b/tox.ini @@ -47,8 +47,9 @@ commands= [testenv:linting] basepython = python2.7 -setenv = # needed to keep check-manifest working - SETUPTOOLS_SCM_PRETEND_VERSION=0.0.1 +# needed to keep check-manifest working +setenv = + SETUPTOOLS_SCM_PRETEND_VERSION=2.0.1 deps = flake8 # pygments required by rst-lint @@ -58,7 +59,7 @@ deps = commands = {envpython} scripts/check-manifest.py flake8 pytest.py _pytest testing - rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst + rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst --encoding utf-8 [testenv:py27-xdist] deps=pytest-xdist>=1.13