Skip to content

Commit 08d3545

Browse files
committed
add dynamic versioning
1 parent 7bba769 commit 08d3545

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ where = [
1111

1212
[project]
1313
name = "specsanalyzer"
14-
version = "0.4.2a0"
14+
dynamic = ["version"]
1515
description = "Python package for loading and converting SPECS Phoibos analyzer data."
1616
authors = [
1717
{name = "Laurenz Rettig", email = "rettig@fhi-berlin.mpg.de"},

src/specsanalyzer/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""SpecsAnalyzer class easy access APIs"""
22
# Easy access APIs
3+
import importlib.metadata
4+
35
from .core import SpecsAnalyzer
46

5-
__version__ = "0.1.0"
7+
__version__ = importlib.metadata.version("specsanalyzer")
68
__all__ = ["SpecsAnalyzer"]

src/specsscan/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""SpecsScan class easy access APIs"""
22
# Easy access APIs
3+
import importlib.metadata
4+
35
from .core import SpecsScan
46

5-
__version__ = "0.1.0"
7+
__version__ = importlib.metadata.version("specsanalyzer")
68
__all__ = ["SpecsScan"]

tests/test_specsanalyzer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This is a code that performs several tests for the SpecsAnalyzer core class functions"""
2+
import importlib.metadata
23
import os
34
from importlib.util import find_spec
45

@@ -10,7 +11,7 @@
1011

1112
def test_version():
1213
"""Test if the package has the correct version string."""
13-
assert __version__ == "0.1.0"
14+
assert __version__ == importlib.metadata.version("specsanalyzer")
1415

1516

1617
def test_default_config():

tests/test_specsscan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""This is a code that performs several tests for the SpecsScan core class functions
22
"""
3+
import importlib.metadata
34
import os
45

56
import numpy as np
@@ -20,7 +21,7 @@
2021

2122
def test_version():
2223
"""Test if the package has the correct version string."""
23-
assert __version__ == "0.1.0"
24+
assert __version__ == importlib.metadata.version("specsanalyzer")
2425

2526

2627
def test_default_config():

0 commit comments

Comments
 (0)