Skip to content

Commit

Permalink
Using formatted_project_name = project_name.replace("-", "_")
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghelfi committed Jan 27, 2025
1 parent 124b957 commit 5ce96d6
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,12 @@ def test__python_project__upgrade_relative_import_version(
kraken_ctx.execute([":build"])

# Check if generated files are named following proper version.
assert Path(project_dist / f"{project_name}-{build_as_version}.tar.gz").is_file()
assert Path(project_dist / f"{project_name}-{build_as_version}-py3-none-any.whl").is_file()
with tarfile.open(project_dist / f"{project_name}-{build_as_version}.tar.gz", "r:gz") as tar:
formatted_project_name = project_name.replace("-", "_")
assert Path(project_dist / f"{formatted_project_name}-{build_as_version}.tar.gz").is_file()
assert Path(project_dist / f"{formatted_project_name}-{build_as_version}-py3-none-any.whl").is_file()
with tarfile.open(project_dist / f"{formatted_project_name}-{build_as_version}.tar.gz", "r:gz") as tar:
# Check if generated files store proper version.
metadata_file = tar.extractfile(f"{project_name}-{build_as_version}/PKG-INFO")
metadata_file = tar.extractfile(f"{formatted_project_name}-{build_as_version}/PKG-INFO")
assert metadata_file is not None, ".tar.gz file does not contain an 'PKG-INFO'"
assert f"Requires-Dist: uv-project=={build_as_version}" in metadata_file.read().decode("UTF-8")

Expand Down

0 comments on commit 5ce96d6

Please sign in to comment.