Skip to content

Commit fa9f079

Browse files
author
maliki
committed
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.
1 parent 150e913 commit fa9f079

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

pytest_asyncio/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
__version__ = '0.5.0'

setup.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
1-
import codecs
2-
import os
3-
import re
41
from setuptools import setup, find_packages
52

63
with open('README.rst') as f:
74
readme = f.read()
85

9-
10-
def read(*parts):
11-
here = os.path.abspath(os.path.dirname(__file__))
12-
return codecs.open(os.path.join(here, *parts), 'r').read()
13-
14-
15-
def find_version(*file_paths):
16-
version_file = read(*file_paths)
17-
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
18-
version_file, re.M)
19-
if version_match:
20-
return version_match.group(1)
21-
22-
raise RuntimeError("Unable to find version string.")
23-
246
setup(
257
name='pytest-asyncio',
26-
version=find_version('pytest_asyncio', '__init__.py'),
8+
use_scm_version=True,
279
packages=find_packages(),
2810
url='https://github.com/pytest-dev/pytest-asyncio',
2911
license='Apache 2.0',
@@ -41,6 +23,7 @@ def find_version(*file_paths):
4123
"Topic :: Software Development :: Testing",
4224
"Framework :: Pytest",
4325
],
26+
setup_requires=['setuptools_scm'],
4427
install_requires=[
4528
'pytest >= 3.0.2',
4629
],

0 commit comments

Comments
 (0)