Skip to content

Commit

Permalink
cov
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Feb 25, 2025
1 parent 13a872d commit f7034c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
4 changes: 1 addition & 3 deletions tests/test_pixi_to_conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,10 @@ def test_extract_platform_from_url() -> None:
)
== "win-64"
)
assert (
with pytest.raises(ValueError, match="Unknown platform"):
ptcl.extract_platform_from_url(
"https://conda.anaconda.org/conda-forge/unknown/pkg-1.0.0.conda",
)
== "unknown"
)


def test_extract_name_version_from_url() -> None:
Expand Down
13 changes: 2 additions & 11 deletions unidep/pixi_to_conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,6 @@ def find_package_in_repodata(
logging.debug("Found package '%s' in repository '%s'", filename, repo_name)
return repo_data["packages"][filename]

# Check in packages.conda (for newer conda formats)
if "packages.conda" in repo_data and filename in repo_data["packages.conda"]:
logging.debug(
"Found package '%s' in repository '%s' (packages.conda)",
filename,
repo_name,
)
return repo_data["packages.conda"][filename]

logging.debug("Package not found in repo")
return None

Expand All @@ -152,8 +143,8 @@ def extract_platform_from_url(url: str) -> str:
elif "/win-64/" in url:
platform = "win-64"
else:
# Default fallback
platform = "unknown"
msg = f"Unknown platform in URL: {url}"
raise ValueError(msg)

logging.debug("Extracted platform: %s", platform)
return platform
Expand Down

0 comments on commit f7034c7

Please sign in to comment.