diff --git a/doc/en/Makefile b/doc/en/Makefile index c8d2c8564..1cffbd463 100644 --- a/doc/en/Makefile +++ b/doc/en/Makefile @@ -27,7 +27,6 @@ REGENDOC_ARGS := \ --normalize "/in \d.\d\ds/in 0.12s/" \ --normalize "@/tmp/pytest-of-.*/pytest-\d+@PYTEST_TMPDIR@" \ --normalize "@pytest-(\d+)\\.[^ ,]+@pytest-\1.x.y@" \ - --normalize "@(This is pytest version )(\d+)\\.[^ ,]+@\1\2.x.y@" \ --normalize "@py-(\d+)\\.[^ ,]+@py-\1.x.y@" \ --normalize "@pluggy-(\d+)\\.[.\d,]+@pluggy-\1.x.y@" \ --normalize "@hypothesis-(\d+)\\.[.\d,]+@hypothesis-\1.x.y@" \ diff --git a/scripts/release.py b/scripts/release.py index 466051d7e..443b868f3 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -2,6 +2,7 @@ Invoke development tasks. """ import argparse +import os from pathlib import Path from subprocess import call from subprocess import check_call @@ -65,10 +66,13 @@ def announce(version): check_call(["git", "add", str(target)]) -def regen(): +def regen(version): """Call regendoc tool to update examples and pytest output in the docs.""" print(f"{Fore.CYAN}[generate.regen] {Fore.RESET}Updating docs") - check_call(["tox", "-e", "regen"]) + check_call( + ["tox", "-e", "regen"], + env={**os.environ, "SETUPTOOLS_SCM_PRETEND_VERSION": version}, + ) def fix_formatting(): @@ -88,13 +92,13 @@ def check_links(): def pre_release(version, *, skip_check_links): """Generates new docs, release announcements and creates a local tag.""" announce(version) - regen() + regen(version) changelog(version, write_out=True) fix_formatting() if not skip_check_links: check_links() - msg = "Preparing release version {}".format(version) + msg = "Prepare release version {}".format(version) check_call(["git", "commit", "-a", "-m", msg]) print() diff --git a/tox.ini b/tox.ini index affb4a7a9..c8165a3c3 100644 --- a/tox.ini +++ b/tox.ini @@ -97,8 +97,8 @@ commands = [testenv:regen] changedir = doc/en -skipsdist = True basepython = python3 +passenv = SETUPTOOLS_SCM_PRETEND_VERSION deps = dataclasses PyYAML