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 14, 2023
1 parent 349f7b2 commit 905bd59
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 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 @@ -6,7 +6,6 @@ setuptools >= 34.4

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

# Dynamic (coming from setuptools' PEP 517 build backend)
wheel
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 905bd59

Please sign in to comment.