From c275c9d86711136cef2afabd91887505330a6430 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 9 Dec 2016 10:26:26 -0800 Subject: Weave in newer release invocations tasks --- tasks.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'tasks.py') diff --git a/tasks.py b/tasks.py index 90ee758c..61319aa9 100644 --- a/tasks.py +++ b/tasks.py @@ -4,7 +4,7 @@ from shutil import rmtree, copytree 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,10 +24,12 @@ 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, 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") @@ -41,5 +43,22 @@ def release(ctx, sdist=True, wheel=True, sign=True, dry_run=False): # Remind print("\n\nDon't forget to update RTD's versions page for new minor releases!") +# 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, docs, www, sites) +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', + ), + }, +}) -- cgit v1.2.1