Skip to content

Commit

Permalink
Pip dependencies repro
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtavenko committed May 24, 2024
1 parent 4c9965f commit ec7f51a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
20 changes: 9 additions & 11 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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")]

)
8 changes: 3 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")
1 change: 1 addition & 0 deletions graph_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for graphs."""

import unittest
import requests

import graph as m

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
openai
requests

0 comments on commit ec7f51a

Please sign in to comment.