Skip to content

Include PyPI source distribution URLs in package metadata - #224

Open
tejasng053 wants to merge 1 commit into
aboutcode-org:masterfrom
tejasng053:fix/pypi-sdist-url-134
Open

tejasng053 wants to merge 1 commit into
aboutcode-org:masterfrom
tejasng053:fix/pypi-sdist-url-134

Conversation

@tejasng053

Copy link
Copy Markdown

What's changed?

package.info() currently leaves repository_download_url unset for PyPI packages, even when the release includes a source distribution. For a release containing a wheel followed by an sdist, callers receive the wheel's download_url but no link to its source archive.

Select the release file whose packagetype is sdist and expose its URL as repository_download_url. Preserve the existing first-file download_url behavior and leave the source URL unset when no sdist is available. Selection stays specific to each release, including requests for a single version.

Add ten mocked regression cases covering file ordering, source-only and wheel-only releases, missing metadata, empty releases, per-release URLs, and version filtering. Update the existing Flask fixture and changelog.

Related issue

Fixes #134

Validation

  • New regressions before the fix: 5 failed and 5 passed; failures showed the missing source URL.
  • All PyPI package metadata tests after the fix: 11 passed.
  • Broader suite: 162 passed with four CocoaPods tests deselected; the two fully mocked CocoaPods tests also passed separately (164 passing tests total).
  • Full suite attempted: test_cocoapods_packages failed with an SSL connection error fetching a podspec from raw.githubusercontent.com; the run was interrupted when the following live-network CocoaPods test stalled. Those two tests are unchanged by this PR. Related existing issue: Some unit tests depends on external services #188.
  • make check passed (pycodestyle, isort, Black).
  • git diff --check passed.
  • Python 3.12.3 on Linux. Remote CI is pending.

Checklist

  • I understand the problem and implemented the solution using appropriate functions.
  • I added or updated tests to cover my changes.
  • I verified my changes by running linting, ensuring all local tests pass, and confirming that CI checks succeed.

The final checkbox remains open because of the live-network test limitation above and pending CI. This change was prepared with Codex assistance.

Fixes aboutcode-org#134

Signed-off-by: tejasng053 <tejasng053@gmail.com>

This branch has not been deployed

No deployments
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.

Provide sdist link for PyPI packages in the repository_download_url field

1 participant