-
Notifications
You must be signed in to change notification settings - Fork 16
Move all Python tool configs to pyproject.toml
#235
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
Move all Python tool configs to pyproject.toml
#235
Conversation
We can configure all our Python tooling in a single pyproject.toml file. Note that using pyproject.toml to configure flake8 requires the addition of the flake8-pyproject Python library.
…mmit hook This will ensure that, even when run as a pre-commit hook, flake8 reads its configuration from the pyproject.toml file.
Also remove .flake8 and .isort.cfg as triggers for the same label.
flake8 and isort configs to pyproject.tomlpyproject.toml
This file was doing nothing due to its contents.
The flake8-docstrings dependency is pinned, so this one should be too.
b5d84c8 to
15cb601
Compare
dav3r
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 This all makes sense to me.
There was a problem hiding this comment.
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 consolidates Python tool configurations into pyproject.toml, migrating from separate configuration files (.flake8, .isort.cfg, .bandit.yml) to a centralized TOML-based approach. This modernizes the project's configuration management by leveraging the standard pyproject.toml file.
Key Changes:
- Migrated flake8 configuration to
pyproject.tomlusing theflake8-pyprojectplugin - Consolidated isort configuration into
pyproject.toml - Removed bandit custom configuration file and simplified to use defaults
- Updated GitHub labeler to track
pyproject.tomlinstead of removed config files
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
requirements-test.txt |
Added flake8-pyproject dependency to enable flake8 to read configuration from pyproject.toml |
pyproject.toml |
Migrated flake8 and isort configurations from separate files to TOML format; updated flake8 config to use [tool.flake8] section with array syntax and extend-ignore |
.pre-commit-config.yaml |
Removed bandit config file argument and added flake8-pyproject==1.2.3 dependency to flake8 hook |
.isort.cfg |
Deleted file - configuration moved to pyproject.toml |
.github/labeler.yml |
Updated test-related file tracking to include pyproject.toml and remove deleted config files |
.bandit.yml |
Deleted file - using bandit defaults instead of custom configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
flake8 itself isn't installed here, so this dependency shouldn't be either. This jibes with the fact that we don't install flake8-docstrings (another dependency of the flake8 pre-commit hook) into the virtual environment either.
🗣 Description
This pull request:
flake8andisortconfigurations to apyproject.tomlfile.banditconfigurationSee also cisagov/skeleton-python-library#164.
💭 Motivation and context
banditconfiguration wasn't actually doing anything due to its contents.Resolves #233. Resolves #234.
🧪 Testing
All automated tests pass.
✅ Pre-approval checklist