From ec7f51a76668cac3ad6e27efc7d9fa27196a0409 Mon Sep 17 00:00:00 2001 From: bashtavenko Date: Fri, 24 May 2024 12:03:33 -0400 Subject: [PATCH] Pip dependencies repro --- BUILD.bazel | 20 +++++++++----------- MODULE.bazel | 8 +++----- graph_test.py | 1 + requirements.txt | 2 +- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 007b313..3d8ed4f 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,22 +1,20 @@ -load("@buildifier_prebuilt//:rules.bzl", "buildifier") load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") - -buildifier( - name = "buildifier", - exclude_patterns = [ - "./bazel-*/*", - "./.git/*", - ], - lint_mode = "warn", -) +load("@pip_deps//:requirements.bzl", "requirement") +#load("@pip_deps//:requirements.bzl", "all_requirements") py_library( name = "graph_lib", srcs = ["graph.py"] ) +# "@pip_deps//requests"] +# requirement("requests")] +# + all_requirements, +# No idea what this means @{name}_{package}//:pkg py_test( name = "graph_test", srcs = ["graph_test.py"], - deps = [":graph_lib"], + deps = [":graph_lib", + requirement("requests")] + ) \ No newline at end of file diff --git a/MODULE.bazel b/MODULE.bazel index f9eec37..6d5fcc6 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -2,13 +2,11 @@ module( name = "py" ) -bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True) - -bazel_dep(name = "rules_python", version = "0.4.0") -pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True) +bazel_dep(name = "rules_python", version = "0.32.2") +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") pip.parse( hub_name = "pip_deps", - python_version = "3.12.3", + python_version = "3.11", requirements_lock = "//:requirements.txt", ) use_repo(pip, "pip_deps") diff --git a/graph_test.py b/graph_test.py index 03c57fb..445c1df 100644 --- a/graph_test.py +++ b/graph_test.py @@ -1,6 +1,7 @@ """Tests for graphs.""" import unittest +import requests import graph as m diff --git a/requirements.txt b/requirements.txt index f0dd0ae..bebaa03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -openai \ No newline at end of file +requests