From 9ac862ee6883b9974ca68c8208df69e560b8d9e9 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Fri, 13 May 2022 10:12:20 +0100 Subject: [PATCH] added __version__ to package --- README.md | 4 +++- conda/meta.yaml | 3 ++- paramak/__init__.py | 3 +++ pyproject.toml | 4 ++-- setup.cfg | 5 +++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 43949ce60..20e421ece 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,10 @@ STP, STL, BRep, HTML and DAGMC h5m. :point_right: [Video presentation](https://www.youtube.com/embed/fXboew3U7rw) -:point_right: [Installation](https://paramak.readthedocs.io/en/main/#system-installation) +:point_right: [Installation](https://paramak.readthedocs.io/en/main/install.html) :point_right: [Publication](https://f1000research.com/articles/10-27) :point_right: [Docker images](https://github.com/fusion-energy/paramak/pkgs/container/paramak) + +:point_right: Examples with Neutronics [1](https://github.com/fusion-energy/magnetic_fusion_openmc_dagmc_paramak_example), [2](https://github.com/fusion-energy/inertial_fusion_openmc_dagmc_paramak_example), [3](https://github.com/fusion-energy/neutronics-workshop) diff --git a/conda/meta.yaml b/conda/meta.yaml index 35887f271..e8122201a 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -14,7 +14,8 @@ build: requirements: build: - python {{ python }} - - setuptools + - setuptools>=46.4.0 + - setuptools_scm>=6.3.1 run: - python {{ python }} - cadquery {{ cadquery }} diff --git a/paramak/__init__.py b/paramak/__init__.py index 8c222acda..fa4d97f31 100644 --- a/paramak/__init__.py +++ b/paramak/__init__.py @@ -1,6 +1,8 @@ try: + # this works for python 3.7 and lower from importlib.metadata import version, PackageNotFoundError except (ModuleNotFoundError, ImportError): + # this works for python 3.8 and higher from importlib_metadata import version, PackageNotFoundError try: __version__ = version("paramak") @@ -11,6 +13,7 @@ __all__ = ["__version__"] + from .shape import Shape from .reactor import Reactor from .utils import ( diff --git a/pyproject.toml b/pyproject.toml index 81763fad7..df655bb22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "setuptools >= 45", + "setuptools >= 46.4.0", "wheel", - "setuptools_scm[toml] >= 6.2", + "setuptools_scm[toml] >= 6.3.1", ] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 2ef248554..efc12be33 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [metadata] name = paramak +version = attr: paramak.__version__ author = The Paramak Development Team author_email = mail@jshimwell.com description = Create 3D fusion reactor CAD models based on input parameters @@ -39,12 +40,12 @@ install_requires= setuptools_scm [options.extras_require] -tests = +tests = pytest >= 5.4.3 pytest-cov>=2.12.1 pytest-runner>=5.3.1 dagmc_h5m_file_inspector>=0.5.0 -docs = +docs = sphinx >= 4.1.2 sphinx_rtd_theme sphinx_autodoc_typehints