Skip to content

Commit 842cf90

Browse files
committed
Adapt scm build.
1 parent acfa693 commit 842cf90

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
requires = ['setuptools', 'setuptools-scm', 'wheel']
33
build-backend = "setuptools.build_meta"
44

5+
[tool.setuptools_scm]
6+
version_scheme = "post-release"
7+
8+
59
[project]
610
name = "pytsql"
711
description = "`Pytsql` allows to run mssql sripts, typically run via GUIs, via CLI."

setup.py

-18
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@
33
from time import time
44

55
import setuptools
6-
from setuptools_scm.version import ScmVersion
7-
8-
9-
def get_dev_timestamp(version: ScmVersion) -> str:
10-
"""Return a new distribution version string.
11-
12-
Returns the version found in the git tag if currently checked out commit has a tag.
13-
Otherwise, returns the version found in the most recent git tag, appended with
14-
`dev` and the current timestamp in seconds.
15-
"""
16-
17-
if version.exact:
18-
return version.format_with("{tag}")
19-
return version.format_with(f"{{tag}}.dev{int(time())}")
206

217

228
def get_platform() -> str:
@@ -61,10 +47,6 @@ def create_extension() -> setuptools.Extension:
6147
def run_setup():
6248
setuptools.setup(
6349
ext_modules=[create_extension()],
64-
use_scm_version={
65-
"version_scheme": get_dev_timestamp,
66-
"local_scheme": "dirty-tag",
67-
},
6850
)
6951

7052

0 commit comments

Comments
 (0)