Pin pipenv in CI via ensure-pipenv and regenerate lock#2251
Draft
Pin pipenv in CI via ensure-pipenv and regenerate lock#2251
Conversation
Switch pre.yml to the ensure-pipenv role from osism/zuul-jobs (after ensure-pip), following the same pattern established in osism/netbox-manager#235. Remove the system pipenv package (Debian Bookworm ships 2022.12.19) which has incompatible hash semantics with current pipenv releases. Update test-setup.yml and test-unit.yml to invoke pipenv as {{ python_venv_dir }}/bin/pipenv (/tmp/venv/bin/pipenv), consistent with the python_venv_dir already set in pre.yml. Add --deploy to the pipenv install --dev call in test-unit.yml so the lock file is verified strictly on every run. Regenerate Pipfile.lock with pipenv 2026.5.2 (the version pinned by the ensure-pipenv role). pipenv 2026.4.0 introduced PEP 503 name normalization before hashing, causing hash mismatches when the old Debian-packaged pipenv generated the lock but a newer pipenv consumed it. The regenerated lock picks up incidental version bumps in pytz (2026.1.post1 → 2026.2) and wcwidth (0.6.0 → 0.7.0). Requires the ensure-pipenv role to be merged in osism/zuul-jobs first. AI-assisted: Claude Code Signed-off-by: Roger Luethi <luethi@osism.tech>
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- You now define
python_venv_dir: /tmp/venvseparately in bothtest-unit.ymlandtest-setup.yml; consider centralizing this (e.g., via a group_var, role var, or reusing the variable exposed byensure-pipenv) so the virtualenv path stays consistent in one place. - Since you're calling
ensure-pipenv, it would be good to align the hardcoded{{ python_venv_dir }}/bin/pipenvpath with whatever path that role actually provisions (or parameterize it), to avoid subtle breakage if the role’s default venv location changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You now define `python_venv_dir: /tmp/venv` separately in both `test-unit.yml` and `test-setup.yml`; consider centralizing this (e.g., via a group_var, role var, or reusing the variable exposed by `ensure-pipenv`) so the virtualenv path stays consistent in one place.
- Since you're calling `ensure-pipenv`, it would be good to align the hardcoded `{{ python_venv_dir }}/bin/pipenv` path with whatever path that role actually provisions (or parameterize it), to avoid subtle breakage if the role’s default venv location changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pre.ymlto theensure-pipenvrole from osism/zuul-jobs(after
ensure-pip), following the same pattern as Pin pipenv in CI via ensure-pipenv and regenerate lock netbox-manager#235pipenvfrom the apt package list (Debian Bookworm ships2022.12.19, which has incompatible hash semantics with current pipenv)
test-setup.ymlandtest-unit.ymlto invoke pipenv as{{ python_venv_dir }}/bin/pipenv(/tmp/venv/bin/pipenv)--deploytopipenv install --devintest-unit.ymlforstrict lock-file verification on every run
Pipfile.lockwith pipenv 2026.5.2 to resolve the hashmismatch introduced by PEP 503 name normalization in pipenv 2026.4.0;
incidental lock bumps: pytz 2026.1.post1 → 2026.2, wcwidth 0.6.0 → 0.7.0
Dependency
Requires osism/zuul-jobs#182 (
ensure-pipenvrole) to be merged first.Test plan
pipenv install --dev --deployno longer reports stale lock locally🤖 AI-assisted: Claude Code