From d84c424b1c3c1ce6730fcfb4008adc0ca2a62e1c Mon Sep 17 00:00:00 2001 From: Serhii Abarovskyi Date: Tue, 9 May 2023 18:33:54 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8Only=20use=20setuptools-scm-git-arc?= =?UTF-8?q?hive=20under=20<=20py37?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `setuptools-scm` support Git archives natively starting v7 but it only supports Python 3.7 or higher. This patch makes up a set of conditional build dependencies that add `setuptools-scm-git-archive` only below Python 3.7 and in combination with an older version of `setuptools-scm`. Close #515 --- .git_archival.txt | 3 +++ pyproject.toml | 8 ++++++-- requirements/dist-build-constraints.in | 3 +-- setup.cfg | 1 - 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.git_archival.txt b/.git_archival.txt index 95cb3eea4e..3994ec0a83 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/pyproject.toml b/pyproject.toml index b1e5f60a80..fa315290ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,8 +6,12 @@ requires = [ "setuptools>=34.4", # Plugins - "setuptools_scm[toml]>=3.5", - "setuptools_scm_git_archive>=1.1", + "setuptools-scm >= 7.0.0; python_version >= '3.7'", + # ^ supports git archives through a plugin + # | | + # supports git archives natively V + "setuptools-scm[toml] >= 3.5, < 7.0.0; python_version < '3.7'", + "setuptools-scm-git-archive >= 1.1; python_version < '3.7'", ] build-backend = "setuptools.build_meta" diff --git a/requirements/dist-build-constraints.in b/requirements/dist-build-constraints.in index 26b57228a9..232598ff55 100644 --- a/requirements/dist-build-constraints.in +++ b/requirements/dist-build-constraints.in @@ -5,8 +5,7 @@ setuptools >= 34.4 # Plugins -setuptools_scm[toml] >= 3.5 -setuptools_scm_git_archive >= 1.1 +setuptools_scm[toml] >= 3.5, < 7.0.0 # Dynamic (coming from setuptools' PEP 517 build backend) wheel diff --git a/setup.cfg b/setup.cfg index 1f2b08f4c3..8cd055dfbc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -65,7 +65,6 @@ include_package_data = True # These are required during `setup.py` run: setup_requires = setuptools_scm>=1.15.0 - setuptools_scm_git_archive>=1.0 # These are required in actual runtime: install_requires =