Using Bzlmod
Add to your MODULE.bazel
file:
- for packaging and dependency management with Poetry
bazel_dep(name = "ofiuco", version = "0.4.0")
poetry = use_extension("@ofiuco//python:extensions.bzl", "poetry")
poetry.parse(
name = "poetry",
lock = "//:poetry.lock",
)
use_repo(poetry, "poetry")
Using WORKSPACE
Paste this snippet into your WORKSPACE
file:
- for packaging and dependency management with Poetry
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
toolchain_name = "python"
python_version = "3.12"
# Setup rules_python
http_archive(
name = "rules_python",
sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -",
strip_prefix = "rules_python-1.0.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/1.0.0/rules_python-1.0.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
py_repositories()
python_register_toolchains(toolchain_name, python_version)
# Setup ofiuco
http_archive(
name = "ofiuco",
sha256 = "a9f970b5d764dc61db358ddac9306a6e2d43418df51cc8ae34082317bd233566",
strip_prefix = "ofiuco-0.4.0",
url = "https://github.com/oxidase/ofiuco/releases/download/v0.4.0/ofiuco-0.4.0.tar.gz",
)
load("@ofiuco//python:repositories.bzl", install_poetry_dependencies = "install_dependencies")
install_poetry_dependencies(toolchain_name, python_version)
load("@ofiuco//python:poetry_parse.bzl", "poetry_parse")
poetry_parse(
name = "poetry",
lock = "//:poetry.lock",
)
Full Changelog: v0.3.7...v0.4.0