-
Notifications
You must be signed in to change notification settings - Fork 7
/
WORKSPACE
46 lines (42 loc) · 1.51 KB
/
WORKSPACE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
workspace(
name = "basic_project",
managed_directories = {
"@poetry_environment": [".venv"]
}
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python_poetry",
url = "https://github.com/DaMouse404/rules_python_poetry/releases/download/0.0.1/rules_python_poetry-0.0.1.tar.gz",
sha256 = "3ac54f1e9b070d2ed727c58f30798f4cea1123242279e7d6e1a48e1f06ca16d6",
)
load("@rules_python_poetry//:environment.bzl", "poetry_environment")
poetry_environment(
name="poetry_environment",
project="//:pyproject.toml",
lock="//:poetry.lock",
config="//:poetry.toml"
)
register_toolchains("@poetry_environment//:poetry_toolchain")
load("@poetry_environment//:runtime.bzl", "interpreter_path")
load("@poetry_environment//:export.bzl", "poetry_export")
poetry_export(
name="poetry_requirements"
)
http_archive(
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.2/rules_python-0.0.2.tar.gz",
strip_prefix = "rules_python-0.0.2",
sha256 = "b5668cde8bb6e3515057ef465a35ad712214962f0b3a314e551204266c7be90c",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
load("@rules_python//python:pip.bzl", "pip_repositories", "pip_import")
pip_repositories()
pip_import(
name = "basic_project_pip",
requirements = "@poetry_requirements//:requirements.txt",
python_interpreter = interpreter_path
)
load("@basic_project_pip//:requirements.bzl", "pip_install")
pip_install()