Conversation
WalkthroughA new Hatch plugin, Changes
Sequence Diagram(s)sequenceDiagram
participant BuildTool as Hatch Build Tool
participant Plugin as PinJumpstarter Plugin
participant Package as Package Metadata
BuildTool->>Plugin: Register build hook (on build)
BuildTool->>Plugin: initialize(version, build_data)
Plugin->>Package: Read pyproject.toml metadata
Plugin->>Package: For each dependency starting with "jumpstarter", pin version to current
Plugin->>BuildTool: Provide modified metadata file for build
BuildTool->>Plugin: finalize(version, build_data, artifact_path)
Plugin->>Plugin: Remove temporary modified metadata file
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
packages/jumpstarter-imagehash/pyproject.toml (1)
27-28: Suggest pinning plugin version for reproducible builds
Consider adding a version constraint forhatch-pin-jumpstarterin thebuild-system.requiresto avoid future breakages when a new release is published.Apply this diff (replace
X.Y.Zwith the actual plugin version):-[build-system] -requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"] +[build-system] +requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter>=X.Y.Z"] build-backend = "hatchling.build"packages/jumpstarter-driver-opendal/pyproject.toml (1)
29-30: Suggest pinning plugin version for reproducible builds
Consider adding a version constraint forhatch-pin-jumpstarterin thebuild-system.requiresto avoid future breakages when a new release is published.-[build-system] -requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"] +[build-system] +requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter>=X.Y.Z"] build-backend = "hatchling.build"packages/jumpstarter-cli/pyproject.toml (1)
43-44: Suggest pinning plugin version for reproducible builds
It’s a good practice to pinhatch-pin-jumpstarterto a specific version inbuild-system.requiresto ensure consistent builds across environments.-[build-system] -requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"] +[build-system] +requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter>=X.Y.Z"] build-backend = "hatchling.build"packages/jumpstarter-driver-sdwire/pyproject.toml (1)
31-32: Suggest pinning plugin version for reproducible builds
To prevent unexpected breakages when the plugin is updated, specify a version constraint forhatch-pin-jumpstarterin the build requirements.-[build-system] -requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"] +[build-system] +requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter>=X.Y.Z"] build-backend = "hatchling.build"packages/jumpstarter-protocol/pyproject.toml (1)
35-36: Suggest pinning plugin version for reproducible builds
Pinninghatch-pin-jumpstarterto a specific version inbuild-system.requireswill help maintain reproducible builds as the plugin evolves.-[build-system] -requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter"] +[build-system] +requires = ["hatchling", "hatch-vcs", "hatch-pin-jumpstarter>=X.Y.Z"] build-backend = "hatchling.build"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (33)
packages/hatch-pin-jumpstarter/pyproject.toml(1 hunks)packages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/__init__.py(1 hunks)packages/jumpstarter-all/pyproject.toml(1 hunks)packages/jumpstarter-cli-admin/pyproject.toml(1 hunks)packages/jumpstarter-cli-common/pyproject.toml(1 hunks)packages/jumpstarter-cli-driver/pyproject.toml(1 hunks)packages/jumpstarter-cli/pyproject.toml(1 hunks)packages/jumpstarter-driver-can/pyproject.toml(1 hunks)packages/jumpstarter-driver-composite/pyproject.toml(1 hunks)packages/jumpstarter-driver-corellium/pyproject.toml(1 hunks)packages/jumpstarter-driver-dutlink/pyproject.toml(1 hunks)packages/jumpstarter-driver-flashers/pyproject.toml(1 hunks)packages/jumpstarter-driver-http/pyproject.toml(2 hunks)packages/jumpstarter-driver-network/pyproject.toml(1 hunks)packages/jumpstarter-driver-opendal/pyproject.toml(1 hunks)packages/jumpstarter-driver-power/pyproject.toml(1 hunks)packages/jumpstarter-driver-probe-rs/pyproject.toml(1 hunks)packages/jumpstarter-driver-pyserial/pyproject.toml(1 hunks)packages/jumpstarter-driver-qemu/pyproject.toml(1 hunks)packages/jumpstarter-driver-raspberrypi/pyproject.toml(1 hunks)packages/jumpstarter-driver-sdwire/pyproject.toml(1 hunks)packages/jumpstarter-driver-shell/pyproject.toml(1 hunks)packages/jumpstarter-driver-snmp/pyproject.toml(1 hunks)packages/jumpstarter-driver-tftp/pyproject.toml(1 hunks)packages/jumpstarter-driver-uboot/pyproject.toml(1 hunks)packages/jumpstarter-driver-ustreamer/pyproject.toml(1 hunks)packages/jumpstarter-driver-yepkit/pyproject.toml(1 hunks)packages/jumpstarter-imagehash/pyproject.toml(1 hunks)packages/jumpstarter-kubernetes/pyproject.toml(1 hunks)packages/jumpstarter-protocol/pyproject.toml(1 hunks)packages/jumpstarter-testing/pyproject.toml(1 hunks)packages/jumpstarter/pyproject.toml(1 hunks)pyproject.toml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: e2e
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
🔇 Additional comments (64)
pyproject.toml (1)
34-36: Registerhatch-pin-jumpstarteras a workspace source
You’ve added the new plugin under[tool.uv.sources]. Ensure that the path (packages/hatch-pin-jumpstarter) aligns with your repo layout so all workspace operations can locate the plugin.packages/jumpstarter-driver-dutlink/pyproject.toml (2)
43-45: Includehatch-pin-jumpstarterin build-system requirements
Adding the plugin to thebuild-system.requiresensures it’s available at build time. Confirm compatibility with your existing Hatch versions and that the plugin is installed when invokinghatch build.
46-48: Configure thepin_jumpstartermetadata hook
The[tool.hatch.metadata.hooks.pin_jumpstarter]section correctly names the hook. Verify that the hook key matches the entry point defined in thehatch-pin-jumpstarterpackage so it’s invoked during metadata generation.packages/jumpstarter-driver-flashers/pyproject.toml (2)
43-45: Addhatch-pin-jumpstarterto the flasher driver build-system
You’ve extended the build requirements to include the new plugin. Ensure that builds for this package now pick up the version-pinning behavior without regressions.
49-50: Set up thepin_jumpstarterhook configuration
This hook block matches the expected format. Double-check that the hook name is consistent across all packages to avoid any typos that could skip the pinning step.packages/jumpstarter-driver-uboot/pyproject.toml (2)
38-40: Declarehatch-pin-jumpstarteras a build requirement
Including the plugin here ensures U-Boot driver builds will trigger dependency pinning. Please validate that the new requirement doesn’t conflict with other build plugins or backends.
41-43: Register thepin_jumpstarterhook for U-Boot driver
The hook block is correctly formatted. Confirm that your entry-point name in the plugin’s setup matches this hook identifier.packages/jumpstarter-kubernetes/pyproject.toml (2)
33-35: Extend build-system requirements withhatch-pin-jumpstarter
This update ensures the Kubernetes package will use the new pinning logic. Verify that CI builds still pass and that no additional backends need configuration.
36-38: Add thepin_jumpstartermetadata hook
The hook section aligns with the plugin’s contract. Please ensure the hook ordering inpyproject.tomldoes not interfere with other Hatch hooks you may have.packages/jumpstarter-driver-raspberrypi/pyproject.toml (2)
31-32: Build-system hook dependency added as expected.The new
hatch-pin-jumpstarterplugin has been correctly included alongsidehatchlingandhatch-vcs. This ensures the pinning hook will be available during the build.
34-36: Metadata hook configuration is correct.The
[tool.hatch.metadata.hooks.pin_jumpstarter]section properly names the hook aspin_jumpstarter, matching the plugin’s entry point. No issues found.packages/jumpstarter-driver-yepkit/pyproject.toml (2)
36-37: Build-system hook dependency added as expected.
hatch-pin-jumpstarteris now declared alongside the existing build requirements, ensuring the hook is installed in the Yepkit driver package.
42-43: Metadata hook configuration is correct.The new
[tool.hatch.metadata.hooks.pin_jumpstarter]block correctly defines the hook name. Configuration aligns with the other Jumpstarter packages.packages/jumpstarter-cli-driver/pyproject.toml (2)
38-39: Build-system hook dependency added as expected.The
hatch-pin-jumpstarterplugin is now included in the build-system requirements. This matches the pattern established for other drivers.
41-42: Metadata hook configuration is correct.The
[tool.hatch.metadata.hooks.pin_jumpstarter]section is properly set up with the hook namepin_jumpstarter. All good.packages/jumpstarter-driver-network/pyproject.toml (2)
52-53: Build-system hook dependency added as expected.Including
hatch-pin-jumpstarterin the build-system requirements ensures the metadata hook is available for the Network driver package.
55-57: Metadata hook configuration is correct.The
pin_jumpstartermetadata hook is configured consistently with the plugin’s entry point. No further changes needed.packages/jumpstarter-driver-tftp/pyproject.toml (2)
41-42: Build-system hook dependency added as expected.The
hatch-pin-jumpstarterplugin is declared alongside the existing build tools, aligning this package with the new workspace-wide hook.
44-46: Metadata hook configuration is correct.The
[tool.hatch.metadata.hooks.pin_jumpstarter]section is properly defined. The hook name matches the plugin's registration.packages/jumpstarter-driver-shell/pyproject.toml (2)
33-34: Verify inclusion of the new build dependency
The[build-system]block now includes"hatch-pin-jumpstarter"alongsidehatchlingandhatch-vcs. This correctly ensures the plugin is available during the build.
36-37: Ensure metadata hook name matches plugin registration
The[tool.hatch.metadata.hooks.pin_jumpstarter]section declaresname = "pin_jumpstarter". Please confirm that the plugin’s entry point registers this exact hook name so Hatch will load it as intended.packages/jumpstarter-driver-probe-rs/pyproject.toml (2)
31-32: Verify inclusion of the new build dependency
The[build-system]block now includes"hatch-pin-jumpstarter"alongsidehatchlingandhatch-vcs. This correctly ensures the plugin is available during the build.
37-38: Ensure metadata hook name matches plugin registration
The[tool.hatch.metadata.hooks.pin_jumpstarter]section declaresname = "pin_jumpstarter". Please confirm that the plugin’s entry point registers this exact hook name so Hatch will load it as intended.packages/jumpstarter-cli-common/pyproject.toml (2)
39-40: Verify inclusion of the new build dependency
The[build-system]block now includes"hatch-pin-jumpstarter"alongsidehatchlingandhatch-vcs. This correctly ensures the plugin is available during the build.
42-43: Ensure metadata hook name matches plugin registration
The[tool.hatch.metadata.hooks.pin_jumpstarter]section declaresname = "pin_jumpstarter". Please confirm that the plugin’s entry point registers this exact hook name so Hatch will load it as intended.packages/jumpstarter-driver-power/pyproject.toml (2)
29-30: Verify inclusion of the new build dependency
The[build-system]block now includes"hatch-pin-jumpstarter"alongsidehatchlingandhatch-vcs. This correctly ensures the plugin is available during the build.
32-33: Ensure metadata hook name matches plugin registration
The[tool.hatch.metadata.hooks.pin_jumpstarter]section declaresname = "pin_jumpstarter". Please confirm that the plugin’s entry point registers this exact hook name so Hatch will load it as intended.packages/jumpstarter-cli-admin/pyproject.toml (2)
34-35: Verify inclusion of the new build dependency
The[build-system]block now includes"hatch-pin-jumpstarter"alongsidehatchlingandhatch-vcs. This correctly ensures the plugin is available during the build.
37-38: Ensure metadata hook name matches plugin registration
The[tool.hatch.metadata.hooks.pin_jumpstarter]section declaresname = "pin_jumpstarter". Please confirm that the plugin’s entry point registers this exact hook name so Hatch will load it as intended.packages/jumpstarter-imagehash/pyproject.toml (1)
30-31: Approve metadata hook configuration
The new[tool.hatch.metadata.hooks.pin_jumpstarter]section correctly registers thepin_jumpstarterhook, matching the plugin’s entry point.packages/jumpstarter-driver-opendal/pyproject.toml (1)
32-33: Approve metadata hook configuration
The[tool.hatch.metadata.hooks.pin_jumpstarter]block is correctly set up and matches the plugin’s hook name.packages/jumpstarter-cli/pyproject.toml (1)
46-47: Approve metadata hook configuration
The new metadata hook declaration properly referencespin_jumpstarter, aligning with the plugin’s registration.packages/jumpstarter-driver-sdwire/pyproject.toml (1)
34-35: Approve metadata hook configuration
The[tool.hatch.metadata.hooks.pin_jumpstarter]section is correctly added and uses the expected hook name.packages/jumpstarter-protocol/pyproject.toml (1)
38-39: Approve metadata hook configuration
The hook registration under[tool.hatch.metadata.hooks.pin_jumpstarter]is set up correctly and matches the plugin’s entry point.packages/jumpstarter/pyproject.toml (2)
47-49: Addhatch-pin-jumpstarterto build-system requires
The new build dependency for thepin_jumpstarterplugin is correctly included inbuild-system.requires. This ensures the metadata hook will be available during package builds.
50-52: Configure thepin_jumpstartermetadata hook
The[tool.hatch.metadata.hooks.pin_jumpstarter]section is properly declared with the expected hook name. No further changes are needed here.packages/jumpstarter-all/pyproject.toml (2)
53-55: Addhatch-pin-jumpstarterto build-system requires
Includinghatch-pin-jumpstarterin the build requirements is correct and aligns with the new plugin integration in this meta-package.
56-58: Declare thepin_jumpstartermetadata hook
The metadata hook configuration forpin_jumpstarteris properly specified. This will enable dependency pinning during builds.packages/jumpstarter-driver-corellium/pyproject.toml (2)
33-35: Addhatch-pin-jumpstarterto build-system requires
The plugin dependency has been correctly added to the build system requirements, ensuring that corellium driver builds will pinjumpstarter-*dependencies as intended.
36-38: Configure thepin_jumpstartermetadata hook
Thepin_jumpstarterhook is declared under[tool.hatch.metadata.hooks.pin_jumpstarter]with the correct name. This matches the plugin’s entry point.packages/jumpstarter-driver-http/pyproject.toml (2)
31-33: Addhatch-pin-jumpstarterto build-system requires
The new build-system requirement is correctly added alongside existing Hatch backends. This will enable pinning for HTTP driver builds.
42-44: Declare thepin_jumpstartermetadata hook
The metadata hook block is correctly configured to usepin_jumpstarter. No further updates are necessary here.packages/jumpstarter-testing/pyproject.toml (2)
29-31: Addhatch-pin-jumpstarterto build-system requires
The plugin dependency has been added correctly, ensuring that test package builds will pin thejumpstarter-*dependencies.
32-34: Configure thepin_jumpstartermetadata hook
The hook configuration is properly declared; this integration will apply the version pinning as expected during testing package builds.packages/jumpstarter-driver-snmp/pyproject.toml (2)
38-38: Build dependency correctly added
The new pluginhatch-pin-jumpstarteris appropriately included inbuild-system.requires, ensuring the metadata hook will be available during the package build process.
40-41:Details
✅ Verification successful
Verify hook configuration matches plugin entry point
Please confirm that the hook identifierpin_jumpstarteraligns with the entry-point defined in thehatch-pin-jumpstarterplugin implementation.Run the following script to verify the entry point registration:
🏁 Script executed:
#!/bin/bash # Verify plugin entry-point for the metadata hook rg -n "pin_jumpstarter" -n packages/hatch-pin-jumpstarterLength of output: 255
Hook configuration validated
Thepin_jumpstarterhook identifier inpackages/jumpstarter-driver-snmp/pyproject.tomlmatches the entry-point inpackages/hatch-pin-jumpstarter(both thepyproject.tomlentry andPLUGIN_NAMEin__init__.py). No changes required.packages/jumpstarter-driver-pyserial/pyproject.toml (2)
37-37: Build dependency correctly added
Thehatch-pin-jumpstarterplugin has been added to thebuild-system.requireslist as intended, making the pinning hook available at build time.
40-41:Details
✅ Verification successful
Verify hook configuration matches plugin entry point
Double-check that the[tool.hatch.metadata.hooks.pin_jumpstarter]section and itsname = "pin_jumpstarter"value correspond exactly to the hook declared by the plugin.You can run:
🏁 Script executed:
#!/bin/bash # Search for the hook registration in the plugin package rg -n "pin_jumpstarter" -n packages/hatch-pin-jumpstarterLength of output: 255
Hook configuration is correct
The
pin_jumpstarterhook inpackages/jumpstarter-driver-pyserial/pyproject.tomlmatches the plugin’s entry point:
- In
packages/hatch-pin-jumpstarter/pyproject.toml:
pin_jumpstarter = "hatch_pin_jumpstarter"- In
packages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/__init__.py:
PLUGIN_NAME = "pin_jumpstarter"No changes required.
packages/jumpstarter-driver-composite/pyproject.toml (2)
30-30: Build dependency correctly added
Includinghatch-pin-jumpstarterinbuild-system.requiresis correct and consistent with other drivers, ensuring the hook is present during builds.
32-34:Details
✅ Verification successful
Verify hook configuration matches plugin entry point
Ensure the metadata hook section[tool.hatch.metadata.hooks.pin_jumpstarter]uses the exact hook name that the plugin exposes.Run this to confirm:
🏁 Script executed:
#!/bin/bash # Validate hook identifier in plugin rg -n "pin_jumpstarter" -n packages/hatch-pin-jumpstarterLength of output: 255
Hook configuration is correct
The hook namepin_jumpstarterinpackages/jumpstarter-driver-composite/pyproject.tomlmatches thePLUGIN_NAME = "pin_jumpstarter"defined inpackages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/__init__.py, so no changes are needed.packages/jumpstarter-driver-qemu/pyproject.toml (2)
43-43: Build dependency correctly added
The newhatch-pin-jumpstarterplugin is correctly declared inbuild-system.requires, aligning this driver with the pinning workflow.
45-47:Details
✅ Verification successful
Verify hook configuration matches plugin entry point
Please verify that the hook namepin_jumpstarterin this TOML matches the hook registration in the plugin package.Suggested check:
🏁 Script executed:
#!/bin/bash # Search for hook registration in hatch-pin-jumpstarter rg -n "pin_jumpstarter" -n packages/hatch-pin-jumpstarterLength of output: 255
Hook name
pin_jumpstarteris correctly configured
Verified that the hook name inpackages/jumpstarter-driver-qemu/pyproject.tomlmatches the plugin entry point:
- packages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/init.py:
‑ PLUGIN_NAME = "pin_jumpstarter"- packages/hatch-pin-jumpstarter/pyproject.toml (line 20):
‑ pin_jumpstarter = "hatch_pin_jumpstarter"No changes required.
packages/jumpstarter-driver-ustreamer/pyproject.toml (2)
27-27: Build dependency correctly added
The addition ofhatch-pin-jumpstartertobuild-system.requiresis appropriate and ensures this driver participates in the pinning hook.
29-31:Details
✅ Verification successful
Verify hook configuration matches plugin entry point
Confirm that the[tool.hatch.metadata.hooks.pin_jumpstarter]section andname = "pin_jumpstarter"setting correspond exactly to the hook defined by the plugin.Run the following:
🏁 Script executed:
#!/bin/bash # Validate hook identifier in the plugin package rg -n "pin_jumpstarter" -n packages/hatch-pin-jumpstarterLength of output: 255
Hook configuration validated
Thename = "pin_jumpstarter"inpackages/jumpstarter-driver-ustreamer/pyproject.tomlmatches the plugin’sPLUGIN_NAME = "pin_jumpstarter"(and its entry inpackages/hatch-pin-jumpstarter/pyproject.toml). No changes needed.packages/jumpstarter-driver-can/pyproject.toml (2)
32-33: Build dependency addition looks good.The addition of "hatch-pin-jumpstarter" to the build system requirements is appropriate and aligns with the PR objective to enable the new metadata hook.
35-36: Metadata hook configuration is correctly set up.The new metadata hook section with
name = "pin_jumpstarter"properly configures the hook to pin dependencies starting with "jumpstarter" to the current package version during build.packages/hatch-pin-jumpstarter/pyproject.toml (5)
1-8: Project metadata looks good.The project metadata is well-defined with appropriate name, version, description, and author information.
9-9: Consider the Python version requirement.The Python requirement of >=3.12 is quite high and might limit compatibility with environments that haven't upgraded to Python 3.12 yet. Check if this is intentional or if a lower version would be sufficient.
10-13: Dependencies look appropriate.The dependencies on hatchling and packaging with minimum version requirements are well-specified for the functionality being implemented.
15-17: Build system configuration is correct.Using hatchling as the build backend is appropriate for this Hatch plugin.
19-20: Entry point registration is correct.The entry point for the Hatch plugin system is properly defined, mapping "pin_jumpstarter" to the "hatch_pin_jumpstarter" module.
packages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/__init__.py (3)
1-5: Imports are appropriate.The necessary imports from hatchling and packaging modules are correctly included for the plugin implementation.
7-9: Class definition looks good.The
PinJumpstarterclass correctly implements theMetadataHookInterfacewith the appropriatePLUGIN_NAME.
21-23: Hook registration looks good.The hook registration function is correctly decorated with
@hookimpland returns thePinJumpstarterclass.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (2)
packages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/__init__.py (2)
16-24: 🛠️ Refactor suggestionAdd minimal docstrings and defensive parsing for robustness
initializeperforms non-trivial I/O and metadata mutation but is undocumented and assumes all dependency strings are parse-able. A short docstring plus atry/except RequirementParseError(or genericException) would make the hook easier to maintain and prevent a single malformed requirement from aborting the build.
25-30:⚠️ Potential issueReplacing specifiers instead of intersecting avoids contradictory pins
req.specifier &= SpecifierSet(f"=={self.metadata.version}")intersects the existing specifiers with an exact pin.
If a package already requires, e.g.,>=1.2, the intersection becomes>=1.2,==1.3.0which is unsatisfiable and will break downstream installs.
Use assignment to overwrite existing specifiers:- req.specifier &= SpecifierSet(f"=={self.metadata.version}") + # Overwrite any existing range with an exact pin + req.specifier = SpecifierSet(f"=={self.metadata.version}")
🧹 Nitpick comments (3)
packages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/__init__.py (1)
32-37: Prefer a context-managed temp-file to guarantee close on exceptions- f = NamedTemporaryFile(delete=False) - tomli_w.dump(metadata, f) - f.close() + with NamedTemporaryFile(delete=False) as f: + tomli_w.dump(metadata, f)This shortens the code and prevents a leaked file descriptor if
tomli_w.dumpraises.__templates__/driver/pyproject.toml.tmpl (1)
32-37: Consider version-capping build dependencies for deterministic builds
hatch-pin-jumpstarteris added without a version specifier. If a future major release introduces breaking changes, template-generated packages may fail to build.
Example:requires = ["hatchling>=1.24,<2", "hatch-vcs>=0.5,<1", "hatch-pin-jumpstarter>=0.1,<1"]Makefile (1)
27-28: Usetestbuiltin for clarity & portability
The current construct works, but a slightly clearer/shorter idiom is:uv run --isolated --directory $< pytest || test $$? -eq 5
[ … ]is a synonym fortest; the latter avoids the additional brackets.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (34)
Makefile(1 hunks)__templates__/driver/pyproject.toml.tmpl(1 hunks)packages/hatch-pin-jumpstarter/pyproject.toml(1 hunks)packages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/__init__.py(1 hunks)packages/jumpstarter-all/pyproject.toml(1 hunks)packages/jumpstarter-cli-admin/pyproject.toml(1 hunks)packages/jumpstarter-cli-common/pyproject.toml(1 hunks)packages/jumpstarter-cli-driver/pyproject.toml(1 hunks)packages/jumpstarter-cli/pyproject.toml(1 hunks)packages/jumpstarter-driver-can/pyproject.toml(1 hunks)packages/jumpstarter-driver-composite/pyproject.toml(1 hunks)packages/jumpstarter-driver-corellium/pyproject.toml(1 hunks)packages/jumpstarter-driver-dutlink/pyproject.toml(1 hunks)packages/jumpstarter-driver-flashers/pyproject.toml(1 hunks)packages/jumpstarter-driver-http/pyproject.toml(2 hunks)packages/jumpstarter-driver-network/pyproject.toml(1 hunks)packages/jumpstarter-driver-opendal/pyproject.toml(1 hunks)packages/jumpstarter-driver-power/pyproject.toml(1 hunks)packages/jumpstarter-driver-probe-rs/pyproject.toml(1 hunks)packages/jumpstarter-driver-pyserial/pyproject.toml(1 hunks)packages/jumpstarter-driver-qemu/pyproject.toml(1 hunks)packages/jumpstarter-driver-raspberrypi/pyproject.toml(1 hunks)packages/jumpstarter-driver-sdwire/pyproject.toml(1 hunks)packages/jumpstarter-driver-shell/pyproject.toml(1 hunks)packages/jumpstarter-driver-snmp/pyproject.toml(1 hunks)packages/jumpstarter-driver-tftp/pyproject.toml(1 hunks)packages/jumpstarter-driver-uboot/pyproject.toml(1 hunks)packages/jumpstarter-driver-ustreamer/pyproject.toml(1 hunks)packages/jumpstarter-driver-yepkit/pyproject.toml(1 hunks)packages/jumpstarter-imagehash/pyproject.toml(1 hunks)packages/jumpstarter-kubernetes/pyproject.toml(1 hunks)packages/jumpstarter-protocol/pyproject.toml(1 hunks)packages/jumpstarter-testing/pyproject.toml(1 hunks)packages/jumpstarter/pyproject.toml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (31)
- packages/jumpstarter-driver-yepkit/pyproject.toml
- packages/jumpstarter-driver-network/pyproject.toml
- packages/jumpstarter-driver-raspberrypi/pyproject.toml
- packages/jumpstarter-driver-flashers/pyproject.toml
- packages/jumpstarter-driver-tftp/pyproject.toml
- packages/jumpstarter-cli/pyproject.toml
- packages/jumpstarter-driver-dutlink/pyproject.toml
- packages/jumpstarter-driver-qemu/pyproject.toml
- packages/jumpstarter-driver-uboot/pyproject.toml
- packages/jumpstarter-driver-probe-rs/pyproject.toml
- packages/jumpstarter-driver-shell/pyproject.toml
- packages/jumpstarter-cli-common/pyproject.toml
- packages/jumpstarter-driver-can/pyproject.toml
- packages/jumpstarter-imagehash/pyproject.toml
- packages/jumpstarter-driver-power/pyproject.toml
- packages/jumpstarter-all/pyproject.toml
- packages/jumpstarter/pyproject.toml
- packages/jumpstarter-driver-snmp/pyproject.toml
- packages/jumpstarter-driver-pyserial/pyproject.toml
- packages/jumpstarter-kubernetes/pyproject.toml
- packages/jumpstarter-testing/pyproject.toml
- packages/jumpstarter-cli-admin/pyproject.toml
- packages/jumpstarter-driver-composite/pyproject.toml
- packages/jumpstarter-driver-sdwire/pyproject.toml
- packages/jumpstarter-driver-opendal/pyproject.toml
- packages/jumpstarter-driver-http/pyproject.toml
- packages/jumpstarter-driver-corellium/pyproject.toml
- packages/jumpstarter-driver-ustreamer/pyproject.toml
- packages/jumpstarter-cli-driver/pyproject.toml
- packages/hatch-pin-jumpstarter/pyproject.toml
- packages/jumpstarter-protocol/pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: e2e
- GitHub Check: pytest-matrix (3.13)
- GitHub Check: pytest-matrix (3.11)
- GitHub Check: pytest-matrix (3.12)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (1)
packages/hatch-pin-jumpstarter/src/hatch_pin_jumpstarter/__init__.py (1)
43-44: Guard against missing key to avoidKeyErrorinfinalize
If an exception is raised beforebuild_data["__hatch_pin_jumpstarter_tempfile"]is set,finalizewill crash.f = build_data.get("__hatch_pin_jumpstarter_tempfile") if f: os.unlink(f.name)
| for i, dep in enumerate(metadata["project"]["dependencies"]): | ||
| req = Requirement(dep) | ||
| if req.name.startswith("jumpstarter"): | ||
| req.specifier &= SpecifierSet(f"=={self.metadata.version}") |
|
Successfully created backport PR for |
Summary by CodeRabbit