File tree Expand file tree Collapse file tree 5 files changed +24
-1
lines changed Expand file tree Collapse file tree 5 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 22
33# GNNs for Charged Particle Tracking
44
5+ [ ![ CalVer YY.0M.MICRO] ( https://img.shields.io/badge/calver-YY.0M.MICRO-22bfda.svg )] [ calver ]
56[ ![ Documentation Status] ( https://readthedocs.org/projects/gnn-tracking/badge/?version=latest )] ( https://gnn-tracking.readthedocs.io/en/latest/?badge=latest )
67[ ![ pre-commit.ci status] ( https://results.pre-commit.ci/badge/github/gnn-tracking/gnn_tracking/main.svg )] ( https://results.pre-commit.ci/latest/github/gnn-tracking/gnn_tracking/main )
78[ ![ gh actions] ( https://github.com/gnn-tracking/gnn_tracking/actions/workflows/test.yaml/badge.svg )] ( https://github.com/gnn-tracking/gnn_tracking/actions )
@@ -28,10 +29,12 @@ See the [readme of the organization][organization-readme] for an overview of the
28295 . For development: Install [ pre-commit] [ ] hooks: ` pre-commit install ` (from this directory)
2930
3031A good place to get started are the [ demo notebooks] [ demo ] .
32+ This package is versioned based on the [ ![ CalVer YY.0M.MICRO] ( https://img.shields.io/badge/calver-YY.0M.MICRO-22bfda.svg ) CalVer scheme] [ calver ] .
3133
3234[ mamba install ] : https://mamba.readthedocs.io/en/latest/installation.html
3335[ demo ] : https://github.com/gnn-tracking/tutorials
3436[ pre-commit ] : https://pre-commit.com
37+ [ calver ] : https://calver.org/
3538
3639## 🧰 Development guidelines
3740
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+
3+ __all__ = ["__version__" ]
4+
5+ __version__ = (Path (__file__ ).resolve ().parent / "version.txt" ).read_text ().strip ()
Original file line number Diff line number Diff line change 22from types import ModuleType
33
44import git
5+ from packaging import version
56
7+ import gnn_tracking
68from gnn_tracking .utils .log import logger
79
810
@@ -28,3 +30,10 @@ def get_commit_hash(module: None | ModuleType | str | PathLike = None) -> str:
2830 "Repository %s is dirty, commit hash may not be accurate." , base_path
2931 )
3032 return repo .head .object .hexsha
33+
34+
35+ def assert_version_geq (require : str ):
36+ assert version .parse (gnn_tracking .__version__ ) >= version .parse (require ), (
37+ f"Please update gnn_tracking from { gnn_tracking .__version__ } to at least "
38+ f"version { require } ."
39+ )
Original file line number Diff line number Diff line change 1- 0.0.1
1+ 23.07.00
Original file line number Diff line number Diff line change 1+ import gnn_tracking
2+ from gnn_tracking .utils .versioning import assert_version_geq
3+
4+
5+ def test_versioning_geq ():
6+ assert_version_geq (gnn_tracking .__version__ )
You can’t perform that action at this time.
0 commit comments