diff options
-rw-r--r-- | docs/doing-a-release.rst | 27 | ||||
-rw-r--r-- | docs/index.rst | 1 | ||||
-rw-r--r-- | tasks.py | 26 |
3 files changed, 28 insertions, 26 deletions
diff --git a/docs/doing-a-release.rst b/docs/doing-a-release.rst new file mode 100644 index 00000000..81349a70 --- /dev/null +++ b/docs/doing-a-release.rst @@ -0,0 +1,27 @@ +Doing a Release +=============== + +Doing a release of ``cryptography`` is a two part process. + +Bumping the version number +-------------------------- + +The first step in doing a release is bumping the version number in the +software. + +* Update the version number in ``cryptography/__about__.py`` and + ``docs/conf.py``. +* Do a commit indicating this. +* Send a pull request with this. +* Wait for it to be merged. + +Performing the release +---------------------- + +The commit which merged the version number bump is now the official release +commit for this release. Once this has happened: + +* Run ``invoke release {version}``. + +That's all, the release should now be available on PyPI and a tag should be +available in the repository. diff --git a/docs/index.rst b/docs/index.rst index 5eb3de7d..24d6d204 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -78,4 +78,5 @@ The ``cryptography`` open source project contributing security api-stability + doing-a-release community @@ -12,40 +12,14 @@ # limitations under the License. from __future__ import absolute_import, division, print_function -import os -import re - import invoke -def update_version(filename, identifier, version): - path = os.path.join(os.path.dirname(__file__), filename) - with open(path) as f: - contents = f.read() - contents = re.sub( - r"^{} = .*?$".format(identifier), - '{} = "{}"'.format(identifier, version), - contents, - flags=re.MULTILINE - ) - with open(path, "w") as f: - f.write(contents) - - @invoke.task def release(version): """ ``version`` should be a string like '0.4' or '1.0'. """ - # This checks for changes in the repo. - invoke.run("git diff-index --quiet HEAD") - - update_version("cryptography/__about__.py", "__version__", version) - update_version("docs/conf.py", "version", version) - update_version("docs/conf.py", "release", version) - - invoke.run("git commit -am 'Bump version numbers for release.'") - invoke.run("git push") invoke.run("git tag -s {}".format(version)) invoke.run("git push --tags") |