Skip to content

Commit db6000b

Browse files
move away from scm version
1 parent 5116862 commit db6000b

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

.gitignore

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ ENV/
110110
env.bak/
111111
venv.bak/
112112

113+
# vscode
114+
.vscode/
115+
116+
#salt env
117+
Saltfile
118+
113119
# Spyder project settings
114120
.spyderproject
115121
.spyproject
@@ -128,8 +134,14 @@ dmypy.json
128134
# Pyre type checker
129135
.pyre/
130136

131-
# Ignore the setuptools_scm auto-generated version module
132-
src/saltext/prometheus/version.py
133-
134137
# Ignore CI generated artifacts
135138
artifacts/
139+
140+
# Just a dir for local whatever
141+
local/
142+
143+
.DS_Store
144+
.idea/
145+
src/.DS_Store
146+
src/saltext/.DS_Store
147+
.vscode/

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
[build-system]
2-
requires = ["setuptools>=50.3.2", "wheel", "setuptools-declarative-requirements", "setuptools_scm[toml]>=3.4"]
2+
requires = ["setuptools>=50.3.2", "wheel", "setuptools-declarative-requirements"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.setuptools_scm]
6-
write_to = "src/saltext/prometheus/version.py"
7-
write_to_template = "__version__ = \"{version}\""
8-
95
[tool.black]
106
line-length = 100
117

setup.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# pylint: disable=missing-module-docstring
2+
from pathlib import Path
3+
24
import setuptools
35

6+
version_path = Path(__file__).parent / "src" / "saltext" / "prometheus" / "version.py"
7+
8+
with version_path.open() as f:
9+
for line in f:
10+
if line.startswith("__version__"):
11+
# We only want the bare string pls
12+
version = line.partition("=")[-1].strip().strip('"').strip("'")
13+
break
14+
else:
15+
version = "0.0.1dev1" # pylint: disable=invalid-name
16+
17+
418
if __name__ == "__main__":
5-
setuptools.setup(use_scm_version=True)
19+
setuptools.setup(use_scm_version=True, version=version)

src/saltext/prometheus/version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# pylint: disable=missing-module-docstring
2+
__version__ = "1.0.0"

0 commit comments

Comments
 (0)