diff --git a/examples/platform_specific_deps/.gitignore b/examples/platform_specific_deps/.gitignore new file mode 100644 index 0000000000..ac51a054d2 --- /dev/null +++ b/examples/platform_specific_deps/.gitignore @@ -0,0 +1 @@ +bazel-* diff --git a/examples/platform_specific_deps/BUILD.bazel b/examples/platform_specific_deps/BUILD.bazel new file mode 100644 index 0000000000..79bf4cc2a7 --- /dev/null +++ b/examples/platform_specific_deps/BUILD.bazel @@ -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"), + ], +) diff --git a/examples/platform_specific_deps/MODULE.bazel b/examples/platform_specific_deps/MODULE.bazel new file mode 100644 index 0000000000..5081623322 --- /dev/null +++ b/examples/platform_specific_deps/MODULE.bazel @@ -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") diff --git a/examples/platform_specific_deps/pytest_main.py b/examples/platform_specific_deps/pytest_main.py new file mode 100644 index 0000000000..fc4f6dc4ce --- /dev/null +++ b/examples/platform_specific_deps/pytest_main.py @@ -0,0 +1,3 @@ +import gptqmodel + +print("worked") diff --git a/examples/platform_specific_deps/requirements.txt b/examples/platform_specific_deps/requirements.txt new file mode 100644 index 0000000000..2053b16002 --- /dev/null +++ b/examples/platform_specific_deps/requirements.txt @@ -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'