Skip to content

feat!: add pyproject and refactor tests - #5

Merged
szymonmaszke merged 2 commits into
mainfrom
4
May 7, 2026
Merged

szymonmaszke merged 2 commits into
mainfrom
4

Conversation

@szymonmaszke

@szymonmaszke szymonmaszke commented May 7, 2026 •

Copy link
Copy Markdown
Member

Checklist

  • I agree to follow this project's Code of Conduct
  • I have read this project's Contributing Guide
  • I have created relevant issue(s) and linked them in the PR description

Closes #4

Additional information

Other changes include:

  • breaking API (path no longer supported, autoload as the only way to load pyproject.toml or tool config)
  • refactored and improved tests

Copilot AI review requested due to automatic review settings May 7, 2026 18:32
@github-actions github-actions Bot added deps Dependencies updates actions GitHub Actions updates config Configuration files updates tests Tests updates src Source code updates python Python related changes feat Feature feat! Breaking fix labels May 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.error module.

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.

Comment thread src/loadfig/_config.py Resolved
Comment thread src/loadfig/_file.py Resolved
Comment thread src/loadfig/_pyproject.py Resolved
Comment thread src/loadfig/_load.py Resolved
Comment thread tests/test_pyproject.py Resolved
Comment thread src/loadfig/_config.py Resolved
Comment thread src/loadfig/_config.py Resolved
Comment thread src/loadfig/_pyproject.py Resolved
Signed-off-by: szymonmaszke <github@maszke.co>
Signed-off-by: szymonmaszke <github@maszke.co>
@szymonmaszke
szymonmaszke merged commit f558e83 into main May 7, 2026
93 of 98 checks passed
@szymonmaszke
szymonmaszke deleted the 4 branch May 7, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actions GitHub Actions updates config Configuration files updates deps Dependencies updates feat Feature feat! Breaking fix python Python related changes src Source code updates tests Tests updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Load both pyproject.toml as a whole and the config of specific tool

2 participants