aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Hinds <lhinds@redhat.com>2017-07-13 08:51:46 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-13 08:51:46 +0000
commitc71f9c42c28ab919ea187c9f830197645f87e741 (patch)
treea32ec21d11942e5d9bdbd41924135a2f684508a2
parent41fdcb2323d3b75391e5bdd74497403f58e1a36d (diff)
parentd8339203125f9eafb567f6ae2d784fe532046837 (diff)
Merge "Update Invoke Tasks and use Twine for upload"
-rw-r--r--requirements.txt2
-rw-r--r--tasks.py53
2 files changed, 37 insertions, 18 deletions
diff --git a/requirements.txt b/requirements.txt
index 7a52654..201b07f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,8 +2,10 @@ appdirs==1.4.3
binaryornot==0.4.3
chardet==3.0.2
docopt==0.6.2
+invoke==0.18.0
packaging==16.8
pyaml==16.12.2
pyparsing==2.2.0
PyYAML==3.12
six==1.10.0
+twine==1.9.1
diff --git a/tasks.py b/tasks.py
index 55ac340..30bef4c 100644
--- a/tasks.py
+++ b/tasks.py
@@ -11,47 +11,64 @@ build_dir = os.path.join(docs_dir, '_build')
@task
-def test():
+def test(ctx):
run('python setup.py test', pty=True)
@task
-def clean():
- run("rm -rf build")
- run("rm -rf dist")
- run("rm -rf anteater.egg-info")
- clean_docs()
+def clean(ctx):
+ ctx.run("rm -rf build")
+ ctx.run("rm -rf dist")
+ ctx.run("rm -rf anteater.egg-info")
+ clean_docs(ctx)
print("Cleaned up.")
@task
-def clean_docs():
- run("rm -rf %s" % build_dir)
+def clean_docs(ctx):
+ ctx.run("rm -rf %s" % build_dir)
@task
-def browse_docs():
- run("open %s" % os.path.join(build_dir, 'index.html'))
+def browse_docs(ctx):
+ ctx.run("open %s" % os.path.join(build_dir, 'index.html'))
@task
-def build_docs(clean=False, browse=False):
+def build_docs(ctx, clean=False, browse=False):
if clean:
clean_docs()
- run("sphinx-build %s %s" % (docs_dir, build_dir), pty=True)
+ ctx.run("sphinx-build %s %s" % (docs_dir, build_dir), pty=True)
if browse:
browse_docs()
@task
-def readme(browse=False):
- run('rst2html.py README.rst > README.html')
+def readme(ctx, browse=False):
+ ctx.run('rst2html.py README.rst > README.html')
@task
-def publish(test=False):
- """Publish to the cheeseshop."""
+def build(ctx):
+ """Build source distribution and wheels."""
+ ctx.run('python setup.py sdist bdist_wheel')
+
+
+@task
+def publish(ctx, test=False):
+ """Publish to the cheeseshop.
+
+ This command follows the Python packaging guidelines:
+ https://packaging.python.org/tutorials/distributing-packages
+
+ Information on configuration required for '--test' can be found
+ here: https://wiki.python.org/moin/TestPyPI
+
+ Before uploading please ensure you've signed the release using:
+
+ gpg --detach-sign -a dist/package-1.0.1.tar.gz
+ """
if test:
- run('python setup.py register -r test sdist upload -r test')
+ ctx.run('twine upload -r test dist/*')
else:
- run("python setup.py register sdist upload")
+ ctx.run("twine upload dist/*")