From bceb41edeb316bb9ecad955834d719d86c7f8754 Mon Sep 17 00:00:00 2001 From: Stephen Tridgell Date: Fri, 25 Feb 2022 11:49:26 +1100 Subject: [PATCH] Added psutils dependency. Previously this required a locally installed version. --- BUILD | 11 +++++++++++ WORKSPACE | 23 +++++++++++++++++++++++ requirements.in | 1 + requirements.txt | 40 ++++++++++++++++++++++++++++++++++++++++ vivado/tools/BUILD | 9 +++++++-- 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 BUILD create mode 100644 requirements.in create mode 100644 requirements.txt diff --git a/BUILD b/BUILD new file mode 100644 index 0000000..5d9288a --- /dev/null +++ b/BUILD @@ -0,0 +1,11 @@ +load("@rules_python//python:pip.bzl", "compile_pip_requirements") + +exports_files([ + "requirements.txt", + "requirements.in", +]) + +compile_pip_requirements( + name = "requirements", + extra_args = ["--allow-unsafe"], +) diff --git a/WORKSPACE b/WORKSPACE index 54e96da..5e68423 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,7 +1,30 @@ workspace(name = "rules_vivado") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@rules_vivado//vivado:direct_repositories.bzl", "rules_vivado_direct_deps") + rules_vivado_direct_deps() load("@rules_vivado//vivado:indirect_repositories.bzl", "rules_vivado_indirect_deps") + rules_vivado_indirect_deps() + +http_archive( + name = "rules_python", + sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332", + urls = [ + "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz", + ], +) + +load("@rules_python//python:pip.bzl", "pip_parse") + +pip_parse( + name = "pip", + requirements_lock = "//:requirements.txt", +) + +load("@pip//:requirements.bzl", "install_deps") + +install_deps() diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..7a87122 --- /dev/null +++ b/requirements.in @@ -0,0 +1 @@ +psutil==5.9.0 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..49e3e96 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,40 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# bazel run //:requirements.update +# +psutil==5.9.0 \ + --hash=sha256:072664401ae6e7c1bfb878c65d7282d4b4391f1bc9a56d5e03b5a490403271b5 \ + --hash=sha256:1070a9b287846a21a5d572d6dddd369517510b68710fca56b0e9e02fd24bed9a \ + --hash=sha256:1d7b433519b9a38192dfda962dd8f44446668c009833e1429a52424624f408b4 \ + --hash=sha256:3151a58f0fbd8942ba94f7c31c7e6b310d2989f4da74fcbf28b934374e9bf841 \ + --hash=sha256:32acf55cb9a8cbfb29167cd005951df81b567099295291bcfd1027365b36591d \ + --hash=sha256:3611e87eea393f779a35b192b46a164b1d01167c9d323dda9b1e527ea69d697d \ + --hash=sha256:3d00a664e31921009a84367266b35ba0aac04a2a6cad09c550a89041034d19a0 \ + --hash=sha256:4e2fb92e3aeae3ec3b7b66c528981fd327fb93fd906a77215200404444ec1845 \ + --hash=sha256:539e429da49c5d27d5a58e3563886057f8fc3868a5547b4f1876d9c0f007bccf \ + --hash=sha256:55ce319452e3d139e25d6c3f85a1acf12d1607ddedea5e35fb47a552c051161b \ + --hash=sha256:58c7d923dc209225600aec73aa2c4ae8ea33b1ab31bc11ef8a5933b027476f07 \ + --hash=sha256:7336292a13a80eb93c21f36bde4328aa748a04b68c13d01dfddd67fc13fd0618 \ + --hash=sha256:742c34fff804f34f62659279ed5c5b723bb0195e9d7bd9907591de9f8f6558e2 \ + --hash=sha256:7641300de73e4909e5d148e90cc3142fb890079e1525a840cf0dfd39195239fd \ + --hash=sha256:76cebf84aac1d6da5b63df11fe0d377b46b7b500d892284068bacccf12f20666 \ + --hash=sha256:7779be4025c540d1d65a2de3f30caeacc49ae7a2152108adeaf42c7534a115ce \ + --hash=sha256:7d190ee2eaef7831163f254dc58f6d2e2a22e27382b936aab51c835fc080c3d3 \ + --hash=sha256:8293942e4ce0c5689821f65ce6522ce4786d02af57f13c0195b40e1edb1db61d \ + --hash=sha256:869842dbd66bb80c3217158e629d6fceaecc3a3166d3d1faee515b05dd26ca25 \ + --hash=sha256:90a58b9fcae2dbfe4ba852b57bd4a1dded6b990a33d6428c7614b7d48eccb492 \ + --hash=sha256:9b51917c1af3fa35a3f2dabd7ba96a2a4f19df3dec911da73875e1edaf22a40b \ + --hash=sha256:b2237f35c4bbae932ee98902a08050a27821f8f6dfa880a47195e5993af4702d \ + --hash=sha256:c3400cae15bdb449d518545cbd5b649117de54e3596ded84aacabfbb3297ead2 \ + --hash=sha256:c51f1af02334e4b516ec221ee26b8fdf105032418ca5a5ab9737e8c87dafe203 \ + --hash=sha256:cb8d10461c1ceee0c25a64f2dd54872b70b89c26419e147a05a10b753ad36ec2 \ + --hash=sha256:d62a2796e08dd024b8179bd441cb714e0f81226c352c802fca0fd3f89eeacd94 \ + --hash=sha256:df2c8bd48fb83a8408c8390b143c6a6fa10cb1a674ca664954de193fdcab36a9 \ + --hash=sha256:e5c783d0b1ad6ca8a5d3e7b680468c9c926b804be83a3a8e95141b05c39c9f64 \ + --hash=sha256:e9805fed4f2a81de98ae5fe38b75a74c6e6ad2df8a5c479594c7629a1fe35f56 \ + --hash=sha256:ea42d747c5f71b5ccaa6897b216a7dadb9f52c72a0fe2b872ef7d3e1eacf3ba3 \ + --hash=sha256:ef216cc9feb60634bda2f341a9559ac594e2eeaadd0ba187a4c2eb5b5d40b91c \ + --hash=sha256:ff0d41f8b3e9ebb6b6110057e40019a432e96aae2008951121ba4e56040b84f3 + # via -r requirements.in diff --git a/vivado/tools/BUILD b/vivado/tools/BUILD index 59843ad..7238a19 100644 --- a/vivado/tools/BUILD +++ b/vivado/tools/BUILD @@ -1,18 +1,23 @@ +load("@pip//:requirements.bzl", "requirement") + py_library( name = "process_manager", srcs = ["process_manager.py"], + deps = [ + requirement("psutil"), + ], ) py_binary( name = "vivado_client", srcs = ["vivado_client.py"], - deps = [":process_manager"], visibility = ["//visibility:public"], + deps = [":process_manager"], ) py_binary( name = "vivado_server", srcs = ["vivado_server.py"], - deps = [":process_manager"], visibility = ["//visibility:public"], + deps = [":process_manager"], )