-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #623 from consideRatio/pr/adopt-tbump-and-small-de…
…tails maint: use tbump when making releases, update flake8/pytest/pytest-cov config
- Loading branch information
Showing
12 changed files
with
126 additions
and
107 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
# flake8 is used for linting Python code setup to automatically run with | ||
# pre-commit. | ||
# | ||
# ref: https://flake8.pycqa.org/en/latest/user/configuration.html | ||
# | ||
|
||
[flake8] | ||
# Ignore style and complexity | ||
# E: style errors | ||
# W: style warnings | ||
# C: complexity | ||
# F841: local variable assigned but never used | ||
ignore = E, C, W, F841 | ||
# D: docstring warnings (unused pydocstyle extension) | ||
ignore = E, C, W, D | ||
builtins = | ||
c | ||
get_config | ||
exclude = | ||
__init__.py |
This file contains 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 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 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 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 |
---|---|---|
@@ -1,76 +1,60 @@ | ||
# How to make a release | ||
|
||
`oauthenticator` is a package [available on | ||
PyPI](https://pypi.org/project/oauthenticator/) and | ||
[conda-forge](https://conda-forge.org/). These are instructions on how to make a | ||
release on PyPI. The PyPI release is done automatically by TravisCI when a tag | ||
is pushed. | ||
`oauthenticator` is a package available on [PyPI] and on [conda-forge]. | ||
|
||
For you to follow along according to these instructions, you need: | ||
These are the instructions on how to make a release. | ||
|
||
- To have push rights to the [oauthenticator GitHub | ||
repository](https://github.com/jupyterhub/oauthenticator). | ||
## Pre-requisites | ||
|
||
- Push rights to this GitHub repository | ||
|
||
## Steps to make a release | ||
|
||
1. Checkout main and make sure it is up to date. | ||
1. Create a PR updating `CHANGELOG.md` with [github-activity] and continue when | ||
its merged. | ||
|
||
```shell | ||
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo | ||
git checkout main | ||
git fetch $ORIGIN main | ||
git reset --hard $ORIGIN/main | ||
# WARNING! This next command deletes any untracked files in the repo | ||
git clean -xfd | ||
``` | ||
Advice on this procedure can be found in [this team compass | ||
issue](https://github.com/jupyterhub/team-compass/issues/563). | ||
|
||
1. Update [CHANGELOG.md](CHANGELOG.md). Doing this can be made easier with the | ||
help of the | ||
[choldgraf/github-activity](https://github.com/choldgraf/github-activity) | ||
utility. | ||
2. Checkout main and make sure it is up to date. | ||
|
||
1. Set the `version_info` variable in [\_version.py](oauthenticator/_version.py) | ||
appropriately and make a commit. | ||
|
||
``` | ||
git add oauthenticator/_version.py | ||
VERSION=... # e.g. 1.2.3 | ||
git commit -m "release $VERSION" | ||
```shell | ||
git checkout main | ||
git fetch origin main | ||
git reset --hard origin/main | ||
``` | ||
|
||
1. Reset the `version_info` variable in | ||
[\_version.py](oauthenticator/_version.py) appropriately with an incremented | ||
patch version and a `dev` element, then make a commit. | ||
3. Update the version, make commits, and push a git tag with `tbump`. | ||
|
||
``` | ||
git add oauthenticator/_version.py | ||
git commit -m "back to dev" | ||
```shell | ||
pip install tbump | ||
``` | ||
|
||
1. Push your two commits to main. | ||
`tbump` will ask for confirmation before doing anything. | ||
|
||
```shell | ||
# first push commits without a tags to ensure the | ||
# commits comes through, because a tag can otherwise | ||
# be pushed all alone without company of rejected | ||
# commits, and we want have our tagged release coupled | ||
# with a specific commit in main | ||
git push $ORIGIN main | ||
# Example versions to set: 1.0.0, 1.0.0b1 | ||
VERSION= | ||
tbump ${VERSION} | ||
``` | ||
|
||
1. Create a git tag for the pushed release commit and push it. | ||
Following this, the [CI system] will build and publish a release. | ||
|
||
```shell | ||
git tag -a $VERSION -m $VERSION HEAD~1 | ||
4. Reset the version back to dev, e.g. `1.0.1.dev` after releasing `1.0.0`. | ||
|
||
# then verify you tagged the right commit | ||
git log | ||
# then push it | ||
git push $ORIGIN refs/tags/$VERSION | ||
```shell | ||
# Example version to set: 1.0.1.dev | ||
NEXT_VERSION= | ||
tbump --no-tag ${NEXT_VERSION}.dev | ||
``` | ||
|
||
1. Following the release to PyPI, an automated PR should arrive to | ||
[conda-forge/oauthenticator-feedstock](https://github.com/conda-forge/oauthenticator-feedstock), | ||
check for the tests to succeed on this PR and then merge it to successfully | ||
update the package for `conda` on the conda-forge channel. | ||
5. Following the release to PyPI, an automated PR should arrive within 24 hours | ||
to [conda-forge/oauthenticator-feedstock] with instructions on releasing to | ||
conda-forge. You are welcome to volunteer doing this, but aren't required as | ||
part of making this release to PyPI. | ||
[github-activity]: https://github.com/executablebooks/github-activity | ||
[pypi]: https://pypi.org/project/oauthenticator/ | ||
[ci system]: https://github.com/jupyterhub/oauthenticator/actions/workflows/release.yaml | ||
[conda-forge]: https://anaconda.org/conda-forge/oauthenticator | ||
[conda-forge/oauthenticator-feedstock]: https://github.com/conda-forge/oauthenticator-feedstock |
This file contains 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# include github, bitbucket, google here for backward-compatibility | ||
# don't add new oauthenticators here. | ||
from ._version import __version__, version_info | ||
from .bitbucket import * | ||
from .cilogon import * | ||
from .github import * | ||
from .google import * | ||
from .oauth2 import * | ||
from ._version import __version__, version_info # noqa | ||
from .bitbucket import * # noqa | ||
from .cilogon import * # noqa | ||
from .github import * # noqa | ||
from .google import * # noqa | ||
from .oauth2 import * # noqa |
This file contains 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 |
---|---|---|
@@ -1,14 +1,7 @@ | ||
"""oauthenticator version info""" | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
# __version__ should be updated using tbump, based on configuration in | ||
# pyproject.toml, according to instructions in RELEASE.md. | ||
# | ||
__version__ = "15.1.1.dev" | ||
|
||
version_info = ( | ||
15, | ||
1, | ||
1, | ||
'dev', # comment-out this line for a release | ||
) | ||
__version__ = '.'.join(map(str, version_info[:3])) | ||
|
||
if len(version_info) > 3: | ||
__version__ = f'{__version__}{version_info[3]}' | ||
# version_info looks like (1, 2, 3, "dev") if __version__ is 1.2.3.dev | ||
version_info = tuple(int(p) if p.isdigit() else p for p in __version__.split(".")) |
This file contains 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 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 |
---|---|---|
|
@@ -81,7 +81,7 @@ async def test_cilogon_missing_alternate_claim(cilogon_client): | |
alternative_user_model('[email protected]', 'uid') | ||
) | ||
with raises(HTTPError): | ||
auth_model = await authenticator.get_authenticated_user(handler, None) | ||
await authenticator.get_authenticated_user(handler, None) | ||
|
||
|
||
async def test_deprecated_config(caplog): | ||
|
@@ -188,7 +188,7 @@ async def test_allowed_idps_invalid_config_username_derivation_options(caplog): | |
} | ||
} | ||
|
||
with raises(ValidationError, match='Additional properties are not allowed') as e: | ||
with raises(ValidationError, match='Additional properties are not allowed'): | ||
CILogonOAuthenticator(config=cfg) | ||
|
||
|
||
|
@@ -331,7 +331,7 @@ async def test_not_allowed_domains_and_stripping(cilogon_client): | |
|
||
# The domain to be stripped isn't allowed, so it should fail | ||
with raises(HTTPError): | ||
auth_model = await authenticator.get_authenticated_user(handler, None) | ||
await authenticator.get_authenticated_user(handler, None) | ||
|
||
|
||
async def test_allowed_domains_and_stripping(cilogon_client): | ||
|
This file contains 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 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