From c0059264bf3efd0797eb0cf034b65f47ddd6e84f Mon Sep 17 00:00:00 2001 From: David Knowles Date: Sat, 8 Apr 2023 15:35:43 +0000 Subject: [PATCH] Use setuptools_scm for auto versioning --- .github/release-drafter.yml | 2 +- .gitignore | 3 +++ pyproject.toml | 10 ++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 2877520..aac0f65 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,4 +1,4 @@ -name-template: $RESOLVED_VERSION **UPDATE setup.py BEFORE PUBLISHING** +name-template: $RESOLVED_VERSION tag-template: $RESOLVED_VERSION template: | ## What’s Changed diff --git a/.gitignore b/.gitignore index b6e4761..afb502d 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ dmypy.json # Pyre type checker .pyre/ + +# Version file generated by packaging +pyschlage/_version.py \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 261046b..a0e5d89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,16 @@ [build-system] -requires = ["setuptools~=62.3", "wheel~=0.37.1"] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" [project] name = "pyschlage" -version = "2023.3.2" description = "Python API for interacting with Schlage WiFi locks." authors = [ {name = "David Knowles", email = "dknowles2@gmail.com"}, ] dependencies = ["pycognito", "requests"] requires-python = ">=3.8" -dynamic = ["readme"] +dynamic = ["readme", "version"] license = {text = "Apache License 2.0"} keywords = ["schlage", "api", "iot"] classifiers = [ @@ -29,12 +28,15 @@ classifiers = [ [tool.setuptools] platforms = ["any"] -zip-safe = false +zip-safe = true include-package-data = true [tool.setuptools.dynamic] readme = { file = ["README.md"], content-type = "text/markdown" } +[tool.setuptools_scm] +write_to = "pyschlage/_version.py" + [tool.isort] profile = "black" combine_as_imports = true