From 7232edd92bdf29e4d176ca43a9673010293a722e Mon Sep 17 00:00:00 2001 From: Takumi Yanagawa Date: Thu, 2 May 2024 20:34:03 +0900 Subject: [PATCH] switch to use static versioning Signed-off-by: Takumi Yanagawa --- Makefile | 8 ++++++++ pyproject.toml | 11 +++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 564f761..b3821d8 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,14 @@ test-plugin: TARGET ?= plugins_public/tests/ test-plugin: .venv @OUTPUT_PATH=/dev/null $(PYTHON) -m pytest $(ARGS) $(TARGET) +# After published, the branch must be merged first-forwardly. TODO: Integrate with CI +publish: GIT_TAG ?= +publish: + @toml set --toml-path pyproject.toml project.version $(GIT_TAG) + @git add pyproject.toml + @git commit -m "update version to $(GIT_TAG)" + @git tag $(GIT_TAG) + clean: .venv @rm -rf build *.egg-info dist @find ./plugins -type d \( -name '*.egg-info' -o -name 'dist' \) | while read x; do echo $$x; rm -r $$x ; done diff --git a/pyproject.toml b/pyproject.toml index f883c03..9adfe49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,7 @@ [build-system] -requires = ["setuptools", "setuptools-git-versioning"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" -[tool.setuptools-git-versioning] -enabled = true -count_commits_from_version_file = true -dev_template = "{tag}.post{ccount}+git.{sha}.dirty" -dirty_template = "{tag}.post{ccount}+git.{sha}.dirty" - [tool.setuptools] package-dir = { "c2p" = "c2p" } @@ -15,7 +9,7 @@ package-dir = { "c2p" = "c2p" } include = ["c2p*"] [project] -dynamic = ["version"] +version = "v0.3.0" name = "compliance-to-policy" authors = [{ name = "Takumi Yanagawa", email = "yana1205dev@gmail.com" }] description = "Tools to bridge Compliance and Policy" @@ -47,6 +41,7 @@ dev = [ "pytest>=8.0.0", "pre-commit>=2.4.0", "pep8-naming", + "toml-cli", "types-PyYAML", "types-setuptools", ## Docs website