Skip to content

Commit f0323c7

Browse files
authored
Merge pull request #10200 from uranusjr/release-procedure-improvements
2 parents ed4401a + 94dc07a commit f0323c7

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

docs/html/development/release-process.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,17 @@ Release Process
116116
Creating a new release
117117
----------------------
118118

119-
#. Checkout the current pip ``main`` branch.
120119
#. Ensure you have the latest ``nox`` installed.
120+
#. Create a new ``release/YY.N`` branch off ``main`` and switch to it.
121121
#. Prepare for release using ``nox -s prepare-release -- YY.N``.
122122
This will update the relevant files and tag the correct commit.
123+
#. Submit the ``release/YY.N`` branch as a pull request and ensure CI passes.
124+
Merge the changes back into ``main`` and pull them back locally.
123125
#. Build the release artifacts using ``nox -s build-release -- YY.N``.
124126
This will checkout the tag, generate the distribution files to be
125127
uploaded and checkout the main branch again.
126128
#. Upload the release to PyPI using ``nox -s upload-release -- YY.N``.
127-
#. Push all of the changes including the tag.
129+
#. Push the tag created by ``prepare-release``.
128130
#. Regenerate the ``get-pip.py`` script in the `get-pip repository`_ (as
129131
documented there) and commit the results.
130132
#. Submit a Pull Request to `CPython`_ adding the new version of pip (and upgrading
@@ -168,7 +170,7 @@ order to create one of these the changes should already be merged into the
168170
#. Push the ``release/YY.N.Z+1`` branch to github and submit a PR for it against
169171
the ``main`` branch and wait for the tests to run.
170172
#. Once tests run, merge the ``release/YY.N.Z+1`` branch into ``main``, and
171-
follow the above release process starting with step 4.
173+
follow the above release process starting with step 5.
172174

173175
.. _`get-pip repository`: https://github.com/pypa/get-pip
174176
.. _`psf-salt repository`: https://github.com/python/psf-salt

tools/release/__init__.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,23 +175,18 @@ def isolated_temporary_checkout(
175175
git_checkout_dir = tmp_dir / f"pip-build-{target_ref}"
176176
nox_session.run(
177177
# fmt: off
178-
"git", "worktree", "add", "--force", "--checkout",
179-
str(git_checkout_dir), str(target_ref),
178+
"git", "clone",
179+
"--depth", "1",
180+
"--config", "core.autocrlf=false",
181+
"--branch", str(target_ref),
182+
"--",
183+
".", str(git_checkout_dir),
180184
# fmt: on
181185
external=True,
182186
silent=True,
183187
)
184188

185-
try:
186-
yield git_checkout_dir
187-
finally:
188-
nox_session.run(
189-
# fmt: off
190-
"git", "worktree", "remove", "--force", str(git_checkout_dir),
191-
# fmt: on
192-
external=True,
193-
silent=True,
194-
)
189+
yield git_checkout_dir
195190

196191

197192
def get_git_untracked_files() -> Iterator[str]:

0 commit comments

Comments
 (0)