Skip to content

Commit

Permalink
more WORKSPACE friendly way to achieve it
Browse files Browse the repository at this point in the history
  • Loading branch information
shabanzd committed Dec 24, 2023
1 parent 072cd92 commit 9e446fb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 71 deletions.
14 changes: 0 additions & 14 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
load("@python_versions//3.8:defs.bzl", compile_pip_requirements_3_8 = "compile_pip_requirements")
load("@rules_python//python/pip_install:requirements.bzl", "compile_pip_requirements")
load("//:deps.bzl", "ARCHS")

Expand All @@ -22,16 +21,3 @@ compile_pip_requirements(
requirements_txt = "requirements.txt",
tags = ["manual"],
)

compile_pip_requirements_3_8(
name = "requirements_3_8",
timeout = "moderate",
extra_args = [
"--resolver=backtracking",
"--strip-extras",
"--upgrade",
],
requirements_in = "requirements.in",
requirements_txt = "requirements_lock_3_8.txt",
tags = ["manual"],
)
48 changes: 24 additions & 24 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@ use_repo(

register_toolchains("//appimage:all")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "rules_appimage_py_deps",
python_version = "3.11",
requirements_lock = "//:requirements.txt",
)

pip.parse(
hub_name = "rules_appimage_py_deps",
python_version = "3.8",
requirements_lock = "//:requirements_lock_3_8.txt",
)

use_repo(pip, "rules_appimage_py_deps")
PYTHON_VERSIONS = [
"3.8",
"3.9",
"3.10",
"3.11",
]

PYTHON_NAME_38 = "python_3_8"
PYTHON_NAME_311 = "python_3_11"
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
use_repo(python, PYTHON_NAME_38, PYTHON_NAME_311, "python_versions")

python.toolchain(
is_default = True,
python_version = "3.11",
)
[
python.toolchain(
is_default = python_version == PYTHON_VERSIONS[-1],
python_version = python_version,
)
for python_version in PYTHON_VERSIONS
]

python.toolchain(
python_version = "3.8",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

[
pip.parse(
hub_name = "dep_bazelizer_deps",
python_version = python_version,
requirements_lock = "//:requirements.txt",
)
for python_version in PYTHON_VERSIONS
]

use_repo(pip, "dep_bazelizer_deps")
33 changes: 0 additions & 33 deletions requirements_lock_3_8.txt

This file was deleted.

0 comments on commit 9e446fb

Please sign in to comment.