Skip to content

Commit dc244cf

Browse files
bluetechblueyed
andcommitted
Switch to new git workflow
Co-Authored-By: Daniel Hahler <[email protected]>
1 parent 3645ba3 commit dc244cf

8 files changed

+26
-37
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ Thanks for submitting a PR, your contribution is really appreciated!
33
44
Here is a quick checklist that should be present in PRs.
55
6-
- [ ] Target the `master` branch for bug fixes, documentation updates and trivial changes.
7-
- [ ] Target the `features` branch for new features, improvements, and removals/deprecations.
86
- [ ] Include documentation when adding new features.
97
- [ ] Include new tests or update existing tests when applicable.
108

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ on:
1010
push:
1111
branches:
1212
- master
13+
- "[0-9]+.[0-9]+.x"
1314
tags:
1415
- "*"
1516

1617
pull_request:
1718
branches:
1819
- master
20+
- "[0-9]+.[0-9]+.x"
1921

2022
jobs:
2123
build:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ repos:
4747
- id: rst
4848
name: rst
4949
entry: rst-lint --encoding utf-8
50-
files: ^(HOWTORELEASE.rst|README.rst|TIDELIFT.rst)$
50+
files: ^(RELEASING.rst|README.rst|TIDELIFT.rst)$
5151
language: python
5252
additional_dependencies: [pygments, restructuredtext_lint]
5353
- id: changelogs-rst

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,4 @@ notifications:
8282
branches:
8383
only:
8484
- master
85-
- features
86-
- 4.6-maintenance
87-
- /^\d+(\.\d+)+$/
85+
- /^\d+\.\d+\.x$/

CONTRIBUTING.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ Short version
166166

167167
#. Fork the repository.
168168
#. Enable and install `pre-commit <https://pre-commit.com>`_ to ensure style-guides and code checks are followed.
169-
#. Target ``master`` for bug fixes and doc changes.
170-
#. Target ``features`` for new features or functionality changes.
171169
#. Follow **PEP-8** for naming and `black <https://github.com/psf/black>`_ for formatting.
172170
#. Tests are run using ``tox``::
173171

@@ -204,14 +202,10 @@ Here is a simple overview, with pytest-specific bits:
204202

205203
$ git clone [email protected]:YOUR_GITHUB_USERNAME/pytest.git
206204
$ cd pytest
207-
# now, to fix a bug create your own branch off "master":
205+
# now, create your own branch off "master":
208206

209207
$ git checkout -b your-bugfix-branch-name master
210208

211-
# or to instead add a feature create your own branch off "features":
212-
213-
$ git checkout -b your-feature-branch-name features
214-
215209
Given we have "major.minor.micro" version numbers, bug fixes will usually
216210
be released in micro releases whereas features will be released in
217211
minor releases and incompatible changes in major releases.
@@ -294,8 +288,7 @@ Here is a simple overview, with pytest-specific bits:
294288
compare: your-branch-name
295289

296290
base-fork: pytest-dev/pytest
297-
base: master # if it's a bug fix
298-
base: features # if it's a feature
291+
base: master
299292

300293

301294
Writing Tests

HOWTORELEASE.rst renamed to RELEASING.rst

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,38 @@ taking a lot of time to make a new one.
1010
pytest releases must be prepared on **Linux** because the docs and examples expect
1111
to be executed on that platform.
1212

13-
#. Create a branch ``release-X.Y.Z`` with the version for the release.
13+
To release a version ``MAJOR.MINOR.PATCH``, follow these steps:
1414

15-
* **maintenance releases**: from ``4.6-maintenance``;
15+
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from the
16+
latest ``master`` and push it to the ``pytest-dev/pytest`` repo.
1617

17-
* **patch releases**: from the latest ``master``;
18+
#. Create a branch ``release-MAJOR.MINOR.PATCH`` from the ``MAJOR.MINOR.x`` branch.
1819

19-
* **minor releases**: from the latest ``features``; then merge with the latest ``master``;
20-
21-
Ensure your are in a clean work tree.
20+
Ensure your are updated and in a clean working tree.
2221

