From 787ebb838510d2915283c78758a36f7dab636384 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Mon, 8 Nov 2021 10:44:42 -0700 Subject: Initial commit --- myapp/BUILD | 12 ++++++++++++ myapp/myapp.py | 8 ++++++++ myapp/requirements.txt | 1 + 3 files changed, 21 insertions(+) create mode 100644 myapp/BUILD create mode 100644 myapp/myapp.py create mode 100644 myapp/requirements.txt (limited to 'myapp') 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 -- cgit v1.2.3