-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix #8820 - ensure the release scripts are ware of release candidates #8825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
RonnyPfannschmidt
wants to merge
1
commit into
pytest-dev:main
from
RonnyPfannschmidt:ronny/fix-8820-release-script-rc-aware
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Ensure prereleases correctly pick the matching changelog template. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,10 @@ | |
|
||
from colorama import Fore | ||
from colorama import init | ||
from packaging.version import Version | ||
|
||
|
||
def announce(version): | ||
def announce(version: Version): | ||
"""Generates a new release announcement entry in the docs.""" | ||
# Get our list of authors | ||
stdout = check_output(["git", "describe", "--abbrev=0", "--tags"]) | ||
|
@@ -22,9 +23,7 @@ def announce(version): | |
|
||
contributors = set(stdout.splitlines()) | ||
|
||
template_name = ( | ||
"release.minor.rst" if version.endswith(".0") else "release.patch.rst" | ||
) | ||
template_name = "release.minor.rst" if version.minor == 0 else "release.patch.rst" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you seen my suggestions:
? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed it before, will check the details, thanks |
||
template_text = ( | ||
Path(__file__).parent.joinpath(template_name).read_text(encoding="UTF-8") | ||
) | ||
|
@@ -63,7 +62,7 @@ def regen(version): | |
print(f"{Fore.CYAN}[generate.regen] {Fore.RESET}Updating docs") | ||
check_call( | ||
["tox", "-e", "regen"], | ||
env={**os.environ, "SETUPTOOLS_SCM_PRETEND_VERSION": version}, | ||
env={**os.environ, "SETUPTOOLS_SCM_PRETEND_VERSION": str(version)}, | ||
) | ||
|
||
|
||
|
@@ -81,7 +80,7 @@ def check_links(): | |
check_call(["tox", "-e", "docs-checklinks"]) | ||
|
||
|
||
def pre_release(version, *, skip_check_links): | ||
def pre_release(version: Version, *, skip_check_links): | ||
"""Generates new docs, release announcements and creates a local tag.""" | ||
announce(version) | ||
regen(version) | ||
|
@@ -99,9 +98,9 @@ def pre_release(version, *, skip_check_links): | |
print("Please push your branch and open a PR.") | ||
|
||
|
||
def changelog(version, write_out=False): | ||
def changelog(version: Version, write_out=False): | ||
addopts = [] if write_out else ["--draft"] | ||
check_call(["towncrier", "--yes", "--version", version] + addopts) | ||
check_call(["towncrier", "--yes", "--version", str(version)] + addopts) | ||
|
||
|
||
def main(): | ||
|
@@ -110,7 +109,7 @@ def main(): | |
parser.add_argument("version", help="Release version") | ||
parser.add_argument("--skip-check-links", action="store_true", default=False) | ||
options = parser.parse_args() | ||
pre_release(options.version, skip_check_links=options.skip_check_links) | ||
pre_release(Version(options.version), skip_check_links=options.skip_check_links) | ||
|
||
|
||
if __name__ == "__main__": | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an user-facing bugfix, so this seems confusing.