Skip to content

Commit

Permalink
Fix lock file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
alopezz authored and Kyle-Neale committed Sep 4, 2024
1 parent dd2d172 commit 8252ce8
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .builders/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,17 @@ def is_compatible_wheel(
return True


def generate_lock_file(requirements_file: Path, lock_file: Path) -> None:
target, _, python_version = lock_file.stem.rpartition('_')
def generate_lock_file(
requirements_file: Path,
lock_file_folder: Path,
target: str,
python_version: str,
) -> None:
python_target = target_python_for_major(python_version)
# The lockfiles contain the major.minor Python version
# so that the Agent can transition safely
lock_file = lock_file_folder / f'{target}_{python_target}.txt'

python_major = python_version[-1]

dependencies: dict[str, str] = {}
Expand Down Expand Up @@ -139,9 +148,11 @@ def main():
for target in Path(args.targets_dir).iterdir():
for python_version in target.iterdir():
if python_version.name.startswith('py'):
python_target = target_python_for_major(python_version.name.strip('py'))
generate_lock_file(
python_version / 'frozen.txt', LOCK_FILE_DIR / f'{target.name}_{python_target}.txt'
python_version / 'frozen.txt',
LOCK_FILE_DIR,
target.name,
python_version.name.strip('py'),
)

if (image_digest_file := target / 'image_digest').is_file():
Expand Down

0 comments on commit 8252ce8

Please sign in to comment.