2322
#. Using ``tox``, generate docs, changelog, announcements::
2423

25-
$ tox -e release -- <VERSION>
24+
$ tox -e release -- MAJOR.MINOR.PATCH
2625

2726
This will generate a commit with all the changes ready for pushing.
2827

29-
#. Open a PR for this branch targeting ``master`` (or ``4.6-maintenance`` for
30-
maintenance releases).
28+
#. Open a PR for the ``release-MAJOR.MINOR.PATCH`` branch targeting ``MAJOR.MINOR.x``.
3129

32-
#. After all tests pass and the PR has been approved, publish to PyPI by pushing the tag::
30+
#. After all tests pass and the PR has been approved, tag the release commit
31+
in the ``MAJOR.MINOR.x`` branch and push it. This will publish to PyPI::
3332

34-
git tag <VERSION>
35-
git push [email protected]:pytest-dev/pytest.git <VERSION>
33+
git tag MAJOR.MINOR.PATCH
34+
git push [email protected]:pytest-dev/pytest.git MAJOR.MINOR.PATCH
3635

3736
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
3837

3938
#. Merge the PR.
4039

41-
#. If this is a maintenance release, cherry-pick the CHANGELOG / announce
42-
files to the ``master`` branch::
40+
#. Cherry-pick the CHANGELOG / announce files to the ``master`` branch::
4341

4442
git fetch --all --prune
45-
git checkout origin/master -b cherry-pick-maintenance-release
46-
git cherry-pick --no-commit -m1 origin/4.6-maintenance
43+
git checkout origin/master -b cherry-pick-release
44+
git cherry-pick --no-commit -m1 origin/MAJOR.MINOR.x
4745
git checkout origin/master -- changelog
4846
git commit # no arguments
4947

doc/en/development_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ Issues created at those events should have other relevant labels added as well.
5757
Those labels should be removed after they are no longer relevant.
5858

5959

60-
.. include:: ../../HOWTORELEASE.rst
60+
.. include:: ../../RELEASING.rst

doc/en/py27-py34-deprecation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Maintenance of 4.6.X versions
2929
-----------------------------
3030

3131
Until January 2020, the pytest core team ported many bug-fixes from the main release into the
32-
``4.6-maintenance`` branch, with several 4.6.X releases being made along the year.
32+
``4.6.x`` branch, with several 4.6.X releases being made along the year.
3333

34-
From now on, the core team will **no longer actively backport patches**, but the ``4.6-maintenance``
34+
From now on, the core team will **no longer actively backport patches**, but the ``4.6.x``
3535
branch will continue to exist so the community itself can contribute patches.
3636

3737
The core team will be happy to accept those patches, and make new 4.6.X releases **until mid-2020**
@@ -74,22 +74,22 @@ Please follow these instructions:
7474

7575
#. ``git fetch --all --prune``
7676

77-
#. ``git checkout origin/4.6-maintenance -b backport-XXXX`` # use the PR number here
77+
#. ``git checkout origin/4.6.x -b backport-XXXX`` # use the PR number here
7878

7979
#. Locate the merge commit on the PR, in the *merged* message, for example:
8080

8181
nicoddemus merged commit 0f8b462 into pytest-dev:features
8282

8383
#. ``git cherry-pick -m1 REVISION`` # use the revision you found above (``0f8b462``).
8484

85-
#. Open a PR targeting ``4.6-maintenance``:
85+
#. Open a PR targeting ``4.6.x``:
8686

8787
* Prefix the message with ``[4.6]`` so it is an obvious backport
8888
* Delete the PR body, it usually contains a duplicate commit message.
8989

9090
**Providing new PRs to 4.6**
9191

92-
Fresh pull requests to ``4.6-maintenance`` will be accepted provided that
92+
Fresh pull requests to ``4.6.x`` will be accepted provided that
9393
the equivalent code in the active branches does not contain that bug (for example, a bug is specific
9494
to Python 2 only).
9595

0 commit comments

Comments
 (0)