-
Notifications
You must be signed in to change notification settings - Fork 54
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 #26 from consideRatio/setup-travis-pypi-cd
CI/CD update + a bug found by pytest-flakes?
- Loading branch information
Showing
6 changed files
with
147 additions
and
12 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[bumpversion] | ||
current_version = 0.4.0.dev | ||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z0-9]+))? | ||
tag_name = {new_version} | ||
allow_dirty = True | ||
commit = True | ||
tag = False | ||
serialize = | ||
{major}.{minor}.{patch}.{release} | ||
{major}.{minor}.{patch} | ||
|
||
[bumpversion:file:ltiauthenticator/__init__.py] | ||
|
||
[bumpversion:file:setup.py] | ||
|
||
[bumpversion:part:release] | ||
optional_value = stable | ||
values = | ||
dev | ||
stable | ||
|
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,17 +1,31 @@ | ||
dist: bionic | ||
language: python | ||
sudo: false | ||
python: | ||
- 3.8 | ||
- 3.7 | ||
- 3.6 | ||
- 3.5 | ||
|
||
# install dependencies | ||
# initial step - install dependencies | ||
install: | ||
- pip install --no-cache-dir -e . | ||
- pip install --no-cache-dir -r dev-requirements.txt | ||
- pip install --upgrade pip | ||
- pip install -r dev-requirements.txt | ||
- pip install . | ||
- pip freeze | ||
|
||
# command to run tests | ||
# middle step - run tests | ||
script: | ||
- py.test tests/ | ||
- pytest --verbose --flakes | ||
|
||
matrix: | ||
fast_finish: true | ||
# final step - optionally deploy | ||
deploy: | ||
provider: pypi | ||
user: "__token__" | ||
# password: set by TravisCI's environment variable PYPI_PASSWORD | ||
# ref: https://travis-ci.org/jupyterhub/ltiauthenticator/settings | ||
distributions: sdist bdist_wheel | ||
on: | ||
# Only deploy on tagged commits instead of the default of only doing it to | ||
# the master branch. A tag does not belong specifically to a branch, so | ||
# without this it would fail to deploy for tags. | ||
tags: true |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# How to make a release | ||
|
||
`jupyterhub-ltiauthenticator` is a package [available on | ||
PyPI](https://pypi.org/project/jupyterhub-ltiauthenticator/). These are | ||
instructions on how to make a release on PyPI. The PyPI release is packaged and | ||
published automatically by TravisCI when a git tag is pushed. | ||
|
||
For you to follow along according to these instructions, you need: | ||
- To have push rights to the [ltiauthenticator GitHub | ||
repository](https://github.com/jupyterhub/ltiauthenticator). | ||
|
||
## Steps to make a release | ||
|
||
1. Update [CHANGELOG.md](CHANGELOG.md) if it is not up to date, and verify | ||
[README.md](README.md) has an updated output of running `--help`. Make a PR | ||
to review the CHANGELOG notes. | ||
|
||
To get the foundation of the changelog written, you can install | ||
[github-activity](https://github.com/choldgraf/github-activity) and run | ||
`github-activity --kind pr jupyterhub/ltiauthenticator` after setting up | ||
credentials as described in the project's README.md file. | ||
|
||
1. Once the changelog is up to date, checkout master and make sure it is up to date and clean. | ||
|
||
```bash | ||
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo | ||
git checkout master | ||
git fetch $ORIGIN master | ||
git reset --hard $ORIGIN/master | ||
# WARNING! This next command deletes any untracked files in the repo | ||
git clean -xfd | ||
``` | ||
|
||
1. Update the version with `bump2version` (can be installed with `pip install -r | ||
dev-requirements.txt`) | ||
|
||
```bash | ||
VERSION=... # e.g. 1.2.3 | ||
bump2version --tag --new-version $VERSION - | ||
``` | ||
|
||
1. Reset the version to the next development version with `bump2version` | ||
|
||
```bash | ||
bump2version --no-tag patch | ||
``` | ||
|
||
1. Push your two commits to master along with the annotated tags referencing | ||
commits on master. | ||
|
||
``` | ||
git push --follow-tags $ORIGIN master | ||
``` | ||
|
||
## Manually uploading to PyPI | ||
|
||
We are using CD with Travis to automatically update PyPI, but if you want to do | ||
it manually when you are on a tagged commit in a otherwise cleaned repository, | ||
you can do this. | ||
|
||
1. Package the release | ||
|
||
```bash | ||
python3 setup.py sdist bdist_wheel | ||
``` | ||
|
||
1. Upload it to PyPI | ||
|
||
```bash | ||
twine upload dist/* | ||
``` |
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 +1,3 @@ | ||
bump2version | ||
pytest | ||
pytest-flakes |
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