Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class Nix support for pytest-language-server and adjusts workspace scanning to avoid Nix sandbox path components (e.g., /build) triggering skip-directory logic.
Changes:
- Canonicalize the workspace root once and ensure skip-directory checks only inspect components relative to the workspace root.
- Add a
flake.nixproviding abuildRustPackagepackage output and a Rust dev shell. - Add
flake.lockpinningnixpkgs.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/fixtures/scanner.rs |
Adjusts workspace root handling and skip-directory checks to behave correctly in Nix sandboxes. |
flake.nix |
Introduces Nix flake packaging and a development shell. |
flake.lock |
Pins nixpkgs input for reproducible builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #107 +/- ##
==========================================
- Coverage 63.17% 63.12% -0.05%
==========================================
Files 26 26
Lines 3392 3393 +1
==========================================
- Hits 2143 2142 -1
- Misses 1249 1251 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@barrettruth can you check both comments from copilot? Also, do we need to have a flow like https://github.com/bellini666/pytest-language-server/blob/master/.github/workflows/release.yml#L157 for this? Or a single flow that does both? |
Problem: scan_workspace_with_excludes checked every component of the absolute path against SKIP_DIRECTORIES. In environments where the workspace lives under a directory whose name matches a skip entry (e.g. Nix sandbox uses TMPDIR=/build, and "build" is in SKIP_DIRECTORIES), all files were silently skipped and no fixtures were discovered. Solution: canonicalize root_path once at the top of the function and strip_prefix before checking path components, so only components relative to the workspace root are inspected.
00dfa02 to
63ce29f
Compare
Problem: no Nix packaging existed for pytest-language-server, making it harder to install and develop on NixOS or with nix. Solution: add flake.nix with a buildRustPackage derivation (doCheck enabled) and a dev shell providing the Rust toolchain. Version is read from Cargo.toml to avoid drift. Closes #99
63ce29f to
8dc5954
Compare
|
@bellini666 thanks for the response. Both issues fixed from the bot. As per your question, this PR is "missing" a final step - actually adding a PR up to And, helpfully, if pytest-language-server is added to the registry, it will be automatically re-built and updated - no need for any maintenance on our side. In other words, after this PR and the upstream one gets merged, pytest-language-server will be fully usable in nix. |
|
@barrettruth nice! After CI is green I'll merge this! Do we need a new release for this or just being on |
|
No release needed / thanks! |
Problem
No Nix packaging exists for pytest-language-server (#99), making it harder
to install and develop on NixOS or with nix.
Additionally, two tests (
test_exclude_patterns_in_workspace_scanandtest_exclude_patterns_glob_matching) fail inside the Nix build sandboxbecause
scan_workspace_with_excludeschecks every component of theabsolute path against
SKIP_DIRECTORIES. In the sandbox,TMPDIR=/build,and
"build"is a skip entry, so all files are silently skipped.Solution
Scanner fix: canonicalize
root_pathat the top ofscan_workspace_with_excludesand usestrip_prefixbefore theskip-directory check so only path components relative to the workspace
root are inspected.
Flake: add
flake.nixwith abuildRustPackagederivation(
doCheck = true, tests pass after the fix) and a dev shell providingthe Rust toolchain. Supports
x86_64-linux,aarch64-linux,x86_64-darwin, andaarch64-darwin.A nixpkgs package has also been drafted at NixOS/nixpkgs#495575,
pending this fix being merged and released.
Closes #99