Skip to content

Commit 3994dda

Browse files
Centralize version scheme
1 parent 93cc75b commit 3994dda

5 files changed

Lines changed: 56 additions & 22 deletions

File tree

hwcomponents_adc/_version.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# file generated by setuptools-scm
2+
# don't change, don't track in version control
3+
4+
__all__ = [
5+
"__version__",
6+
"__version_tuple__",
7+
"version",
8+
"version_tuple",
9+
"__commit_id__",
10+
"commit_id",
11+
]
12+
13+
TYPE_CHECKING = False
14+
if TYPE_CHECKING:
15+
from typing import Tuple
16+
from typing import Union
17+
18+
VERSION_TUPLE = Tuple[Union[int, str], ...]
19+
COMMIT_ID = Union[str, None]
20+
else:
21+
VERSION_TUPLE = object
22+
COMMIT_ID = object
23+
24+
version: str
25+
__version__: str
26+
__version_tuple__: VERSION_TUPLE
27+
version_tuple: VERSION_TUPLE
28+
commit_id: COMMIT_ID
29+
__commit_id__: COMMIT_ID
30+
31+
__version__ = version = '1.0.11'
32+
__version_tuple__ = version_tuple = (1, 0, 11)
33+
34+
__commit_id__ = commit_id = 'g93cc75b61'

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=61.0", "wheel", "setuptools-scm>=6.2"]
2+
requires = ["setuptools>=61.0", "wheel", "setuptools-scm>=6.2", "hwcomponents"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
@@ -37,5 +37,5 @@ hwcomponents_adc = [
3737
[tool.setuptools_scm]
3838
write_to = "hwcomponents_adc/_version.py"
3939
fallback_version = "1.0"
40-
version_scheme = "setup_scm_version:post_version"
41-
local_scheme = "setup_scm_version:no_local"
40+
version_scheme = "hwcomponents._version_scheme:post_version"
41+
local_scheme = "hwcomponents._version_scheme:no_local"

setup.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""Setup.py to ensure hwcomponents._version_scheme is importable during build."""
2+
import sys
3+
from pathlib import Path
4+
5+
# Add paths to ensure hwcomponents can be imported
6+
current_dir = Path(__file__).parent.absolute()
7+
if str(current_dir) not in sys.path:
8+
sys.path.insert(0, str(current_dir))
9+
10+
# Try to find hwcomponents in parent directories (for submodule case)
11+
parent_dir = current_dir.parent.parent
12+
hwcomponents_dir = parent_dir / "hwcomponents"
13+
if hwcomponents_dir.exists() and str(parent_dir) not in sys.path:
14+
sys.path.insert(0, str(parent_dir))
15+
16+
from setuptools import setup
17+
18+
setup()

setup_scm_version.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)