From 8d7667f521325107efcade6fe5b395f33d20e848 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 7 Nov 2023 15:13:08 +0000 Subject: [PATCH] Fix setuptools-scm versioning --- .github/workflows/release.yml | 1 + pyproject.toml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6029dce1e4..e383940331 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ name: release jobs: # https://github.com/marketplace/actions/actions-tagger actions-tagger: + needs: pypi # do not move the mobile tag until we publish runs-on: windows-latest permissions: # Give the default GITHUB_TOKEN write permission. diff --git a/pyproject.toml b/pyproject.toml index aef263367f..21b430997e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -288,4 +288,15 @@ dependencies = { file = [".config/requirements.in"] } [tool.setuptools_scm] local_scheme = "no-local-version" +tag_regex = "^(?Pv)?(?P[0-9.]+)(?P.*)?$" write_to = "src/ansiblelint/_version.py" +# To prevent accidental pick of mobile version tags such 'v6' +git_describe_command = [ + "git", + "describe", + "--dirty", + "--tags", + "--long", + "--match", + "v*.*", +]