aboutsummaryrefslogtreecommitdiff
path: root/myapp
diff options
context:
space:
mode:
Diffstat (limited to 'myapp')
-rw-r--r--myapp/BUILD12
-rw-r--r--myapp/myapp.py8
-rw-r--r--myapp/requirements.txt1
3 files changed, 21 insertions, 0 deletions
diff --git a/myapp/BUILD b/myapp/BUILD
new file mode 100644
index 0000000..4061830
--- /dev/null
+++ b/myapp/BUILD
@@ -0,0 +1,12 @@
+python_library()
+
+# You don't need to pass in 'requirements_relpath' if the file
+# is called 'requirements.txt' but I added this just for explicitness
+python_requirements(requirements_relpath="requirements.txt")
+
+pex_binary(
+ name="pex",
+ dependencies=["mylib"],
+ entry_point="myapp.py",
+ interpreter_constraints=["CPython==3.6.15"],
+)
diff --git a/myapp/myapp.py b/myapp/myapp.py
new file mode 100644
index 0000000..7f5c16b
--- /dev/null
+++ b/myapp/myapp.py
@@ -0,0 +1,8 @@
+import requests
+
+import mylib
+
+
+print(requests.get("https://www.google.com"))
+print(requests.__version__)
+mylib.hello_world()
diff --git a/myapp/requirements.txt b/myapp/requirements.txt
new file mode 100644
index 0000000..7d34355
--- /dev/null
+++ b/myapp/requirements.txt
@@ -0,0 +1 @@
+requests==2.25.0