Skip to content

Commit bc0d4d6

Browse files
authored
Merge pull request #20 from pytest-dev/use-setuptools-scm/1/dev
Use setuptools_scm for version management
2 parents c09cbbc + a269cf6 commit bc0d4d6

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = ["setuptools >=42", "setuptools_scm[toml] >=3.4.1", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
write_to = "pytest_localserver/_version.py"

pytest_localserver/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '0.5.1.post0'
1+
from pytest_localserver._version import version as VERSION

setup.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,12 @@
22
import sys
33

44

5-
VERSION = '0.5.1.post0'
6-
7-
85
def read(fname):
96
# makes sure that setup can be executed from a different location
107
import os.path
118
_here = os.path.abspath(os.path.dirname(__file__))
129
return open(os.path.join(_here, fname)).read()
1310

14-
# make sure that versions match before uploading anything to the cheeseshop
15-
if 'upload' in sys.argv or 'register' in sys.argv:
16-
import pytest_localserver
17-
assert pytest_localserver.VERSION == VERSION
18-
1911

2012
class PyTest(Command):
2113
user_options = []
@@ -30,7 +22,6 @@ def run(self):
3022

3123
setup(
3224
name='pytest-localserver',
33-
version=VERSION,
3425
author='Sebastian Rahlf',
3526
author_email='[email protected]',
3627
maintainer='David Zaslavsky',

tests/test_version.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pytest_localserver
2+
3+
4+
def test_version():
5+
assert hasattr(pytest_localserver, "VERSION")
6+
assert isinstance(pytest_localserver.VERSION, str)

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tox]
22
envlist = py35,py36,py37,py38,py39,py310
33
recreate = True
4+
isolated_build = True
45

56
[tox:hudson]
67
downloadcache = {toxworkdir}/_download

0 commit comments

Comments
 (0)