Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions py/tests/external-deps/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,46 @@ py_library(
)

py_binary(
name = "main",
srcs = ["__main__.py"],
name = "pathing",
srcs = ["pathing.py"],
deps = [
":lib",
"@pypi_django//:wheel",
],
)

genrule(
name = "run_main",
outs = ["out"],
name = "run_pathing",
outs = ["pathing_out"],
cmd = "|".join([
"$(execpath main)",
"$(execpath pathing)",
"""sed "s#$$(pwd)#(pwd)#" """,
"sed 's#^.*execroot/aspect_rules_py/external/python_toolchain_%s#(py_toolchain)#'" % host_platform,
"sed 's#(main, .*)#(main, REDACTED)#'",
]) + "> $(execpath out)",
tools = ["main"],
]) + "> $@",
tools = ["pathing"],
)

py_binary(
name = "click",
srcs = ["click.py"],
deps = [
# Referencing the external py_library rule generated by rules_python
"@pypi_click//:pkg",
],
)

genrule(
name = "run_click",
outs = ["click_out"],
cmd = "$(execpath click) --count 314 > $@",
tools = ["click"],
)

write_source_files(
name = "test",
files = {
"expected": "out",
"expected_pathing": "pathing_out",
"expected_click": "click_out",
},
)
9 changes: 9 additions & 0 deletions py/tests/external-deps/click.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import click

@click.command()
@click.option('--count', default=1)
def cli(count):
click.echo(f"Count = {count}")

if __name__ == '__main__':
cli()
21 changes: 0 additions & 21 deletions py/tests/external-deps/expected

This file was deleted.

1 change: 1 addition & 0 deletions py/tests/external-deps/expected_click
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Count = 314
21 changes: 21 additions & 0 deletions py/tests/external-deps/expected_pathing
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Python: (pwd)/bazel-out/host/bin/py/tests/external-deps/pathing.runfiles/pathing.venv/bin/python3
version: 3.9.10 (main, REDACTED)
[Clang 13.0.1 ]
version info: sys.version_info(major=3, minor=9, micro=10, releaselevel='final', serial=0)
cwd: (pwd)
site-packages folder: ['(pwd)/bazel-out/host/bin/py/tests/external-deps/pathing.runfiles/pathing.venv/lib/python3.9/site-packages']

sys path:
(py_toolchain)/lib/python39.zip
(py_toolchain)/lib/python3.9
(py_toolchain)/lib/python3.9/lib-dynload
(pwd)/bazel-out/host/bin/py/tests/external-deps/pathing.runfiles/pathing.venv/lib/python3.9/site-packages
(pwd)/bazel-out/host/bin/py/tests/external-deps/pathing.runfiles/aspect_rules_py/py/tests/external-deps

Entrypoint Path: (pwd)/bazel-out/host/bin/py/tests/external-deps/pathing.runfiles/aspect_rules_py/py/tests/external-deps/pathing.py

Django location: (pwd)/bazel-out/host/bin/py/tests/external-deps/pathing.runfiles/pathing.venv/lib/python3.9/site-packages/django/__init__.py
Django version: 4.0.2

From lib with wheel dependency: Hello Matt
lib filepath: (pwd)/bazel-out/host/bin/py/tests/external-deps/pathing.runfiles/aspect_rules_py/py/tests/external-deps/lib.py
File renamed without changes.
3 changes: 2 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
django==4.0.2
colorama==0.4.4
colorama==0.4.4
click
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ asgiref==3.5.0 \
--hash=sha256:2f8abc20f7248433085eda803936d98992f1343ddb022065779f37c5da0181d0 \
--hash=sha256:88d59c13d634dcffe0510be048210188edd79aeccb6a6c9028cdad6f31d730a9
# via django
click==8.1.3 \
--hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \
--hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48
# via -r requirements.in
colorama==0.4.4 \
--hash=sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b \
--hash=sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2
Expand Down