summaryrefslogtreecommitdiffhomepage
path: root/tasks.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-06-06 12:31:57 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-06-06 12:31:57 -0700
commita2da21d46bb9a441dbb8da570262bb424e1f9450 (patch)
tree8e1c7bdd402fb640f75b061bc2051f5fe6eba676 /tasks.py
parent79fcbdad812cc3be39afbf8375c11e0581eeb86e (diff)
parentd285b80ecb6102b0ad501b74d02e04d61e8ec632 (diff)
Merge branch '2.0' into 667-int
Diffstat (limited to 'tasks.py')
-rw-r--r--tasks.py38
1 files changed, 29 insertions, 9 deletions
diff --git a/tasks.py b/tasks.py
index d2bed606..42c18bd0 100644
--- a/tasks.py
+++ b/tasks.py
@@ -1,10 +1,9 @@
-from os import mkdir
from os.path import join
from shutil import rmtree, copytree
-from invoke import Collection, ctask as task
+from invoke import Collection, task
from invocations.docs import docs, www, sites
-from invocations.packaging import publish
+from invocations.packaging.release import ns as release_coll, publish
# Until we move to spec-based testing
@@ -24,22 +23,43 @@ def coverage(ctx):
# Until we stop bundling docs w/ releases. Need to discover use cases first.
+# TODO: would be nice to tie this into our own version of build() too, but
+# still have publish() use that build()...really need to try out classes!
@task
-def release(ctx, sdist=True, wheel=True):
+def release(ctx, sdist=True, wheel=True, sign=True, dry_run=False):
"""
- Wraps invocations.packaging.release to add baked-in docs folder.
+ Wraps invocations.packaging.publish to add baked-in docs folder.
"""
# Build docs first. Use terribad workaround pending invoke #146
- ctx.run("inv docs")
+ ctx.run("inv docs", pty=True, hide=False)
# Move the built docs into where Epydocs used to live
target = 'docs'
rmtree(target, ignore_errors=True)
# TODO: make it easier to yank out this config val from the docs coll
copytree('sites/docs/_build', target)
# Publish
- publish(ctx, sdist=sdist, wheel=wheel)
+ publish(ctx, sdist=sdist, wheel=wheel, sign=sign, dry_run=dry_run)
# Remind
- print("\n\nDon't forget to update RTD's versions page for new minor releases!")
+ print("\n\nDon't forget to update RTD's versions page for new minor "
+ "releases!")
-ns = Collection(test, coverage, release, docs, www, sites)
+# TODO: "replace one task with another" needs a better public API, this is
+# using unpublished internals & skips all the stuff add_task() does re:
+# aliasing, defaults etc.
+release_coll.tasks['publish'] = release
+
+ns = Collection(test, coverage, release_coll, docs, www, sites)
+ns.configure({
+ 'packaging': {
+ # NOTE: many of these are also set in kwarg defaults above; but having
+ # them here too means once we get rid of our custom release(), the
+ # behavior stays.
+ 'sign': True,
+ 'wheel': True,
+ 'changelog_file': join(
+ www.configuration()['sphinx']['source'],
+ 'changelog.rst',
+ ),
+ },
+})