Skip to content

test(sources): add coverage for source pipeline#1161

Open
mnadzam wants to merge 1 commit into
python-wheel-build:mainfrom
mnadzam:test/sources
Open

test(sources): add coverage for source pipeline#1161
mnadzam wants to merge 1 commit into
python-wheel-build:mainfrom
mnadzam:test/sources

Conversation

@mnadzam
Copy link
Copy Markdown
Contributor

@mnadzam mnadzam commented May 19, 2026

  • Add dedicated unit tests for get_source_type(), download_source(), unpack_source(), write_build_meta(), read_build_meta(), prepare_source(), ensure_pkg_info(), and build_sdist() in sources.py.

  • Increase unit test coverage of sources.py from 44% to 77%.

  • Closes test: add coverage for source pipeline (sources.py) #1098

  • Co-authored-by: Cursor

  • PR follows CONTRIBUTING.md guidelines

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@mnadzam has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 9 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f3b52d14-eed1-4f81-9bc0-07c8c4ce28f6

📥 Commits

Reviewing files that changed from the base of the PR and between 67b4470 and 63adaff.

📒 Files selected for processing (1)
  • tests/test_sources.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mergify mergify Bot added the ci label May 19, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_sources.py`:
- Line 700: Replace the test URL domain to use the .test TLD: locate the
download_url assignment (download_url="https://example.com/pkg-1.0.tar.gz",) in
tests/test_sources.py and change the host from example.com to pkg.test (e.g.,
"https://pkg.test/pkg-1.0.tar.gz") so the test uses the approved .test domain.
- Line 484: The test uses a URL with the example.com TLD; update the hardcoded
return_value string to use the .test TLD instead (e.g., replace
"https://example.com/pkg-1.0.tar.gz" with "https://pkg.test/pkg-1.0.tar.gz") in
tests/test_sources.py where the mock/fixture sets return_value so the test
follows the .test guideline.
- Line 681: Update the test data to use the `.test` TLD instead of example.com:
locate the download_url assignment in tests/test_sources.py (the download_url
variable/argument set to "https://example.com/pkg-1.0.tar.gz") and change it to
use a .test domain such as "https://pkg.test/pkg-1.0.tar.gz" (or the canonical
test path your suite expects) so tests follow the coding guideline.
- Line 344: Replace the hardcoded pathlib.Path("/tmp/numpy-1.0.tar.gz")
assignment for source_filename with the pytest tmp_path fixture so tests are
portable; update the assignment of source_filename to use tmp_path /
"numpy-1.0.tar.gz" (or pathlib.Path(tmp_path) / "numpy-1.0.tar.gz" if needed)
wherever source_filename is defined in the test to ensure it works on non-Unix
systems.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ca4573f7-4eac-41fc-80bc-cdcc2626059c

📥 Commits

Reviewing files that changed from the base of the PR and between 029327a and 67b4470.

📒 Files selected for processing (1)
  • tests/test_sources.py

Comment thread tests/test_sources.py Outdated
Comment thread tests/test_sources.py Outdated
Comment thread tests/test_sources.py Outdated
Comment thread tests/test_sources.py Outdated
- Add dedicated unit tests for get_source_type(), download_source(),
unpack_source(), write_build_meta(), read_build_meta(), prepare_source(),
ensure_pkg_info(), and build_sdist() in sources.py.
- Increase unit test coverage of sources.py from 44% to 77%.

Closes python-wheel-build#1098

Signed-off-by: Marcel Nadzam <mnadzam@redhat.com>

Co-authored-by: Cursor
@mnadzam mnadzam marked this pull request as ready for review May 19, 2026 14:15
@mnadzam mnadzam requested a review from a team as a code owner May 19, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add coverage for source pipeline (sources.py)

1 participant