fune/third_party/python/py/tasks/vendoring.py
Dave Hunt 21f960591b Bug 1464082 - Vendor pytest via |mach vendor python|; r=ahal
Updated to 3.2.5.

MozReview-Commit-ID: 34OG1iGeMVW

--HG--
extra : rebase_source : 3ffa191b142f60897abb0728f53e71b8cda52701
2018-05-24 16:18:27 +01:00

23 lines
760 B
Python

from __future__ import absolute_import, print_function
import py
import invoke
VENDOR_TARGET = py.path.local("py/_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} apipkg iniconfig".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"')