Skip to content

Commit

Permalink
new way to get the current version variable
Browse files Browse the repository at this point in the history
  • Loading branch information
seb5g committed Sep 19, 2024
1 parent 636d214 commit f2d7940
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Byte-compiled / optimized / DLL files
__pycache__/
_version.py

*.py[cod]
*$py.class
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ classifiers = [
source = "vcs"
fallback-version = '0.0.1'

[tool.hatch.build.hooks.vcs]
version-file = "_version.py"

[tool.hatch.build.targets.sdist]
include = [
"/src",
Expand Down
4 changes: 2 additions & 2 deletions src/pymodaq_plugins_template/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from pathlib import Path
from pymodaq_utils.logger import set_logger # to be imported by other modules.
from _version import __version__, __version_tuple__, version_tuple, version

from .utils import Config
config = Config()

with open(str(Path(__file__).parent.joinpath('resources/VERSION')), 'r') as fvers:
__version__ = fvers.read().strip()

0 comments on commit f2d7940

Please sign in to comment.