-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2523 from RonnyPfannschmidt/vendoring-tasks
Vendoring tasks
- Loading branch information
Showing
3 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Create invoke tasks for updating the vendored packages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"') |