aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-05-20 14:37:40 -0700
committerPaul Kehrer <paul.l.kehrer@gmail.com>2017-05-20 14:37:40 -0700
commitc7dd9de42ff93d94757a339fe3bf39dc42cd86f9 (patch)
treec0ba69fb7d2b63480e6f56cb27110d759cd3975e
parenta4668c6593005822ff6d655b7034e1c5eebfa1fd (diff)
downloadcryptography-c7dd9de42ff93d94757a339fe3bf39dc42cd86f9.tar.gz
cryptography-c7dd9de42ff93d94757a339fe3bf39dc42cd86f9.tar.bz2
cryptography-c7dd9de42ff93d94757a339fe3bf39dc42cd86f9.zip
Replace release automation with click (#3557)
* Replace release automation with click * Fix * fix
-rw-r--r--dev-requirements.txt2
-rw-r--r--docs/doing-a-release.rst2
-rw-r--r--release.py (renamed from tasks.py)33
3 files changed, 24 insertions, 13 deletions
diff --git a/dev-requirements.txt b/dev-requirements.txt
index ab458448..3213f1e5 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,6 +1,6 @@
+click
clint
coverage
-invoke
requests
tox >= 2.4.1
twine
diff --git a/docs/doing-a-release.rst b/docs/doing-a-release.rst
index 2da2c80a..7cf012bb 100644
--- a/docs/doing-a-release.rst
+++ b/docs/doing-a-release.rst
@@ -42,7 +42,7 @@ The commit that merged the version number bump is now the official release
commit for this release. You will need to have ``gpg`` installed and a ``gpg``
key in order to do a release. Once this has happened:
-* Run ``invoke release {version}``.
+* Run ``python release.py {version}``.
The release should now be available on PyPI and a tag should be available in
the repository.
diff --git a/tasks.py b/release.py
index 2051093e..7e2c1d81 100644
--- a/tasks.py
+++ b/release.py
@@ -7,11 +7,12 @@ from __future__ import absolute_import, division, print_function
import getpass
import io
import os
+import subprocess
import time
-from clint.textui.progress import Bar as ProgressBar
+import click
-import invoke
+from clint.textui.progress import Bar as ProgressBar
import requests
@@ -19,6 +20,11 @@ import requests
JENKINS_URL = "https://jenkins.cryptography.io/job/cryptography-wheel-builder"
+def run(*args, **kwargs):
+ kwargs.setdefault("stderr", subprocess.STDOUT)
+ subprocess.check_output(list(args), **kwargs)
+
+
def wait_for_build_completed(session):
# Wait 20 seconds before actually checking if the build is complete, to
# ensure that it had time to really start.
@@ -95,20 +101,21 @@ def download_artifacts(session):
return paths
-@invoke.task
+@click.command()
+@click.argument("version")
def release(version):
"""
``version`` should be a string like '0.4' or '1.0'.
"""
- invoke.run("git tag -s {0} -m '{0} release'".format(version))
- invoke.run("git push --tags")
+ run("git", "tag", "-s", version, "-m", "{0} release".format(version))
+ run("git", "push", "--tags")
- invoke.run("python setup.py sdist")
- invoke.run("cd vectors/ && python setup.py sdist bdist_wheel")
+ run("python", "setup.py", "sdist")
+ run("python", "setup.py", "sdist", "bdist_wheel", cwd="vectors/")
- invoke.run(
- "twine upload -s dist/cryptography-{0}* "
- "vectors/dist/cryptography_vectors-{0}*".format(version)
+ run(
+ "twine", "upload", "-s", "dist/cryptography-{0}*".format(version),
+ "vectors/dist/cryptography_vectors-{0}*".format(version), shell=True
)
session = requests.Session()
@@ -135,4 +142,8 @@ def release(version):
response.raise_for_status()
wait_for_build_completed(session)
paths = download_artifacts(session)
- invoke.run("twine upload {0}".format(" ".join(paths)))
+ run("twine", "upload", " ".join(paths))
+
+
+if __name__ == "__main__":
+ release()