diff --git a/Makefile b/Makefile index 313594e..af4c4b3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ CURRENT_VERSION:=$(shell grep "^Version: " PKG-INFO | cut -d" " -f2) -INIT_VERSION:=$(shell grep "version" ./pyproject.toml | cut -d"=" -f2 | tr -d '"[:blank:]' ) - +INIT_VERSION:=$(shell grep "__version__" pycronofy/__init__.py | cut -d"'" -f2) .PHONY: all all: test diff --git a/pycronofy/__init__.py b/pycronofy/__init__.py index eb0a23b..ace070d 100644 --- a/pycronofy/__init__.py +++ b/pycronofy/__init__.py @@ -1,9 +1,7 @@ from pycronofy.client import Client # noqa: F401 from pycronofy import settings -import importlib - +__version__ = '2.0.0' __name__ = 'PyCronofy' -__version__ = importlib.metadata.version(__package__ or __name__) """ SDK for Cronofy - the Scheduling Platform for Business diff --git a/pycronofy/tests/__init__.py b/pycronofy/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pyproject.toml b/pyproject.toml index 7e02b34..67b3a1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "PyCronofy" -version = "2.0.0" +dynamic = ["version"] requires-python = ">=3.7" dependencies = [ "requests>=2.20.0", @@ -12,6 +12,9 @@ authors = [ {name = "Cronofy", email = "support@cronofy.com"}, ] +[tool.setuptools.dynamic] +version = {attr = "package.__version__"} + [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 6dc71dc..102c381 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ requests>=2.21.0 pytz>=2018.9 pytest>=6.2.4 -pytest-cov>=2.12.1 +pytest-cov>=4.1 responses>=0.5.0 twine>=4.0.2 flake8