Skip to content
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

Significantly improve release version validation #8020

Conversation

pradyunsg
Copy link
Member

Closes #7952

Notably:

  • Allows pre-releases and post-releases.
    • No alpha or dev releases, only beta.
  • Uses a subprocess to actually do the version validation (sorry Windows users!)
    • Need packaging for validation, but don't want to add that as an extra release process step.

@pradyunsg pradyunsg added type: enhancement Improvements to functionality !release blocker Hold a release until this is resolved C: automation Automated checks, CI etc labels Apr 11, 2020
@pradyunsg pradyunsg added this to the 20.1 milestone Apr 11, 2020
@pradyunsg pradyunsg added the skip news Does not need a NEWS file entry (eg: trivial changes) label Apr 11, 2020
@uranusjr
Copy link
Member

To general idea LGTM. I think this is good to go as long as the implementation works :p

@pradyunsg pradyunsg force-pushed the release/better-version-validation-that-allows-betas branch from f43d24e to de633cd Compare April 11, 2020 18:14
@pradyunsg
Copy link
Member Author

What do you mean by "as long as the implementation works"? It's clearly working. 😝

@pradyunsg
Copy link
Member Author

More seriously though, how exactly did mypy not catch that?

@uranusjr
Copy link
Member

IIUC Mypy only typecheck if eveything function on the code path is somewhat type hinted. I bet it never reached get_version_from_argument because nothing calling it has type hints.

@pradyunsg
Copy link
Member Author

pradyunsg commented Apr 11, 2020

tools/automation/release/__init__.py:14: error: Cannot find implementation or library stub for module named 'nox.sessions'
noxfile.py:12: error: Cannot find implementation or library stub for module named 'nox'

Running w/ a couple of configuration options changed reveals why... nox doesn't have type annotations and we don't install it in the pre-commit environment anyway. Even though we were type-checking that function... it just assigned Any to Session. :)

@pradyunsg
Copy link
Member Author

tools/automation/release/__init__.py:23: note: Revealed type is 'Any'

Theory confirmed. :)

@pradyunsg
Copy link
Member Author

Merging since I have a green tick from @uranusjr and CI. :)

@pradyunsg pradyunsg merged commit 246d169 into pypa:master Apr 11, 2020
@pradyunsg pradyunsg deleted the release/better-version-validation-that-allows-betas branch April 11, 2020 21:07
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: automation Automated checks, CI etc !release blocker Hold a release until this is resolved skip news Does not need a NEWS file entry (eg: trivial changes) type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for pre-releases to our release automation
2 participants