-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
94 lines (84 loc) · 2.67 KB
/
BUILD.bazel
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
load("@io_bazel_rules_docker//python:image.bzl", "py_image")
load("@io_bazel_rules_docker//python3:image.bzl", "py3_image")
load("@pip_deps//:requirements.bzl", "requirement")
load("@rules_python//python:packaging.bzl", "py_wheel")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("@rules_python//python:py_binary.bzl", "py_binary")
# If you really want to try out a PY2 Runtime, Switch to a real old version of python_rules and Use a Runtime Pair,
# The Interpreter should be installed in your local system for this to usable
# load("@rules_python//python:py_runtime.bzl", "py_runtime")
# load("@rules_python//python:py_runtime_pair.bzl", "py_runtime_pair")
# py_runtime(
# name = "py2_runtime",
# interpreter_path = "/Users/aswinmylraj/.pyenv/versions/2.7.18/bin", # Update to Correct Location ( pyenv install 2.7.18 is fastest way )
# python_version = "PY2",
# )
# py_runtime_pair(
# name = "runtime_pair",
# py2_runtime = ":py2_runtime",
# py3_runtime = "@python_3_13//:py3_runtime", # Loading Runtime Registered via python_register_toolchains
# )
# toolchain(
# name = "my_toolchain",
# target_compatible_with = <...>,
# toolchain = ":my_py_runtime_pair",
# toolchain_type = "@rules_python//python:toolchain_type",
# )
compile_pip_requirements(
name = "compile_requirements",
requirements_in = "requirements.in",
requirements_txt = "requirements_lock.txt",
)
py_binary(
name = "main",
srcs = ["scraper.py"],
main = "scraper.py",
deps = [
requirement("requests"),
requirement("beautifulsoup4"),
requirement("lxml"),
requirement("aiohttp"),
requirement("python-daemon"),
"//utils:async-utils",
],
)
py_wheel(
name = "test_wheel",
distribution = "web_scrapper_wheel",
python_tag = "py3",
version = "1.0.0",
deps = [
requirement("requests"),
requirement("beautifulsoup4"),
requirement("lxml"),
requirement("aiohttp"),
requirement("python-daemon"),
"//utils:async-utils",
],
)
py_image(
name = "test_py_image",
srcs = ["scraper.py"],
main = "scraper.py",
deps = [
requirement("requests"),
requirement("beautifulsoup4"),
requirement("lxml"),
requirement("aiohttp"),
requirement("python-daemon"),
"//utils:async-utils",
],
)
py3_image(
name = "test_py3_image",
srcs = ["scraper.py"],
main = "scraper.py",
deps = [
requirement("requests"),
requirement("beautifulsoup4"),
requirement("lxml"),
requirement("aiohttp"),
requirement("python-daemon"),
"//utils:async-utils",
],
)