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

Ensure pip's release process automation works on Windows #7595

Closed
pradyunsg opened this issue Jan 14, 2020 · 9 comments
Closed

Ensure pip's release process automation works on Windows #7595

pradyunsg opened this issue Jan 14, 2020 · 9 comments
Assignees
Labels
auto-locked Outdated issues that have been locked by automation type: maintenance Related to Development and Maintenance Processes

Comments

@pradyunsg
Copy link
Member

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

@pradyunsg pradyunsg added the type: maintenance Related to Development and Maintenance Processes label Jan 14, 2020
@pfmoore
Copy link
Member

pfmoore commented Jan 14, 2020

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 🙂

@pfmoore
Copy link
Member

pfmoore commented Jan 14, 2020

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.

@uranusjr
Copy link
Member

uranusjr commented Jan 14, 2020

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.

@pfmoore
Copy link
Member

pfmoore commented Jan 14, 2020

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).

@pradyunsg
Copy link
Member Author

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! ^.^

@pfmoore
Copy link
Member

pfmoore commented Jan 14, 2020

#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,

@uranusjr
Copy link
Member

uranusjr commented Jan 15, 2020

@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.

@pradyunsg
Copy link
Member Author

Ah, nice round number. :)

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

@pradyunsg
Copy link
Member Author

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

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Feb 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 21, 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 type: maintenance Related to Development and Maintenance Processes
Projects
None yet
Development

No branches or pull requests

3 participants