Skip to content
Merged
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 .ruff.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
line-length = 120
target-version = "py310"
10 changes: 8 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ load("@score_docs_as_code//:docs.bzl", "docs")
load("@score_tooling//:defs.bzl", "copyright_checker")

compile_pip_requirements(
name = "requirements",
name = "requirements_3_12",
src = "requirements.in",
requirements_txt = "requirements_lock.txt",
requirements_txt = "requirements_lock_3_12.txt",
)

compile_pip_requirements(
name = "requirements_3_10",
src = "requirements.in",
requirements_txt = "requirements_lock_3_10.txt",
)

exports_files([
Expand Down
27 changes: 18 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,34 @@ module(
###############################################################################
bazel_dep(name = "rules_python", version = "1.8.5")

PYTHON_VERSION = "3.12"
PYTHON_VERSIONS = [
"3.10",
"3.12",
]

DEFAULT_PYTHON_VERSION = "3.12"

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = PYTHON_VERSION,
)
python.defaults(python_version = DEFAULT_PYTHON_VERSION)

[python.toolchain(
is_default = version == DEFAULT_PYTHON_VERSION,
python_version = version,
) for version in PYTHON_VERSIONS]

###############################################################################
#
# PIP dependencies
#
###############################################################################
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(

[pip.parse(
hub_name = "itf_pip",
python_version = PYTHON_VERSION,
requirements_lock = "//:requirements_lock.txt",
)
python_version = version,
requirements_lock = "//:requirements_lock_{}.txt".format(version.replace(".", "_")),
) for version in PYTHON_VERSIONS]

use_repo(pip, "itf_pip")

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This guide walks you through setting up ITF in a new Bazel workspace from scratc

- [Bazel](https://bazel.build/install) 7.x or later
- Docker (for Docker-based tests)
- Python 3.12+
- Python 3.10+

## 1. Add ITF to your workspace

Expand Down
18 changes: 13 additions & 5 deletions examples/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@ module(
###############################################################################
bazel_dep(name = "rules_python", version = "1.0.0")

PYTHON_VERSION = "3.12"
PYTHON_VERSIONS = [
"3.10",
"3.12",
]

DEFAULT_PYTHON_VERSION = "3.12"

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

[python.toolchain(
configure_coverage_tool = True,
is_default = True,
python_version = PYTHON_VERSION,
)
is_default = version == DEFAULT_PYTHON_VERSION,
python_version = version,
) for version in PYTHON_VERSIONS]

use_repo(python)

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion requirements_lock.txt → requirements_lock_3_10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# bazel run //:requirements.update
# bazel run //:requirements_3_10.update
#
--extra-index-url https://pypi.org/simple/

Expand Down
525 changes: 525 additions & 0 deletions requirements_lock_3_12.txt

Large diffs are not rendered by default.

Loading