Skip to content

Automated releases - Round 1#265

Merged
pradyunsg merged 7 commits intopypa:masterfrom
pradyunsg:automated-releases
Jan 28, 2020
Merged

Automated releases - Round 1#265
pradyunsg merged 7 commits intopypa:masterfrom
pradyunsg:automated-releases

Conversation

@pradyunsg
Copy link
Copy Markdown
Member

Toward #253

Adds a nox -s release -- YY.N step, to make it easier to do a release. In this PR, nearly all of the release process is automated -- the only remaining bit is the CHANGELOG, which we should probably tackle in a follow up.

With this automation, chances are you'd still be prompted for a password for either git commits (if you sign commits by default) and/or prior to making the actual PyPI publish (if you're not storing PyPI passwords in .pypirc).

The automation also introduces a bunch of "sanity" checks, to protect against known bad-things in the environment, like misconfigured git remotes and dirty build directories (like, the things that have caused #260 or pypa/pip#7620). :)

nox is a Python 3.5+ tool.
# Not all segments are integers.
raise ValueError("non-integer segments")

# All is good.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth checking that the major version is 9 < major < 100 to basically make sure it's double digits?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, because we know that packaging is CalVer, I guess we could add a constraint of major == current_year % 100 here.

This can be done in a follow up though, and I'd prefer that. :)



def _bump(session, *, version, file, kind):
session.log(f"Bump version to {version!r}")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only logging here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is comparing to _check_working_directory_state and _check_git_state.

That's because this call is actually making changes to the sources / git repository. I'd guessed that it'd be a good idea to have clear indicators of what changes are being made as we go (in the output itself).

@pradyunsg
Copy link
Copy Markdown
Member Author

Alrighty, I've added in all the suggested changes here. Given that there's a green tick and none of the remaining comments look like blockers to me, I'm gonna go ahead and merge this PR. :)

@pradyunsg pradyunsg merged commit 939b28b into pypa:master Jan 28, 2020
@pradyunsg pradyunsg deleted the automated-releases branch January 28, 2020 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants