Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docs-linkcheck:
uv run --isolated --all-packages --group docs $(MAKE) -C docs linkcheck

pkg-test-%: packages/%
uv run --isolated --directory $< pytest
uv run --isolated --directory $< pytest || [ $$? -eq 5 ]

pkg-mypy-%: packages/%
uv run --isolated --directory $< mypy .
Expand Down
5 changes: 4 additions & 1 deletion __templates__/driver/pyproject.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ testpaths = ["jumpstarter_driver_${DRIVER_NAME}"]
asyncio_mode = "auto"

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"

[dependency-groups]
dev = [
"pytest-cov>=6.0.0",
Expand Down
Empty file.
28 changes: 28 additions & 0 deletions packages/hatch-pin-jumpstarter/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[project]
name = "hatch-pin-jumpstarter"
version = "0.1.0"
description = "Hatch plugin that pins jumpstarter packages in the monorepo"
readme = "README.md"
authors = [
{ name = "Nick Cao", email = "nickcao@nichi.co" }
]
requires-python = ">=3.11"
dependencies = [
"hatchling>=1.27.0",
"packaging>=24.2",
"tomli>=2.2.1",
"tomli-w>=1.2.0",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
"pytest>=8.3.5",
"pytest-cov>=6.1.1",
]

[project.entry-points.hatch]
pin_jumpstarter = "hatch_pin_jumpstarter"
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import os
from pathlib import Path
from tempfile import NamedTemporaryFile

import tomli
import tomli_w
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
from hatchling.plugin import hookimpl
from packaging.requirements import Requirement
from packaging.specifiers import SpecifierSet


class PinJumpstarter(BuildHookInterface):
PLUGIN_NAME = "pin_jumpstarter"

def initialize(self, version, build_data):
if self.target_name != "sdist":
return

pyproject = Path(self.root) / "pyproject.toml"

with pyproject.open("rb") as f:
metadata = tomli.load(f)

if "project" in metadata and "dependencies" in metadata["project"]:
for i, dep in enumerate(metadata["project"]["dependencies"]):
req = Requirement(dep)
if req.name.startswith("jumpstarter"):
req.specifier &= SpecifierSet(f"=={self.metadata.version}")
metadata["project"]["dependencies"][i] = str(req)

f = NamedTemporaryFile(delete=False)
tomli_w.dump(metadata, f)
f.close()

build_data["__hatch_pin_jumpstarter_tempfile"] = f
build_data["force_include"][f.name] = "pyproject.toml"

def finalize(self, version, build_data, artifact_path):
if self.target_name != "sdist":
return

f = build_data["__hatch_pin_jumpstarter_tempfile"]
os.unlink(f.name)


@hookimpl
def hatch_register_build_hook():
return PinJumpstarter
5 changes: 4 additions & 1 deletion packages/jumpstarter-all/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-cli-admin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-cli-common/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-cli-driver/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-can/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-composite/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-corellium/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-dutlink/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-flashers/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ jumpstarter-driver-uboot = { workspace = true }
#asyncio_mode = "auto"

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[dependency-groups]
dev = ["pytest-cov>=6.0.0", "pytest>=8.3.3"]

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-http/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ asyncio_default_fixture_loop_scope = "function"
testpaths = ["src"]

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[dependency-groups]
Expand All @@ -38,3 +38,6 @@ dev = [
"pytest-asyncio>=0.0.0",
"pytest-asyncio>=0.24.0",
]

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-network/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-opendal/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-power/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-probe-rs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ log_cli_level = "INFO"
testpaths = ["jumpstarter_driver_probe_rs"]

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[dependency-groups]
dev = ["pytest-cov>=6.0.0", "pytest>=8.3.3"]

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-pyserial/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-qemu/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ jumpstarter-driver-pyserial = { workspace = true }
jumpstarter-driver-power = { workspace = true }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-raspberrypi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-sdwire/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-shell/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-snmp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-tftp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ testpaths = ["jumpstarter_driver_tftp"]
asyncio_mode = "auto"

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-uboot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ jumpstarter-driver-composite = { workspace = true }
jumpstarter-driver-qemu = { workspace = true }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-ustreamer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-driver-yepkit/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ testpaths = ["jumpstarter_driver_yepkit"]
asyncio_mode = "auto"

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[dependency-groups]
dev = ["pytest-cov>=6.0.0", "pytest>=8.3.3"]

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-imagehash/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-kubernetes/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
5 changes: 4 additions & 1 deletion packages/jumpstarter-protocol/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ source = "vcs"
raw-options = { 'root' = '../../' }

[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.pin_jumpstarter]
name = "pin_jumpstarter"
Loading
Loading