-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
RFC: Streamlining pytest's git workflow #6571
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,4 @@ notifications: | |
branches: | ||
only: | ||
- master | ||
- features | ||
- 4.6-maintenance | ||
- /^\d+(\.\d+)+$/ | ||
- /^\d+\.\d+\.x$/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,8 +166,6 @@ Short version | |
|
||
#. Fork the repository. | ||
#. Enable and install `pre-commit <https://pre-commit.com>`_ to ensure style-guides and code checks are followed. | ||
#. Target ``master`` for bug fixes and doc changes. | ||
#. Target ``features`` for new features or functionality changes. | ||
#. Follow **PEP-8** for naming and `black <https://github.com/psf/black>`_ for formatting. | ||
#. Tests are run using ``tox``:: | ||
|
||
|
@@ -204,14 +202,10 @@ Here is a simple overview, with pytest-specific bits: | |
|
||
$ git clone [email protected]:YOUR_GITHUB_USERNAME/pytest.git | ||
$ cd pytest | ||
# now, to fix a bug create your own branch off "master": | ||
# now, create your own branch off "master": | ||
|
||
$ git checkout -b your-bugfix-branch-name master | ||
|
||
# or to instead add a feature create your own branch off "features": | ||
|
||
$ git checkout -b your-feature-branch-name features | ||
|
||
Given we have "major.minor.micro" version numbers, bug fixes will usually | ||
be released in micro releases whereas features will be released in | ||
minor releases and incompatible changes in major releases. | ||
|
@@ -294,8 +288,7 @@ Here is a simple overview, with pytest-specific bits: | |
compare: your-branch-name | ||
|
||
base-fork: pytest-dev/pytest | ||
base: master # if it's a bug fix | ||
base: features # if it's a feature | ||
base: master | ||
|
||
|
||
Writing Tests | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,40 +10,38 @@ taking a lot of time to make a new one. | |
pytest releases must be prepared on **Linux** because the docs and examples expect | ||
to be executed on that platform. | ||
|
||
#. Create a branch ``release-X.Y.Z`` with the version for the release. | ||
To release a version ``MAJOR.MINOR.PATCH``, follow these steps: | ||
|
||
* **maintenance releases**: from ``4.6-maintenance``; | ||
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from the | ||
latest ``master`` and push it to the ``pytest-dev/pytest`` repo. | ||
|
||
* **patch releases**: from the latest ``master``; | ||
#. Create a branch ``release-MAJOR.MINOR.PATCH`` from the ``MAJOR.MINOR.x`` branch. | ||
|
||
* **minor releases**: from the latest ``features``; then merge with the latest ``master``; | ||
|
||
Ensure your are in a clean work tree. | ||
Ensure your are updated and in a clean working tree. | ||
|
||
#. Using ``tox``, generate docs, changelog, announcements:: | ||
|
||
$ tox -e release -- <VERSION> | ||
$ tox -e release -- MAJOR.MINOR.PATCH | ||
|
||
This will generate a commit with all the changes ready for pushing. | ||
|
||
#. Open a PR for this branch targeting ``master`` (or ``4.6-maintenance`` for | ||
maintenance releases). | ||
#. Open a PR for the ``release-MAJOR.MINOR.PATCH`` branch targeting ``MAJOR.MINOR.x``. | ||
|
||
#. After all tests pass and the PR has been approved, publish to PyPI by pushing the tag:: | ||
#. After all tests pass and the PR has been approved, tag the release commit | ||
in the ``MAJOR.MINOR.x`` branch and push it. This will publish to PyPI:: | ||
|
||
git tag <VERSION> | ||
git push [email protected]:pytest-dev/pytest.git <VERSION> | ||
git tag MAJOR.MINOR.PATCH | ||
git push [email protected]:pytest-dev/pytest.git MAJOR.MINOR.PATCH | ||
|
||
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_. | ||
|
||
#. Merge the PR. | ||
|
||
#. If this is a maintenance release, cherry-pick the CHANGELOG / announce | ||
files to the ``master`` branch:: | ||
#. Cherry-pick the CHANGELOG / announce files to the ``master`` branch:: | ||
|
||
git fetch --all --prune | ||
git checkout origin/master -b cherry-pick-maintenance-release | ||
git cherry-pick --no-commit -m1 origin/4.6-maintenance | ||
git checkout origin/master -b cherry-pick-release | ||
git cherry-pick --no-commit -m1 origin/MAJOR.MINOR.x | ||
git checkout origin/master -- changelog | ||
git commit # no arguments | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.