Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0892c77

Browse files
committedOct 2, 2021
fixes pytest-dev#8133: mitigate regendoc issues wrt PRETEND_VERSION
this issues is less likely to hit due to the recent regendoc release which includes a wheel * migrate to setuptools_scm 6.3.2 * use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
1 parent 0fbfd1c commit 0892c77

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed
 

‎.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
- name: Install dependencies
223223
run: |
224224
python -m pip install --upgrade pip
225-
pip install --upgrade wheel setuptools tox
225+
pip install --upgrade wheel setuptools setuptools_scm[toml]>=6 tox
226226
227227
- name: Build package
228228
run: |

‎changelog/8133.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Migrate to setuptools_scm 6.x to use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST for more robust release tooling.

‎pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[build-system]
22
requires = [
33
# sync with setup.py until we discard non-pep-517/518
4-
"setuptools>=42.0",
5-
"setuptools-scm[toml]>=3.4",
4+
"setuptools>=45.0",
5+
"setuptools-scm[toml]>=6.2.3",
66
"wheel",
77
]
88
build-backend = "setuptools.build_meta"

‎scripts/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def regen(version):
6363
print(f"{Fore.CYAN}[generate.regen] {Fore.RESET}Updating docs")
6464
check_call(
6565
["tox", "-e", "regen"],
66-
env={**os.environ, "SETUPTOOLS_SCM_PRETEND_VERSION": version},
66+
env={**os.environ, "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST": version},
6767
)
6868

6969

‎setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ python_requires = >=3.6
5555
package_dir =
5656
=src
5757
setup_requires =
58-
setuptools>=42.0
59-
setuptools-scm>=3.4
58+
setuptools
59+
setuptools-scm>=6.0
6060
zip_safe = no
6161

6262
[options.entry_points]

‎tox.ini

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ envlist =
1717
docs
1818
docs-checklinks
1919

20+
21+
2022
[testenv]
2123
commands =
2224
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest {posargs:{env:_PYTEST_TOX_DEFAULT_POSARGS:}}
2325
doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest
2426
coverage: coverage combine
2527
coverage: coverage report -m
26-
passenv = USER USERNAME COVERAGE_* PYTEST_ADDOPTS TERM
28+
passenv = USER USERNAME COVERAGE_* PYTEST_ADDOPTS TERM SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
2729
setenv =
2830
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:}
2931

@@ -83,10 +85,7 @@ commands =
8385
[testenv:regen]
8486
changedir = doc/en
8587
basepython = python3
86-
passenv = SETUPTOOLS_SCM_PRETEND_VERSION
87-
# TODO: When setuptools-scm 5.0.0 is released, use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
88-
# and remove the next line.
89-
install_command=python -m pip --use-deprecated=legacy-resolver install {opts} {packages}
88+
passenv = SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
9089
deps =
9190
dataclasses
9291
PyYAML
@@ -112,8 +111,6 @@ changedir = testing/plugins_integration
112111
deps = -rtesting/plugins_integration/requirements.txt
113112
setenv =
114113
PYTHONPATH=.
115-
# due to pytest-rerunfailures requiring 6.2+; can be removed after 6.2.0
116-
SETUPTOOLS_SCM_PRETEND_VERSION=6.2.0a1
117114
commands =
118115
pip check
119116
pytest bdd_wallet.py
@@ -180,6 +177,7 @@ extend-ignore =
180177
; Docstring Content Issues
181178
D400,D401,D401,D402,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414,D415,D416,D417
182179

180+
183181
[isort]
184182
; This config mimics what reorder-python-imports does.
185183
force_single_line = 1

0 commit comments

Comments
 (0)
Please sign in to comment.