Skip to content

Commit

Permalink
🎨Only use setuptools-scm-git-archive under < py37
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
serhii73 committed May 28, 2023
1 parent 349f7b2 commit b4ea4f2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true)$
ref-names: $Format:%D$
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion requirements/dist-build-constraints.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
setuptools >= 34.4

# Plugins
setuptools_scm[toml] >= 3.5
setuptools_scm_git_archive >= 1.1

# Dynamic (coming from setuptools' PEP 517 build backend)
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ include_package_data = True

# These are required during `setup.py` run:
setup_requires =
setuptools_scm>=1.15.0
setuptools_scm_git_archive>=1.0
setuptools_scm >= 7.0.0; python_version >= '3.7'"

# These are required in actual runtime:
install_requires =
Expand Down

0 comments on commit b4ea4f2

Please sign in to comment.