Add pythonpath config to pytest if necessary#534
Merged
nathanjmcdougall merged 3 commits intomainfrom Apr 21, 2025
Merged
Conversation
CodSpeed Performance ReportMerging #534 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #534 +/- ##
=======================================
Coverage 97.25% 97.26%
=======================================
Files 85 86 +1
Lines 4120 4130 +10
=======================================
+ Hits 4007 4017 +10
Misses 113 113 ☔ View full report in Codecov by Sentry. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances pytest configuration by conditionally setting the pythonpath based on the project configuration and source directory structure.
- Introduces a new test (test_pythonpath_needed) in tests/usethis/_core/test_core_tool.py to validate the pythonpath behavior.
- Updates src/usethis/_tool.py to set the pythonpath if the project lacks a declared build system.
- Adds a new utility function in src/usethis/_integrations/project/build.py to detect a declared build system in pyproject.toml.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/usethis/_core/test_core_tool.py | Added new test for validating pythonpath configuration. |
| src/usethis/_tool.py | Added conditional logic to set pythonpath based on source directory. |
| src/usethis/_integrations/project/build.py | New function to check for declared build system in pyproject.toml. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.