The repository defines Bazel installation rules for multi-platform Python lock files.
The major difference to pip rules in rules_python is that Python packages are installed as py_library targets and not as external repositories.
This allows to use platform information of resolved Python toolchains and build cross-platform Python artifacts.
Minimum requirements:
A lock file in the workspace can be updated using a host Python interpreter as
python3 -m pip install poetry
poetry update
or using a pre-defined target
load("@ofiuco//python:poetry.bzl", "poetry_lock")
poetry_lock(
name = "lock",
toml = "pyproject.toml",
lock = "poetry.lock",
)
In both cases the host interpreter is used in the latter case poetry package with dependencies is installed as an external repository.
ofiuco as a moduleTo import ofiuco in your project, you first need to add it to your MODULE.bazel file
bazel_dep(name = "rules_python", version = "1.9.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.13")
use_repo(python, "python_3_13")
bazel_dep(name = "ofiuco", version = "0.9.0")
parse = use_extension("@ofiuco//python:extensions.bzl", "parse")
parse.lock(
name = "python",
lock = "@//path/to:poetry_or_uv.lock",
toml = "@//path/to:pyproject.toml",
)
use_repo(parse, "python")
and Python dependencies can be used as
py_library(
name = "mylib",
srcs = ["mylib.py"],
deps = [
"@python//:package1",
"@python//:package2",
]
)
or to include all Python dependencies you can use :all synthetic target as
py_library(
name = "mylib",
srcs = ["mylib.py"],
deps = [
"@python//:all",
]
)
If all is a legit package name then the synthetic target will have one or more underscores to disambiguate names.
cargo install --git https://github.com/bazel-contrib/multitool
fish_add_path $HOME/.cargo/bin
multitool --lockfile python/private/uv.lock.json update
irm get.scoop.sh -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop install git
scoop bucket add extras
scoop install grep emacs bazelisk zip unzip python vcredist2022 WinDirStat
scoop bucket add milnak https://github.com/milnak/scoop-bucket
scoop install milnak/windbg
# Source - https://stackoverflow.com/a
# Posted by caiohamamura, modified by community. See post 'Timeline' for change history
# Retrieved 2025-12-31, License - CC BY-SA 4.0
winget install Microsoft.VisualStudio.2022.BuildTools --force --override "--wait --passive --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK"
winget install Microsoft.VisualStudio.2022.BuildTools
git clone git://oxidase@github.com/oxidase/ofiuco/ cd ofiuco bazelisk test //...
Bazel rules for use poetry lock files with cross-platform Python packages support
@oxidase/ofiuco0.9.0 +5d2026-04-06 | |
0.8.5 +9d2026-04-01 | |
0.8.4 +1.7mo2026-03-23 | |
0.8.3 +19d2026-01-31 | |
0.8.2 +5d2026-01-11 | |
0.8.1 +3d2026-01-06 | |
0.8.0 +17d2026-01-02 | |
0.7.2 +13d2025-12-16 | |
0.7.1 +4d2025-12-03 | |
0.7.0 +1.7mo2025-11-28 | |
0.6.4 +10d2025-10-08 | |
0.6.3 +10d2025-09-27 | |
0.6.2 +20d2025-09-17 | |
0.5.3 +1.1mo2025-08-28 | |
0.5.2 +10d2025-07-25 | |
0.5.1 +20d2025-07-15 | |
0.5.0 +1.5mo2025-06-24 | |
0.4.6 +17h2025-05-09 | |
0.4.5 +2d2025-05-08 | |
0.4.4 +3.9mo2025-05-06 | |
0.4.1 +6.2mo2025-01-08 | |