Skip to content

Commit

Permalink
Adapt scm build.
Browse files Browse the repository at this point in the history
  • Loading branch information
kklein committed Oct 24, 2024
1 parent acfa693 commit 842cf90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
requires = ['setuptools', 'setuptools-scm', 'wheel']
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "post-release"


[project]
name = "pytsql"
description = "`Pytsql` allows to run mssql sripts, typically run via GUIs, via CLI."
Expand Down
18 changes: 0 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@
from time import time

import setuptools
from setuptools_scm.version import ScmVersion


def get_dev_timestamp(version: ScmVersion) -> str:
"""Return a new distribution version string.
Returns the version found in the git tag if currently checked out commit has a tag.
Otherwise, returns the version found in the most recent git tag, appended with
`dev` and the current timestamp in seconds.
"""

if version.exact:
return version.format_with("{tag}")
return version.format_with(f"{{tag}}.dev{int(time())}")


def get_platform() -> str:
Expand Down Expand Up @@ -61,10 +47,6 @@ def create_extension() -> setuptools.Extension:
def run_setup():
setuptools.setup(
ext_modules=[create_extension()],
use_scm_version={
"version_scheme": get_dev_timestamp,
"local_scheme": "dirty-tag",
},
)


Expand Down

0 comments on commit 842cf90

Please sign in to comment.