Skip to content

Commit

Permalink
Merge pull request #2523 from RonnyPfannschmidt/vendoring-tasks
Browse files Browse the repository at this point in the history
Vendoring tasks
  • Loading branch information
nicoddemus authored Jun 23, 2017
2 parents bb659fc + b3bf7fc commit 6e2b5a3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/2474.trivial
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Create invoke tasks for updating the vendored packages.
8 changes: 6 additions & 2 deletions tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

import invoke

from . import generate
from . import generate, vendoring

ns = invoke.Collection(generate)

ns = invoke.Collection(
generate,
vendoring
)
23 changes: 23 additions & 0 deletions tasks/vendoring.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from __future__ import absolute_import, print_function
import py
import invoke

VENDOR_TARGET = py.path.local("_pytest/vendored_packages")
GOOD_FILES = 'README.md', '__init__.py'

@invoke.task()
def remove_libs(ctx):
print("removing vendored libs")
for path in VENDOR_TARGET.listdir():
if path.basename not in GOOD_FILES:
print(" ", path)
path.remove()

@invoke.task(pre=[remove_libs])
def update_libs(ctx):
print("installing libs")
ctx.run("pip install -t {target} pluggy".format(target=VENDOR_TARGET))
ctx.run("git add {target}".format(target=VENDOR_TARGET))
print("Please commit to finish the update after running the tests:")
print()
print(' git commit -am "Updated vendored libs"')

0 comments on commit 6e2b5a3

Please sign in to comment.