Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/platform_specific_deps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazel-*
11 changes: 11 additions & 0 deletions examples/platform_specific_deps/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
load("@pip//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_test")

py_test(
name = "test",
srcs = ["pytest_main.py"],
main = "pytest_main.py",
deps = [
requirement("gptqmodel"),
],
)
33 changes: 33 additions & 0 deletions examples/platform_specific_deps/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module(
name = "platform_specific_deps",
version = "0.0.0",
compatibility_level = 1,
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_python", version = "0.0.0")

# TODO: Replace with builtin uv support if it supports platform specific requirements output
bazel_dep(name = "rules_uv", version = "0.65.0")

local_path_override(
module_name = "rules_python",
path = "../..",
)

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.11",
)
python.toolchain(
python_version = "3.9",
)
use_repo(python, "python_3_9")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pip",
python_version = "3.9",
requirements_lock = "requirements.txt",
)
use_repo(pip, "pip")
3 changes: 3 additions & 0 deletions examples/platform_specific_deps/pytest_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import gptqmodel

print("worked")
6 changes: 6 additions & 0 deletions examples/platform_specific_deps/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--index-url https://pypi.org/simple

gptqmodel @ https://github.com/ModelCloud/GPTQModel/releases/download/v2.0.0/gptqmodel-2.0.0+cu126torch2.6-cp310-cp310-linux_x86_64.whl ; python_full_version == '3.10.*' and sys_platform == 'linux'
gptqmodel @ https://github.com/ModelCloud/GPTQModel/releases/download/v2.0.0/gptqmodel-2.0.0+cu126torch2.6-cp311-cp311-linux_x86_64.whl ; python_full_version == '3.11.*' and sys_platform == 'linux'
gptqmodel @ https://github.com/ModelCloud/GPTQModel/releases/download/v2.0.0/gptqmodel-2.0.0+cu126torch2.6-cp312-cp312-linux_x86_64.whl ; python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'linux'
gptqmodel @ https://github.com/ModelCloud/GPTQModel/releases/download/v2.0.0/gptqmodel-2.0.0+cu126torch2.6-cp39-cp39-linux_x86_64.whl ; python_full_version < '3.10' and sys_platform == 'linux'