From 2af6514394e3bd20f3485805a38d43e12a31fc70 Mon Sep 17 00:00:00 2001 From: JosePizarro3 Date: Tue, 25 Jun 2024 13:24:46 +0200 Subject: [PATCH] Added version from pyproject --- .gitignore | 1 + pyproject.toml | 3 +++ src/nomad_simulations/__init__.py | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 65d09cd0..5274b0ab 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +_version.py # PyInstaller # Usually these files are written by a python script from a template diff --git a/pyproject.toml b/pyproject.toml index 5c644e84..597f608e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,6 +128,9 @@ package-dir = { "" = "src" } [tool.setuptools.packages.find] where = ["src"] +[tool.setuptools_scm] +write_to = "src/nomad_simulations/_version.py" + [project.entry-points.'nomad.plugin'] nomad_simulations_plugin = "nomad_simulations.schema_packages:nomad_simulations_plugin" diff --git a/src/nomad_simulations/__init__.py b/src/nomad_simulations/__init__.py index e69de29b..ce2e284e 100644 --- a/src/nomad_simulations/__init__.py +++ b/src/nomad_simulations/__init__.py @@ -0,0 +1,4 @@ +try: + from ._version import version as __version__ +except ImportError: + __version__ = ''