From 336618a8848a51ce56322e045a3955a12ee13a13 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 28 Oct 2025 13:13:42 -0400 Subject: [PATCH 01/15] Add pyproject.toml and remove setup.py --- .github/labeler.yml | 2 +- pyproject.toml | 74 ++++++++++++++++++++++++++++ setup.py | 116 -------------------------------------------- 3 files changed, 75 insertions(+), 117 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/labeler.yml b/.github/labeler.yml index 0826a4d..bfce97d 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -18,7 +18,7 @@ dependencies: # Add any dependency files used. - .pre-commit-config.yaml - requirements*.txt - - setup.py + - pyproject.toml docker: - changed-files: - any-glob-to-any-file: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a9d5cf3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,74 @@ +# For more information about configuring project metadata for the +# hatch build backend, please see +# https://hatch.pypa.io/latest/config/metadata/ +[build-system] +build-backend = "hatchling.build" +requires = ["hatchling"] + +[project] +authors = [ + { name = "Cybersecurity and Infrastructure Security Agency", email = "github@cisa.dhs.gov" } +] +classifiers = [ + # How mature is this project? Common values are + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + "Development Status :: 3 - Alpha", + # Indicate who your project is intended for + "Intended Audience :: Developers", + # Pick your license as you wish (should match "license" above) + "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", + # Specify the Python versions you support here. In particular, ensure + # that you indicate whether you support Python 2, Python 3 or both. + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: Implementation :: CPython", +] +dependencies = [ + "docopt", + "schema", +] +description = "Example Python library" +dynamic = ["version"] +keywords = ["skeleton"] +license = " CC-BY-1.0" +name = "example" +readme = "README.md" +requires-python = ">=3.9" + +[project.optional-dependencies] +# IMPORTANT: Keep type hinting-related dependencies of the dev section +# in sync with the mypy pre-commit hook configuration (see +# .pre-commit-config.yaml). Any changes to type hinting-related +# dependencies here should be reflected in the additional_dependencies +# field of the mypy pre-commit hook to avoid discrepancies in type +# checking between environments. +dev = [ + "types-docopt", + "types-setuptools", +] +test = [ + "coverage", + "coveralls", + "pre-commit", + "pytest-cov", + "pytest", +] + +[project.scripts] +example = "example.example:main" + +[project.urls] +Mission = "https://www.cisa.gov/cybersecurity" +Source = "https://github.com/cisagov/skeleton-python-library" +Tracker = "https://github.com/cisagov/skeleton-python-library/issues" + +[tool.hatch.version] +path = "src/example/_version.py" diff --git a/setup.py b/setup.py deleted file mode 100644 index 16fe44c..0000000 --- a/setup.py +++ /dev/null @@ -1,116 +0,0 @@ -""" -This is the setup module for the example project. - -Based on: - -- https://packaging.python.org/distributing/ -- https://github.com/pypa/sampleproject/blob/master/setup.py -- https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure -""" - -# Standard Python Libraries -import codecs -from glob import glob -from os.path import abspath, basename, dirname, join, splitext - -# Third-Party Libraries -from setuptools import find_packages, setup - - -def readme(): - """Read in and return the contents of the project's README.md file.""" - with open("README.md", encoding="utf-8") as f: - return f.read() - - -# Below two methods were pulled from: -# https://packaging.python.org/guides/single-sourcing-package-version/ -def read(rel_path): - """Open a file for reading from a given relative path.""" - here = abspath(dirname(__file__)) - with codecs.open(join(here, rel_path), "r") as fp: - return fp.read() - - -def get_version(version_file): - """Extract a version number from the given file path.""" - for line in read(version_file).splitlines(): - if line.startswith("__version__"): - delim = '"' if '"' in line else "'" - return line.split(delim)[1] - raise RuntimeError("Unable to find version string.") - - -setup( - name="example", - # Versions should comply with PEP440 - version=get_version("src/example/_version.py"), - description="Example Python library", - long_description=readme(), - long_description_content_type="text/markdown", - # Landing page for CISA's cybersecurity mission - url="https://www.cisa.gov/cybersecurity", - # Additional URLs for this project per - # https://packaging.python.org/guides/distributing-packages-using-setuptools/#project-urls - project_urls={ - "Source": "https://github.com/cisagov/skeleton-python-library", - "Tracker": "https://github.com/cisagov/skeleton-python-library/issues", - }, - # Author details - author="Cybersecurity and Infrastructure Security Agency", - author_email="github@cisa.dhs.gov", - license="License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - # How mature is this project? Common values are - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - "Development Status :: 3 - Alpha", - # Indicate who your project is intended for - "Intended Audience :: Developers", - # Pick your license as you wish (should match "license" above) - "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", - # Specify the Python versions you support here. In particular, ensure - # that you indicate whether you support Python 2, Python 3 or both. - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "Programming Language :: Python :: Implementation :: CPython", - ], - python_requires=">=3.9", - # What does your project relate to? - keywords="skeleton", - packages=find_packages(where="src"), - package_dir={"": "src"}, - package_data={"example": ["data/*.txt"]}, - py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")], - include_package_data=True, - install_requires=["docopt", "schema", "setuptools"], - extras_require={ - # IMPORTANT: Keep type hinting-related dependencies of the dev section - # in sync with the mypy pre-commit hook configuration (see - # .pre-commit-config.yaml). Any changes to type hinting-related - # dependencies here should be reflected in the additional_dependencies - # field of the mypy pre-commit hook to avoid discrepancies in type - # checking between environments. - "dev": [ - "types-docopt", - "types-setuptools", - ], - "test": [ - "coverage", - "coveralls", - "pre-commit", - "pytest-cov", - "pytest", - ], - }, - # Conveniently allows one to run the CLI tool as `example` - entry_points={"console_scripts": ["example = example.example:main"]}, -) From c02b9d2bc5f17757b0eda718b2f9a32800c06c5a Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 28 Oct 2025 13:35:17 -0400 Subject: [PATCH 02/15] Move pytest config to pyproject.toml --- pyproject.toml | 6 ++++++ pytest.ini | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 pytest.ini diff --git a/pyproject.toml b/pyproject.toml index a9d5cf3..e03e669 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,3 +72,9 @@ Tracker = "https://github.com/cisagov/skeleton-python-library/issues" [tool.hatch.version] path = "src/example/_version.py" + +[tool.pytest.ini_options] +# Increase verbosity, display extra test summary info for tests that +# did not pass, display code coverage results, and enable debug +# logging. +addopts = "--verbose -ra --cov --log-cli-level=DEBUG" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index a1c266e..0000000 --- a/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -# Increase verbosity, display extra test summary info for tests that did not pass, -# display code coverage results, and enable debug logging -addopts = --verbose -ra --cov --log-cli-level=DEBUG From 8a10d11f98e14fe99d27ef6b7f443247bd204203 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 28 Oct 2025 14:51:01 -0400 Subject: [PATCH 03/15] Add pyproject.toml as a trigger for the test label This is because this file now contains configurations for test tools. Also remove test tool config files that no longer exist. --- .github/labeler.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index bfce97d..5ba6c2a 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -56,10 +56,9 @@ test: - .ansible-lint - .bandit.yml - .flake8 - - .isort.cfg - .mdl_config.yaml - .yamllint - - pytest.ini + - pyproject.toml - tests/** typescript: - changed-files: From 60d3f117203387b8cec2c470774f3180beec4585 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 28 Oct 2025 15:05:45 -0400 Subject: [PATCH 04/15] Add a few helpful comments These may be of use to folks who are editing pyproject.toml for a descendant of this skeleton repository. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e03e669..9c8d707 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ requires = ["hatchling"] authors = [ { name = "Cybersecurity and Infrastructure Security Agency", email = "github@cisa.dhs.gov" } ] +# See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers = [ # How mature is this project? Common values are # 3 - Alpha @@ -66,11 +67,13 @@ test = [ example = "example.example:main" [project.urls] +# Landing page for CISA's cybersecurity mission Mission = "https://www.cisa.gov/cybersecurity" Source = "https://github.com/cisagov/skeleton-python-library" Tracker = "https://github.com/cisagov/skeleton-python-library/issues" [tool.hatch.version] +# Versions should comply with PEP440 path = "src/example/_version.py" [tool.pytest.ini_options] From 3b8d5fcc036bfd470be60d46a51d17b20d6dbcd5 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 28 Oct 2025 15:37:47 -0400 Subject: [PATCH 05/15] Add a few more classifiers --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 9c8d707..c83342c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,13 @@ classifiers = [ # 4 - Beta # 5 - Production/Stable "Development Status :: 3 - Alpha", + "Environment :: Console", # Indicate who your project is intended for "Intended Audience :: Developers", # Pick your license as you wish (should match "license" above) "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", + "Natural Language :: English", + "Operating System :: OS Independent", # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. "Programming Language :: Python :: 3", From 8cb395a8ca4cc3ba96ecbd3c4f02c2f056281fe0 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Thu, 6 Nov 2025 12:47:23 -0500 Subject: [PATCH 06/15] Correct license SPDX expression Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c83342c..13a3955 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ dependencies = [ description = "Example Python library" dynamic = ["version"] keywords = ["skeleton"] -license = " CC-BY-1.0" +license = "CC0-1.0" name = "example" readme = "README.md" requires-python = ">=3.9" From da7213e4f1c25bedcd52ec4267a494e85102a106 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Thu, 6 Nov 2025 16:53:10 -0500 Subject: [PATCH 07/15] Move contents of .bandit.yml to CLI option in .pre-commit-config.yaml This gets rid of the .bandit.yml file that was being used only against the test code. --- .bandit.yml | 14 -------------- .github/labeler.yml | 1 - .pre-commit-config.yaml | 4 +++- 3 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 .bandit.yml diff --git a/.bandit.yml b/.bandit.yml deleted file mode 100644 index 3215b91..0000000 --- a/.bandit.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# Configuration file for the Bandit python security scanner -# https://bandit.readthedocs.io/en/latest/config.html -# This config is applied to bandit when scanning the "tests" tree - -# Tests are first included by `tests`, and then excluded by `skips`. -# If `tests` is empty, all tests are considered included. - -tests: -# - B101 -# - B102 - -skips: - - B101 # skip "assert used" check since assertions are required in pytests diff --git a/.github/labeler.yml b/.github/labeler.yml index 5ba6c2a..e43a370 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -54,7 +54,6 @@ test: - any-glob-to-any-file: # Add any test-related files or paths. - .ansible-lint - - .bandit.yml - .flake8 - .mdl_config.yaml - .yamllint diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df67df9..5972e8b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -136,7 +136,9 @@ repos: name: bandit (tests tree) files: tests args: - - --config=.bandit.yml + # Skip "assert used" check since assertions are used + # frequently in pytests. + - --skip=B101 # Run bandit on everything except the "tests" tree - repo: https://github.com/PyCQA/bandit rev: 1.8.6 From 7b9de90b118f108a896ff6840e72c4c00b2676f0 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Mon, 10 Nov 2025 09:55:03 -0500 Subject: [PATCH 08/15] Remove deprecated license classifier See here for more details: https://packaging.python.org/en/latest/specifications/pyproject-toml/#classifiers --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 13a3955..eba5f59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,8 +19,6 @@ classifiers = [ "Environment :: Console", # Indicate who your project is intended for "Intended Audience :: Developers", - # Pick your license as you wish (should match "license" above) - "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Natural Language :: English", "Operating System :: OS Independent", # Specify the Python versions you support here. In particular, ensure From 13abf00d5970dd4ca175d31340ccade4ea55a58a Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Mon, 10 Nov 2025 09:57:42 -0500 Subject: [PATCH 09/15] Use well-known labels for project URL keys See here for more details: https://packaging.python.org/en/latest/specifications/well-known-project-urls/#well-known-labels --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index eba5f59..370ba01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,10 +68,11 @@ test = [ example = "example.example:main" [project.urls] +homepage = "https://github.com/cisagov/skeleton-python-library" +issues = "https://github.com/cisagov/skeleton-python-library/issues" # Landing page for CISA's cybersecurity mission -Mission = "https://www.cisa.gov/cybersecurity" -Source = "https://github.com/cisagov/skeleton-python-library" -Tracker = "https://github.com/cisagov/skeleton-python-library/issues" +mission = "https://www.cisa.gov/cybersecurity" +source = "https://github.com/cisagov/skeleton-python-library" [tool.hatch.version] # Versions should comply with PEP440 From 461f87203d6c74da55f5fba2a4e876cb6cef93d2 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Mon, 10 Nov 2025 14:07:17 -0500 Subject: [PATCH 10/15] Switch to using the setuptools build backend The setuptools build backend: - Supports native extensions, in contrast with the hatchling build backend - Is the most commonly used build backend among projects on PyPI - Is an officially supported build backend from Python, in contrast with the hatchling build backend --- pyproject.toml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 370ba01..5f4e575 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ # For more information about configuring project metadata for the -# hatch build backend, please see -# https://hatch.pypa.io/latest/config/metadata/ +# setuptools build backend, please see +# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html [build-system] -build-backend = "hatchling.build" -requires = ["hatchling"] +build-backend = "setuptools.build_meta" +requires = ["setuptools"] [project] authors = [ @@ -38,11 +38,10 @@ dependencies = [ "schema", ] description = "Example Python library" -dynamic = ["version"] +dynamic = ["readme", "version"] keywords = ["skeleton"] license = "CC0-1.0" name = "example" -readme = "README.md" requires-python = ">=3.9" [project.optional-dependencies] @@ -74,12 +73,12 @@ issues = "https://github.com/cisagov/skeleton-python-library/issues" mission = "https://www.cisa.gov/cybersecurity" source = "https://github.com/cisagov/skeleton-python-library" -[tool.hatch.version] -# Versions should comply with PEP440 -path = "src/example/_version.py" - [tool.pytest.ini_options] # Increase verbosity, display extra test summary info for tests that # did not pass, display code coverage results, and enable debug # logging. addopts = "--verbose -ra --cov --log-cli-level=DEBUG" + +[tool.setuptools.dynamic] +readme = {file = ["README.md"], content-type = "text/markdown"} +version = {attr = "example._version.__version__"} From da6d6a2c4fad5a3c75da626585fd654796991a0a Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Mon, 10 Nov 2025 14:27:04 -0500 Subject: [PATCH 11/15] Add package-data This ensures that the data file(s) are incorporated into the wheels that are built. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 5f4e575..cadd7da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,3 +82,6 @@ addopts = "--verbose -ra --cov --log-cli-level=DEBUG" [tool.setuptools.dynamic] readme = {file = ["README.md"], content-type = "text/markdown"} version = {attr = "example._version.__version__"} + +[tool.setuptools.package-data] +example = ["data/*.txt"] From a4a51676833ec0a19ea285a65396e62e3bb07e1f Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Mon, 10 Nov 2025 14:29:57 -0500 Subject: [PATCH 12/15] Add build dir to .gitignore This directory can be created by `pip install .`. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 242b4aa..579601b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ __pycache__ .pytest_cache .python-version *.egg-info +build dist From b598b704d44dee9045ca7ae8e3c83ff02c8f329a Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 18 Nov 2025 14:45:57 -0500 Subject: [PATCH 13/15] Move flake8 configuration to pyproject.toml Note that using pyproject.toml to configure flake8 requires the addition of the flake8-pyproject Python library. --- .flake8 | 25 ------------------------- .pre-commit-config.yaml | 3 +++ pyproject.toml | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 25 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 92ff826..0000000 --- a/.flake8 +++ /dev/null @@ -1,25 +0,0 @@ -[flake8] -max-line-length = 80 -# Select (turn on) -# * Complexity violations reported by mccabe (C) - -# http://flake8.pycqa.org/en/latest/user/error-codes.html#error-violation-codes -# * Documentation conventions compliance reported by pydocstyle (D) - -# http://www.pydocstyle.org/en/stable/error_codes.html -# * Default errors and warnings reported by pycodestyle (E and W) - -# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes -# * Default errors reported by pyflakes (F) - -# http://flake8.pycqa.org/en/latest/glossary.html#term-pyflakes -# * Default warnings reported by flake8-bugbear (B) - -# https://github.com/PyCQA/flake8-bugbear#list-of-warnings -# * The B950 flake8-bugbear opinionated warning - -# https://github.com/PyCQA/flake8-bugbear#opinionated-warnings -select = C,D,E,F,W,B,B950 -# Ignore flake8's default warning about maximum line length, which has -# a hard stop at the configured value. Instead we use -# flake8-bugbear's B950, which allows up to 10% overage. -# -# Also ignore flake8's warning about line breaks before binary -# operators. It no longer agrees with PEP8. See, for example, here: -# https://github.com/ambv/black/issues/21. Guido agrees here: -# https://github.com/python/peps/commit/c59c4376ad233a62ca4b3a6060c81368bd21e85b. -ignore = E501,W503 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5972e8b..fe35bfb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -156,6 +156,9 @@ repos: - id: flake8 additional_dependencies: - flake8-docstrings==1.7.0 + # This is necessary to read the flake8 configuration from + # the pyproject.toml file. + - flake8-pyproject==1.2.3 - repo: https://github.com/PyCQA/isort rev: 6.0.1 hooks: diff --git a/pyproject.toml b/pyproject.toml index cadd7da..7d3880b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,6 +73,32 @@ issues = "https://github.com/cisagov/skeleton-python-library/issues" mission = "https://www.cisa.gov/cybersecurity" source = "https://github.com/cisagov/skeleton-python-library" +[tool.flake8] +max-line-length = 80 +# Select (turn on) +# * Complexity violations reported by mccabe (C) - +# http://flake8.pycqa.org/en/latest/user/error-codes.html#error-violation-codes +# * Documentation conventions compliance reported by pydocstyle (D) - +# http://www.pydocstyle.org/en/stable/error_codes.html +# * Default errors and warnings reported by pycodestyle (E and W) - +# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes +# * Default errors reported by pyflakes (F) - +# http://flake8.pycqa.org/en/latest/glossary.html#term-pyflakes +# * Default warnings reported by flake8-bugbear (B) - +# https://github.com/PyCQA/flake8-bugbear#list-of-warnings +# * The B950 flake8-bugbear opinionated warning - +# https://github.com/PyCQA/flake8-bugbear#opinionated-warnings +select = ["C", "D", "E", "F", "W", "B", "B950"] +# Ignore flake8's default warning about maximum line length, which has +# a hard stop at the configured value. Instead we use +# flake8-bugbear's B950, which allows up to 10% overage. +# +# Also ignore flake8's warning about line breaks before binary +# operators. It no longer agrees with PEP8. See, for example, here: +# https://github.com/ambv/black/issues/21. Guido agrees here: +# https://github.com/python/peps/commit/c59c4376ad233a62ca4b3a6060c81368bd21e85b. +extend-ignore = ["E501", "W503"] + [tool.pytest.ini_options] # Increase verbosity, display extra test summary info for tests that # did not pass, display code coverage results, and enable debug From 077d3a241274f96ead02efe570735756d3a916ef Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 18 Nov 2025 14:55:25 -0500 Subject: [PATCH 14/15] Move isort config to pyproject.toml file --- .isort.cfg | 10 ---------- pyproject.toml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index 46d45f3..0000000 --- a/.isort.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[settings] -combine_star=true -force_sort_within_sections=true - -import_heading_stdlib=Standard Python Libraries -import_heading_thirdparty=Third-Party Libraries -import_heading_firstparty=cisagov Libraries - -# Run isort under the black profile to align with our other Python linting -profile=black diff --git a/pyproject.toml b/pyproject.toml index 7d3880b..bbd6892 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,6 +99,18 @@ select = ["C", "D", "E", "F", "W", "B", "B950"] # https://github.com/python/peps/commit/c59c4376ad233a62ca4b3a6060c81368bd21e85b. extend-ignore = ["E501", "W503"] +[tool.isort] +combine_star = true +force_sort_within_sections = true + +import_heading_stdlib = "Standard Python Libraries" +import_heading_thirdparty = "Third-Party Libraries" +import_heading_firstparty = "cisagov Libraries" + +# Run isort under the black profile to align with our other Python +# linting +profile = "black" + [tool.pytest.ini_options] # Increase verbosity, display extra test summary info for tests that # did not pass, display code coverage results, and enable debug From 447db4b76792f737d19398d87e1a099f5118d9d6 Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Tue, 18 Nov 2025 15:27:53 -0500 Subject: [PATCH 15/15] Remove .flake8 as a trigger for the test label --- .github/labeler.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index e43a370..7ba9520 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -54,7 +54,6 @@ test: - any-glob-to-any-file: # Add any test-related files or paths. - .ansible-lint - - .flake8 - .mdl_config.yaml - .yamllint - pyproject.toml