From fa9f07949a1c6a2fb862433b80e292f26bcdce6a Mon Sep 17 00:00:00 2001 From: maliki Date: Sat, 26 Nov 2016 23:55:52 -0800 Subject: [PATCH] Switch to setuptools-scm for versioning Following other pytest projects like pytest-html, that use setuptool-scm to manage version, it would be nice other projects follow the suit and let setuptools-scm manage version of this project. --- pytest_asyncio/__init__.py | 1 - setup.py | 21 ++------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/pytest_asyncio/__init__.py b/pytest_asyncio/__init__.py index 2b8877c5..e69de29b 100644 --- a/pytest_asyncio/__init__.py +++ b/pytest_asyncio/__init__.py @@ -1 +0,0 @@ -__version__ = '0.5.0' diff --git a/setup.py b/setup.py index 8dbcb176..135eb5b7 100644 --- a/setup.py +++ b/setup.py @@ -1,29 +1,11 @@ -import codecs -import os -import re from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() - -def read(*parts): - here = os.path.abspath(os.path.dirname(__file__)) - return codecs.open(os.path.join(here, *parts), 'r').read() - - -def find_version(*file_paths): - version_file = read(*file_paths) - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", - version_file, re.M) - if version_match: - return version_match.group(1) - - raise RuntimeError("Unable to find version string.") - setup( name='pytest-asyncio', - version=find_version('pytest_asyncio', '__init__.py'), + use_scm_version=True, packages=find_packages(), url='https://github.com/pytest-dev/pytest-asyncio', license='Apache 2.0', @@ -41,6 +23,7 @@ def find_version(*file_paths): "Topic :: Software Development :: Testing", "Framework :: Pytest", ], + setup_requires=['setuptools_scm'], install_requires=[ 'pytest >= 3.0.2', ],