Skip to content
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

python3Packages.pytest-cov-stub: init at 1.0.0 #328550

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

pbsds
Copy link
Member

@pbsds pbsds commented Jul 20, 2024

Description of changes

#327220 (comment) finally inspired me to implement this idea I've been brewing for quite a while: a pytest-cov stub that does nothing but accept the command line options and provide empty no-op fixtures.

follow-up candidates for stubbing:

  • pytest-pylint
  • pytest-pycodestyle

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@pbsds pbsds changed the title Init pytest coverage shim 1721428630 python3Packages.pytest-cov-stub: init at 1.0.0 Jul 20, 2024
@pbsds pbsds marked this pull request as ready for review July 20, 2024 00:44
@pbsds pbsds requested a review from natsukium as a code owner July 20, 2024 00:44
@pbsds pbsds requested review from mweinelt, emilazy and FRidh July 20, 2024 00:44
@pbsbot
Copy link

pbsbot commented Jul 20, 2024

Result of nixpkgs-review pr 328550 run on x86_64-linux 1

20 packages built:
  • python311Packages.birch
  • python311Packages.birch.dist
  • python311Packages.cachier
  • python311Packages.cachier.dist
  • python311Packages.pytest-cov-stub
  • python311Packages.pytest-cov-stub.dist
  • python311Packages.strct
  • python311Packages.strct.dist
  • python312Packages.birch
  • python312Packages.birch.dist
  • python312Packages.cachier
  • python312Packages.cachier.dist
  • python312Packages.pytest-cov-stub
  • python312Packages.pytest-cov-stub.dist
  • python312Packages.strct
  • python312Packages.strct.dist
  • remote-exec
  • remote-exec.dist
  • todoman
  • todoman.dist

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Jul 20, 2024
@ofborg ofborg bot requested a review from antonmosich July 20, 2024 01:12
@emilazy
Copy link
Member

emilazy commented Jul 20, 2024

Interesting. Seems like a reasonable enough approach. Is pytest-cov really so slow that it’s worth the effort to stub this out? Or is it a matter of avoiding spurious failures?

@pbsds
Copy link
Member Author

pbsds commented Jul 21, 2024

coverage testing is a developer sanity test, not neccesarily a correctness test. It should not block distribution and common practice in nixpkgs is to patch it out, as shown in some of the examples in this PR.

EDIT: also it puts the interpreter in a mode where it records all lines executed, which greatly slows down the test suite.

@pbsds pbsds force-pushed the init-pytest-coverage-shim-1721428630 branch from 2d45c5c to 4619c4c Compare July 21, 2024 11:28
@pbsds
Copy link
Member Author

pbsds commented Jul 21, 2024

I pushed a change that re-implements the stubs rather than wrap the ones from pytest-cov, which will save a lot of rebuilds

@pbsbot
Copy link

pbsbot commented Jul 21, 2024

Result of nixpkgs-review pr 328550 run on x86_64-linux 1

20 packages built:
  • python311Packages.birch
  • python311Packages.birch.dist
  • python311Packages.cachier
  • python311Packages.cachier.dist
  • python311Packages.pytest-cov-stub
  • python311Packages.pytest-cov-stub.dist
  • python311Packages.strct
  • python311Packages.strct.dist
  • python312Packages.birch
  • python312Packages.birch.dist
  • python312Packages.cachier
  • python312Packages.cachier.dist
  • python312Packages.pytest-cov-stub
  • python312Packages.pytest-cov-stub.dist
  • python312Packages.strct
  • python312Packages.strct.dist
  • remote-exec
  • remote-exec.dist
  • todoman
  • todoman.dist

@pbsds
Copy link
Member Author

pbsds commented Jul 21, 2024

@ofborg build python311Packages.pytest-cov-stub python312Packages.pytest-cov-stub

@pbsds pbsds added the backport release-24.05 Backport PR automatically label Jul 30, 2024
@pbsds pbsds merged commit a5779e9 into NixOS:master Jul 30, 2024
33 checks passed
Copy link
Contributor

Successfully created backport PR for release-24.05:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants