From 6f5688ca4533867b51a58ba5ea2716b082e1c251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Tue, 26 Sep 2023 12:42:35 +0200 Subject: [PATCH] Stop depending on setuptools_scm_git_archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- .git_archival.txt | 3 +++ .gitattributes | 2 +- fedora/python-ogr.spec | 1 - files/tasks/install-ogr.yaml | 6 ++++++ files/tasks/rpm-test-deps.yaml | 1 - recipe.yaml | 1 - setup.cfg | 3 +-- setup.py | 9 ++++++++- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.git_archival.txt b/.git_archival.txt index 95cb3eea..3994ec0a 100644 --- a/.git_archival.txt +++ b/.git_archival.txt @@ -1 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true)$ ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes index 9e8fe43e..4e843cb7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -# Needed for setuptools-scm-git-archive +# Needed for setuptools-scm .git_archival.txt export-subst diff --git a/fedora/python-ogr.spec b/fedora/python-ogr.spec index 57d1abbe..e479cb08 100644 --- a/fedora/python-ogr.spec +++ b/fedora/python-ogr.spec @@ -13,7 +13,6 @@ BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: python3dist(setuptools-scm) -BuildRequires: python3dist(setuptools-scm-git-archive) %description One Git library to Rule! diff --git a/files/tasks/install-ogr.yaml b/files/tasks/install-ogr.yaml index 66dcb4f8..4a70c83a 100644 --- a/files/tasks/install-ogr.yaml +++ b/files/tasks/install-ogr.yaml @@ -1,6 +1,12 @@ --- - name: Print the current working directory command: pwd +- name: Require any version of setuptools_scm + lineinfile: + path: "{{ project_dir }}/setup.cfg" + regexp: '^(\s*)setuptools_scm.*' + line: '\1setuptools_scm' + backrefs: true - name: Install ogr from {{ project_dir }} pip: name: "{{ project_dir }}" diff --git a/files/tasks/rpm-test-deps.yaml b/files/tasks/rpm-test-deps.yaml index 2dd4f5f8..71462556 100644 --- a/files/tasks/rpm-test-deps.yaml +++ b/files/tasks/rpm-test-deps.yaml @@ -6,7 +6,6 @@ - python3-setuptools - git-core - python3-setuptools_scm - - python3-setuptools_scm_git_archive - python3-wheel # for bdist_wheel - python3-pytest - python3-tox diff --git a/recipe.yaml b/recipe.yaml index b545b906..6afd3b3e 100644 --- a/recipe.yaml +++ b/recipe.yaml @@ -18,7 +18,6 @@ - python3-setuptools - git-core - python3-setuptools_scm - - python3-setuptools_scm_git_archive - python3-wheel # for bdist_wheel - python3-pytest - python3-tox diff --git a/setup.cfg b/setup.cfg index 48cc5d1b..74c79565 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,8 +45,7 @@ install_requires = python_requires = >=3.9 include_package_data = True setup_requires = - setuptools_scm - setuptools_scm_git_archive + setuptools_scm >= 7 [options.extras_require] testing = diff --git a/setup.py b/setup.py index 10060a8e..81570728 100644 --- a/setup.py +++ b/setup.py @@ -2,4 +2,11 @@ from setuptools import setup -setup(use_scm_version=True) +# we can't use pre-release-based version scheme because it generates versions +# that are sorted higher than the last stable release by RPM +# for example: +# - pre-release (guess-next-dev): +# 0.20.1.dev1+g0abcdef.d20230921 > 0.20.1 +# - post-release (no-guess-dev): +# 0.20.0.post1.dev1+g0abcdef < 0.20.1 +setup(use_scm_version={"version_scheme": "no-guess-dev"})