From 172396e6a8e19a8142964ca112a56beaf4e87554 Mon Sep 17 00:00:00 2001 From: Jack Danger Date: Mon, 20 Nov 2017 13:17:24 -0800 Subject: [PATCH 1/2] Updating CONTRIBUTING with release instructions --- CONTRIBUTING.md | 25 +++++++++++++++++++++++-- Makefile | 2 +- scripts/bump_version | 22 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100755 scripts/bump_version diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1266d508e..f28083221 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,25 @@ ### Contributing code -If you have improvements to Moto, send us your pull requests! For those -just getting started, Github has a [howto](https://help.github.com/articles/using-pull-requests/). +Moto has a [Code of Conduct](https://github.com/spulec/moto/blob/master/CODE_OF_CONDUCT.md), you can expect to be treated with respect at all times when interacting with this project. + +## Is there a missing feature? + +Moto is easier to contribute to than you probably think. There's [a list of which endpoints have been implemented](https://github.com/spulec/moto/blob/master/IMPLEMENTATION_COVERAGE.md) and we invite you to add new endpoints to existing services or to add new services. + +How to teach Moto to support a new AWS endpoint: + +* Create an issue describing what's missing. This is where we'll all talk about the new addition and help you get it done. +* Create a [pull request](https://help.github.com/articles/using-pull-requests/) and mention the issue # in the PR description. +* Try to add a failing test case. For example, if you're trying to implement `boto3.client('acm').import_certificate()` you'll want to add a new method called `def test_import_certificate` to `tests/test_acm/test_acm.py`. +* If you can also implement the code that gets that test passing that's great. If not, just ask the community for a hand and somebody will assist you. + +# Maintainers + +## Releasing a new version of Moto + +You'll need a PyPi account and a Dockerhub account to release Moto. After we release a new PyPi package we build and push the [motoserver/moto](https://hub.docker.com/r/motoserver/moto/) Docker image. + +* First, `scripts/bump_version` modifies the version and opens a PR +* Then, merge the new pull request +* Finally, generate and ship the new artifacts with `make publish` + diff --git a/Makefile b/Makefile index 99b7f2620..9324a61cd 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ tag_github_release: git tag `python setup.py --version` git push origin `python setup.py --version` -publish: implementation_coverage \ +publish: upload_pypi_artifact \ tag_github_release \ push_dockerhub_image diff --git a/scripts/bump_version b/scripts/bump_version new file mode 100755 index 000000000..53030700e --- /dev/null +++ b/scripts/bump_version @@ -0,0 +1,22 @@ +#!/bin/bash + +main() { + local version=$1 + if [[ -z "${version}" ]]; then + echo "USAGE: $0 1.3.2" + echo "Provide a new version number as an argument to bump the version" + echo -n "Current:" + grep version= setup.py + return 1 + fi + sed -i '' "s/version=.*$/version='${version}',/g" setup.py + git checkout -b version-${version} + # Commit the new version + git commit setup.py -m "bumping to version ${version}" + # Commit an updated IMPLEMENTATION_COVERAGE.md + make implementation_coverage || true + # Open a PR + open https://github.com/spulec/moto/compare/master...version-${version} +} + +main $@ From a4d1319821986536443efa8b0981a3e777ecc963 Mon Sep 17 00:00:00 2001 From: Jack Danger Date: Wed, 27 Dec 2017 11:06:26 -0800 Subject: [PATCH 2/2] Adding comment inviting a future person to help use bumpversion --- scripts/bump_version | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/bump_version b/scripts/bump_version index 53030700e..fe7ec1970 100755 --- a/scripts/bump_version +++ b/scripts/bump_version @@ -9,7 +9,12 @@ main() { grep version= setup.py return 1 fi + + # TODO: replace this with the bumpversion pip package, I couldn't + # figure out how to use that for these files sed -i '' "s/version=.*$/version='${version}',/g" setup.py + sed -i '' "s/__version__ = .*$/__version__ = '${version}',/g" moto/__init__.py + git checkout -b version-${version} # Commit the new version git commit setup.py -m "bumping to version ${version}"