Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .bandit.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .flake8

This file was deleted.

7 changes: 2 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -62,12 +62,9 @@ test:
- any-glob-to-any-file:
# Add any test-related files or paths.
- .ansible-lint
- .bandit.yml
- .flake8
- .isort.cfg
- .mdl_config.yaml
- .yamllint
- pytest.ini
- pyproject.toml
- tests/**
typescript:
- changed-files:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ __pycache__
.pytest_cache
.python-version
*.egg-info
build
dist
10 changes: 0 additions & 10 deletions .isort.cfg

This file was deleted.

7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.9.1
Expand All @@ -154,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: 7.0.0
hooks:
Expand Down
125 changes: 125 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# For more information about configuring project metadata for the
# setuptools build backend, please see
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools"]

[project]
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
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
"Environment :: Console",
# Indicate who your project is intended for
"Intended Audience :: Developers",
"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",
"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 = ["readme", "version"]
keywords = ["skeleton"]
license = "CC0-1.0"
name = "example"
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]
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"

[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.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
# 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__"}

[tool.setuptools.package-data]
example = ["data/*.txt"]
4 changes: 0 additions & 4 deletions pytest.ini

This file was deleted.

116 changes: 0 additions & 116 deletions setup.py

This file was deleted.