Skip to content

Commit 1d59035

Browse files
committed
added attribute __version__
1 parent fadd45f commit 1d59035

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

pathfinding3d/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
import os
2+
13
__all__ = ["core", "finder"]
4+
5+
# read the version from version.txt
6+
with open(os.path.join(os.path.dirname(__file__), "version.txt"), encoding="utf-8") as file_handler:
7+
__version__ = file_handler.read().strip()

test/test_version.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os
2+
3+
4+
def test_version():
5+
"""
6+
Test if __version__ is correctly read from version.txt
7+
"""
8+
from pathfinding3d import __version__
9+
10+
# Read the version from version.txt
11+
with open(
12+
os.path.join(os.path.dirname(os.path.dirname(__file__)), "pathfinding3d", "version.txt"), encoding="utf-8"
13+
) as file_handler:
14+
version = file_handler.read().strip()
15+
16+
assert __version__ == version

0 commit comments

Comments
 (0)