Repository navigation
feat!: add pyproject and refactor tests - #5
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces first-class pyproject.toml loading and refactors configuration/file lookup internals, alongside a test suite restructure and Python/tooling version bumps. It aligns with the project’s goal of dependency-free TOML config discovery while expanding supported config locations (including .config/{name}.toml) and adding caching for TOML reads.
Changes:
- Add
loadfig.pyproject()plus internal_pyproject.py,_file.py, and cached TOML loading via_load.toml(). - Refactor
loadfig.config()lookup order (including.config/{name}.toml) and update/expand tests for config + file discovery. - Update project/tooling metadata (Python versions, workflows, pre-commit, lint config, osv-scanner overrides) and remove the old
loadfig.errormodule.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_pyproject.py | Adds tests for loadfig.pyproject() behavior. |
| tests/test_file.py | Adds tests for low-level file discovery (_file.find). |
| tests/test_config.py | Refactors config lookup tests and adds coverage for .config/{name}.toml. |
| src/loadfig/error.py | Removes previous custom error module (breaking change). |
| src/loadfig/_pyproject.py | Adds implementation of pyproject() discovery/loading. |
| src/loadfig/_load.py | Introduces cached TOML loading. |
| src/loadfig/_file.py | Adds VCS-aware file discovery helper. |
| src/loadfig/_config.py | Refactors config lookup implementation and supported locations. |
| src/loadfig/init.py | Exports pyproject from the package API. |
| README.md | Documents new pyproject() API and config locations. |
| pyproject.toml | Updates Python version targets, scripts, and related tooling config. |
| osv-scanner.toml | Adds additional package license ignore overrides. |
| .yamllint.yml | Adjusts YAML line-length configuration. |
| .pre-commit-config.yaml | Bumps hook revisions. |
| .github/workflows/tests-reusable.yml | Updates test matrix Python versions. |
| .github/workflows/run-reusable.yml | Updates default Python version input. |
| .github/workflows/release-sboms-reusable.yml | Updates Python matrix and adds permission comments. |
| .github/workflows/release-sbom-run-reusable.yml | Updates default Python version input. |
| .github/workflows/cache-reusable.yml | Updates cache matrix Python versions. |
| .github/workflows/cache-item-reusable.yml | Updates default Python version input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: szymonmaszke <github@maszke.co>
Signed-off-by: szymonmaszke <github@maszke.co>
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.
Checklist
Additional information
Other changes include:
pathno longer supported, autoload as the only way to loadpyproject.tomlor tool config)