Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: recipe_modules/python/example.resources/test.py

Issue 2875823002: Add vpython support to Python recipe module. (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipe_modules/python/example.resources/test.py
diff --git a/recipe_modules/python/example.resources/test.py b/recipe_modules/python/example.resources/test.py
new file mode 100644
index 0000000000000000000000000000000000000000..1c678a8ca954a59b8c3112f9234421ad5bbdf797
--- /dev/null
+++ b/recipe_modules/python/example.resources/test.py
@@ -0,0 +1,45 @@
+# Copyright 2017 The LUCI Authors. All rights reserved.
+# Use of this source code is governed under the Apache License, Version 2.0
+# that can be found in the LICENSE file.
+
+import argparse
+import os
+import sys
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--verify-enum34', action='store_true')
+ parser.add_argument('--verify-six', action='store_true')
+ opts = parser.parse_args()
+
+ if opts.verify_enum34:
+ import enum
+ assert enum.version == (1, 1, 6)
+ if opts.verify_six:
+ import six
+ assert six.__version__ == '1.10.0'
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
+
+
+##
+# Inline VirtualEnv "vpython" spec.
+#
+# Pick a test package with no dependencies from "/bootstrap/venv.cfg" that
+# differs from the package in "test.vpython" file.
+#
+# This is used in "example.py" along with the "--verify-enum34" flag.
+##
+# [VPYTHON:BEGIN]
+#
+# wheel: <
+# name: "infra/python/wheels/enum34-py2"
+# version: "version:1.1.6"
+# >
+#
+# [VPYTHON:END]
+##
« no previous file with comments | « recipe_modules/python/example.expected/basic.json ('k') | recipe_modules/python/example.resources/test.vpython » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698