Pip: Ensure pip's release process automation works on Windows

Created on 14 Jan 2020  ·  9Comments  ·  Source: pypa/pip

Given the recent automation added to our release process (see #2314 for details), I know that it'll work on MacOS (and, likely Linux) systems because I've tested that. I expect that it works on Windows, but I've not been able to test that.

It'd be great if someone could try it out on Windows, to make sure things work as expected there as well. This is basically someone running the prepare-release and build-release nox commands, to make sure they work well on Windows.

I've assigned folks that I know run Windows machine and informally agreed to try this when they'd find time to tackle this. If a new contributor wants to try this out, please go through step 1-4 here: https://pip.pypa.io/en/latest/development/release-process/#creating-a-new-release

auto-locked maintenance

All 9 comments

I'll do this later this week, just haven't had the time to set up a proper dev environment on my new laptop yet... But if anyone else wants to test as well, please feel free to do so 🙂

Confirmed that at least the 2 basic commands work:

>nox -s prepare-release -- 20.1
nox > Running session prepare-release
nox > Creating virtual environment (virtualenv) using python.exe in .nox\prepare-release
nox > # Ensure nothing is staged
nox > # Updating AUTHORS.txt
nox > git add AUTHORS.txt
nox > git commit -m Update AUTHORS.txt
nox > # Generating NEWS
nox > pip install towncrier
nox > towncrier --yes --version 20.1
nox > # Bumping for release 20.1
nox > git add src/pip/__init__.py
nox > git commit -m Bump for release
nox > # Tagging release
nox > git tag -m Release 20.1 20.1
nox > # Bumping for development
nox > git add src/pip/__init__.py
nox > git commit -m Bump for development
nox > Session prepare-release was successful.
PS 11:04 [Git: master] {01:55.989} C:\Work\Scratch\pip-reltest
>nox -s build-release -- 20.1
nox > Running session build-release
nox > Creating virtual environment (virtualenv) using python.exe in .nox\build-release
nox > # Ensure no files in dist/
nox > # Install dependencies
nox > pip install setuptools wheel twine
nox > # Checkout the tag
nox > git checkout 20.1
nox > # Build distributions
nox > python setup.py sdist bdist_wheel
nox > # Verify distributions
nox > twine check dist\pip-20.1-py2.py3-none-any.whl dist\pip-20.1.tar.gz
nox > # Checkout the master branch
nox > git checkout master
nox > Session build-release was successful.

The next step is the actual upload, so this is as far as I can go. The steps took about 2 mins and 3 mins respectively on my really slow old laptop, so that's great.

Can I just confirm at the same time that the new process is intended to be run direct on a copy of the pypa/pip repository, and not on a local clone to go via a PR? That's how I read the docs.

It's a really nice, smooth process! Thanks to everyone who worked on it.

The commands also work for me 👍

However I do notice that files written by the commands (AUTHORS.txt, __init__.py, etc.) are in CRLF line endings, generating unnecessary diffs. This is probably because I run Git with core.autocrlf = false (instead of true or input like a normal person would), but maybe it’d still be a good idea to update the scripts to accommodate this edge case? I can probably work on a PR for this.

Good catch.

Also, I just spotted that the scripts remove the definition of main() from src/pip/__init__.py. Looks like they assume there's nothing in there but a version declaration. The problem is tools/automation/release/__init__.py, function update_version_file - I'll work on a PR for this. (Note that this isn't a Windows issue, but a general problem with the assumptions in the automation).

Indeed. Both those PRs sound great! If y'all aren't able to come around to them, I can tackle this later tomorrow.

update_version_file indeed assumes that there's nothing else in the file, so that's definitely a "release blocker" bug (unless we're going to be doing a very manual process). 😐

Thanks for looking into this @pfmoore and @uranusjr! ^.^

7598 created for the version file issue. It's failing on MacOS, which I assume is not the fault of the PR, as we don't have tests for the automation scripts. I'll try to look at the failures later on or maybe tomorrow,

@pradyunsg We only care about Python 3 for the release script, right? I’ve filed #7600 for the line ending thing, but there are some… complications on Python 2.

Ah, nice round number. :)

Yea, no Python 2 -- nox is a Python 3.5+ tool.

Both the PRs merged. Thanks a lot for all you've done here @pfmoore and @uranusjr! ^>^

Was this page helpful?
0 / 5 - 0 ratings