From f3245eaeac020d89d55c4bd19bd5e9ad8996329d Mon Sep 17 00:00:00 2001 From: AlexanderJuestel Date: Fri, 15 Sep 2023 12:33:47 +0200 Subject: [PATCH] EditSetup --- gemgis/__init__.py | 4 ++++ pyproject.toml | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/gemgis/__init__.py b/gemgis/__init__.py index 7b1e3232..738f6a59 100644 --- a/gemgis/__init__.py +++ b/gemgis/__init__.py @@ -27,6 +27,10 @@ """ +try: + from ._version_generated import __version__ +except ImportError: + __version__ = "unreleased" from gemgis.gemgis import * import gemgis.vector as vector diff --git a/pyproject.toml b/pyproject.toml index 55a526fe..07f25e1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,3 +43,13 @@ Home = 'https://gemgis.readthedocs.io/' Repository = 'https://github.com/cgre-aachen/gemgis' "Source Code" = 'https://github.com/cgre-aachen/gemgis' +[tool.setuptools_scm] +# Make sure setuptools uses version based on the last created tag +version_scheme = "post-release" +# Make sure scm doesn't use local scheme version for push to pypi +# (so there isn't a + in the version) +local_scheme = "no-local-version" +# This _version_generated.py file is a file that you'll never want to add to version control - so you'll want to add it to your gitignore file. but when you build your package, setuptools_Scm creates it. and it contains version information that you will pull into your package below. +write_to = "gemgis/_version_generated.py" +write_to_template = '__version__ = "v{version}"' +