Skip to content

Commit bf48544

Browse files
authored
pyproject.toml for version generation (#1534)
Instead of the usual setup.py. Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
1 parent e111e76 commit bf48544

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

pyproject.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 40.0.0",
4-
"wheel >= 0.29.0",
5-
"setuptools-scm >= 2, < 4",
3+
"setuptools >= 41.0.0",
4+
"wheel >= 0.30.0",
5+
"setuptools_scm[toml]>=3.4",
66
]
77
build-backend = 'setuptools.build_meta'
88

9+
[tool.setuptools_scm]
10+
write_to = "src/virtualenv/version.py"
11+
write_to_template = """
12+
\"\"\" Version information \"\"\"
13+
__version__ = "{version}"
14+
"""
15+
916
[tool.black]
1017
line-length = 120
1118

setup.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import absolute_import, unicode_literals
3-
4-
import textwrap
5-
61
from setuptools import setup
72

8-
setup(
9-
use_scm_version={
10-
"write_to": "src/virtualenv/version.py",
11-
"write_to_template": textwrap.dedent(
12-
"""
13-
# coding: utf-8
14-
from __future__ import unicode_literals
15-
__version__ = {version!r}
16-
"""
17-
).lstrip(),
18-
}
19-
)
3+
setup()

0 commit comments

Comments
 (0)