Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ensure hash consistency between lockfile and venv #207

Merged
merged 1 commit into from
May 2, 2023

Conversation

emmettbutler
Copy link
Contributor

@emmettbutler emmettbutler commented May 2, 2023

This change fixes an issue observable in this test run in which riot generated a requirements lockfile for a Venv instance other than the one it was running tests for. This behavior was happening due to riot logic that skipped Venv instances with pkgs == None while preparing the environment, but not while running tests. Thus the fix is to stop riot from ignoring pkgs-less Venvs in all cases.

Note these two lines of output from the example test run:

Compiling requirements file .riot/requirements/118238b.in
RIOT_VENV_HASH=32bd6c2

This illustrates the mismatch. RIOT_VENV_HASH is the hash of the environment in which the command will be run, and for which the lockfile should be generated. The prepare() function had been ignoring that environment and instead preparing an environment for one of its ancestors.

@emmettbutler emmettbutler requested a review from a team as a code owner May 2, 2023 03:17
@emmettbutler emmettbutler requested review from gnufede and P403n1x87 May 2, 2023 03:17
riot/riot.py Show resolved Hide resolved
riot/riot.py Outdated Show resolved Hide resolved
Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a regression test we can add?

or at least a PR description describing the issue?

@emmettbutler emmettbutler changed the title feat: ensure hash consistency between list and run feat: ensure hash consistency between lockfile and venv May 2, 2023
@emmettbutler emmettbutler enabled auto-merge (squash) May 2, 2023 14:24
hacking

give prefixes even when no packages

remove debug prints

revert unnecessary changes

undo

imports

regression test

undo

release note
@emmettbutler emmettbutler force-pushed the emmett.butler/hash-consistency branch from 036c769 to 2ba7452 Compare May 2, 2023 14:35
@emmettbutler emmettbutler merged commit fe9c1c1 into master May 2, 2023
@emmettbutler emmettbutler deleted the emmett.butler/hash-consistency branch May 2, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants