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 17, 2023
1 parent 349f7b2 commit 5d05b3a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 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
2 changes: 1 addition & 1 deletion requirements/dist-build-constraints.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
setuptools >= 34.4

# Plugins
setuptools_scm[toml] >= 3.5
setuptools_scm[toml] >= 3.5, < 7.0.0; python_version < '3.7'
setuptools_scm_git_archive >= 1.1

# Dynamic (coming from setuptools' PEP 517 build backend)
Expand Down
16 changes: 3 additions & 13 deletions requirements/dist-build-constraints.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements/dist-build-constraints.txt --strip-extras requirements/dist-build-constraints.in
#
packaging==21.3
# via setuptools-scm
pyparsing==3.0.6
# via packaging
setuptools-scm==6.3.2
# via -r requirements/dist-build-constraints.in
setuptools-scm-git-archive==1.1
# via -r requirements/dist-build-constraints.in
tomli==2.0.0
# via setuptools-scm
wheel==0.37.1
# via -r requirements/dist-build-constraints.in

# The following packages are considered to be unsafe in a requirements file:
setuptools==60.2.0
# via
# -r requirements/dist-build-constraints.in
# setuptools-scm
# via -r requirements/dist-build-constraints.in
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ 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>=1.15.0; python_version =< '3.6'"
setuptools_scm>= 7.0.0; python_version >= '3.7'"

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

0 comments on commit 5d05b3a

Please sign in to comment.