Skip to content

chore: add small fixes #1081

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

Merged
merged 3 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/macaron/repo_finder/repo_finder_deps_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ def find_repo(self, purl: PackageURL) -> tuple[str, RepoFinderInfo]:
tuple[str, RepoFinderOutcome] :
A tuple of the found URL (or an empty string), and the outcome of the Repo Finder.
"""
if not purl.version:
latest_purl, outcome = self.get_latest_version(purl)
if not latest_purl:
return "", outcome
purl = latest_purl

try:
json_data = DepsDevService.get_package_info(str(purl))
except APIAccessError:
Expand Down Expand Up @@ -183,7 +189,7 @@ def get_attestation(purl: PackageURL) -> tuple[dict | None, bool]:

# Example of a PURL endpoint for deps.dev with '/' encoded as '%2F':
# https://api.deps.dev/v3alpha/purl/pkg:npm%2F@sigstore%[email protected]
purl_endpoint = DepsDevService().get_purl_endpoint(purl)
purl_endpoint = DepsDevService.get_purl_endpoint(purl)
target_url = urllib.parse.urlunsplit(purl_endpoint)

result = send_get_http(target_url, headers={})
Expand Down
2 changes: 1 addition & 1 deletion src/macaron/repo_finder/repo_finder_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def find_repo(
if not isinstance(existing_asset, PyPIPackageJsonAsset):
continue

if existing_asset.component_name == purl.name and existing_asset.component_version == purl.version:
if existing_asset.component_name == purl.name:
pypi_asset = existing_asset
from_metadata = True
break
Expand Down
Loading