Skip to content

Commit 7a3cde6

Browse files
authored
Merge pull request #138 from knopki/fix-one-package-one-version
The only one version number in the one place
2 parents eabb092 + 025265b commit 7a3cde6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ build-backend = "flit_core.buildapi"
55

66
[project]
77
name = "yascheduler"
8+
# version should be changed by automation, not by hand - DON'T TOUCH
89
version = "1.2.1"
910
description = """Yet another computing scheduler and cloud orchestration engine"""
1011
authors = [
@@ -45,6 +46,7 @@ dependencies = [
4546
"python-daemon~=2.3",
4647
"typing-extensions >= 4.2.0; python_version < '3.11'",
4748
"upcloud_api~=2.0",
49+
"importlib_metadata; python_version < '3.8'",
4850
]
4951

5052
[project.optional-dependencies]
@@ -102,7 +104,6 @@ name = "cz_conventional_commits"
102104
tag_format = "v$version"
103105
version_files = [
104106
"pyproject.toml:^version",
105-
"yascheduler/__init__.py:^__version__",
106107
]
107108
version_provider = "pep621"
108109
update_changelog_on_bump = true

yascheduler/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
import sys
2+
13
from .client import Yascheduler
24
from .variables import CONFIG_FILE, LOG_FILE, PID_FILE
35

4-
__version__ = "1.2.0"
6+
if sys.version_info < (3, 8):
7+
import importlib_metadata
8+
else:
9+
import importlib.metadata as importlib_metadata
10+
11+
__version__ = importlib_metadata.version("yascheduler")
512
__all__ = [
613
"CONFIG_FILE",
714
"LOG_FILE",

0 commit comments

Comments
 (0)