From 5b6c66e755930dcdf9d2dc3c29446eb2fa942c06 Mon Sep 17 00:00:00 2001 From: Adam Whittingham Date: Wed, 25 Oct 2023 12:37:00 +0100 Subject: [PATCH] Update version to use pyproject.toml as the source of truth --- Makefile | 3 ++- pycronofy/__init__.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index af4c4b3..313594e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CURRENT_VERSION:=$(shell grep "^Version: " PKG-INFO | cut -d" " -f2) -INIT_VERSION:=$(shell grep "__version__" pycronofy/__init__.py | cut -d"'" -f2) +INIT_VERSION:=$(shell grep "version" ./pyproject.toml | cut -d"=" -f2 | tr -d '"[:blank:]' ) + .PHONY: all all: test diff --git a/pycronofy/__init__.py b/pycronofy/__init__.py index ace070d..eb0a23b 100644 --- a/pycronofy/__init__.py +++ b/pycronofy/__init__.py @@ -1,7 +1,9 @@ from pycronofy.client import Client # noqa: F401 from pycronofy import settings -__version__ = '2.0.0' +import importlib + __name__ = 'PyCronofy' +__version__ = importlib.metadata.version(__package__ or __name__) """ SDK for Cronofy - the Scheduling Platform for Business