-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from Skyscanner/pyproject.toml
Migrate to pyproject.toml
- Loading branch information
Showing
14 changed files
with
378 additions
and
169 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
SOURCE_DIRS = cfripper tests docs | ||
SOURCE_FILES = setup.py | ||
SOURCE_ALL = $(SOURCE_DIRS) $(SOURCE_FILES) | ||
SOURCES = cfripper tests docs | ||
|
||
PIP_COMMAND = pip | ||
install: | ||
pip install -r requirements.txt | ||
$(PIP_COMMAND) install -r requirements.txt | ||
|
||
install-dev: install | ||
pip install -e ".[dev]" | ||
install-dev: | ||
$(PIP_COMMAND) install -r requirements.txt -r requirements-dev.txt . | ||
|
||
install-docs: | ||
pip install -e ".[dev,docs]" | ||
$(PIP_COMMAND) install -r requirements.txt -r requirements-docs.txt . | ||
|
||
format: | ||
isort --recursive $(SOURCE_ALL) | ||
black $(SOURCE_ALL) | ||
ruff format $(SOURCES) | ||
|
||
lint: isort-lint black-lint flake8-lint | ||
|
||
isort-lint: | ||
isort --check-only --recursive $(SOURCE_ALL) | ||
|
||
black-lint: | ||
black --check $(SOURCE_ALL) | ||
|
||
flake8-lint: | ||
flake8 $(SOURCE_ALL) | ||
lint: | ||
ruff check $(SOURCES) | ||
|
||
unit: | ||
pytest -svvv tests | ||
|
||
coverage: | ||
coverage run --source=cfripper --branch -m pytest tests/ --junitxml=build/test.xml -v | ||
coverage report | ||
coverage xml -i -o build/coverage.xml | ||
coverage html | ||
pytest --cov cfripper | ||
|
||
test: lint unit | ||
|
||
test-docs: | ||
mkdocs build --strict | ||
|
||
freeze: | ||
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile --no-emit-index-url --no-annotate --output-file requirements.txt setup.py | ||
|
||
freeze-upgrade: | ||
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile --no-emit-index-url --upgrade --no-annotate --output-file requirements.txt setup.py | ||
|
||
.PHONY: install install-dev install-docs format lint isort-lint black-lint flake8-lint unit coverage test freeze freeze-upgrade | ||
FREEZE_COMMAND = CUSTOM_COMPILE_COMMAND="make freeze" uv pip compile | ||
FREEZE_OPTIONS = --no-emit-index-url --no-annotate -v | ||
freeze-base: pyproject.toml | ||
$(FREEZE_COMMAND) $(FREEZE_OPTIONS) pyproject.toml --output-file requirements.txt | ||
freeze-dev: pyproject.toml | ||
$(FREEZE_COMMAND) $(FREEZE_OPTIONS) pyproject.toml --extra dev --output-file requirements-dev.txt | ||
freeze-docs: pyproject.toml | ||
$(FREEZE_COMMAND) $(FREEZE_OPTIONS) pyproject.toml --extra dev --extra docs --output-file requirements-docs.txt | ||
freeze: freeze-base freeze-dev freeze-docs | ||
|
||
freeze-upgrade-base: | ||
$(FREEZE_COMMAND) $(FREEZE_OPTIONS) pyproject.toml --upgrade --output-file requirements.txt | ||
freeze-upgrade-dev: | ||
$(FREEZE_COMMAND) $(FREEZE_OPTIONS) pyproject.toml --upgrade --extra dev --output-file requirements-dev.txt | ||
freeze-upgrade-docs: | ||
$(FREEZE_COMMAND) $(FREEZE_OPTIONS) pyproject.toml --upgrade --extra docs --extra dev --output-file requirements-docs.txt | ||
freeze-upgrade: freeze-upgrade-base freeze-upgrade-dev freeze-upgrade-docs | ||
|
||
|
||
.PHONY: install install-dev install-docs format lint unit coverage test freeze freeze-upgrade\ | ||
freeze-base freeze-dev freeze-docs freeze-upgrade-base freeze-upgrade-dev freeze-upgrade-docs |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,132 @@ | ||
[tool.black] | ||
[build-system] | ||
requires = ["setuptools>=64", "setuptools_scm>=8"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "cfripper" | ||
description="Library and CLI tool for analysing CloudFormation templates and check them for security compliance." | ||
readme = "README.md" | ||
requires-python = ">=3.8.0" | ||
dynamic = ["version"] | ||
license = { file = "LICENSE.md" } | ||
authors = [ | ||
{ name = "Skyscanner Security", email = "security@skyscanner.net" } | ||
] | ||
keywords = [ | ||
"security", | ||
"cloudformation", | ||
"aws", | ||
"cli" | ||
] | ||
|
||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Security" | ||
] | ||
|
||
dependencies = [ | ||
"boto3>=1.4.7,<2", | ||
"cfn_flip>=1.2.0", | ||
"click>=8.0.0", | ||
"pluggy~=0.13.1", | ||
"pycfmodel>=0.22.0", | ||
"pydash>=4.7.6", | ||
"PyYAML>=4.2b1" | ||
] | ||
|
||
[project.urls] | ||
documentation = "https://cfripper.readthedocs.io/" | ||
repository = "https://github.com/Skyscanner/cfripper" | ||
|
||
[project.scripts] | ||
cfripper = "cfripper.cli:cli" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"moto[all]>=5", | ||
"pytest-cov>=2.5.1", | ||
"pytest>=3.6", | ||
"ruff", | ||
"uv", | ||
] | ||
docs = [ | ||
"mkdocs==1.3.0", | ||
"mkdocs-macros-plugin==0.7.0", | ||
"mkdocs-material==8.2.8", | ||
"mkdocs-material-extensions==1.0.3", | ||
"mkdocs-minify-plugin==0.5.0", | ||
] | ||
|
||
[tool.ruff] | ||
# Exclude a variety of commonly ignored directories. | ||
exclude = [ | ||
".eggs", | ||
".git", | ||
".git-rewrite", | ||
".pyenv", | ||
".pytest_cache", | ||
".ruff_cache", | ||
".venv", | ||
".vscode", | ||
"__pypackages__", | ||
"_build", | ||
"build", | ||
"dist", | ||
"node_modules", | ||
"site", | ||
"site-packages", | ||
"venv", | ||
] | ||
line-length = 120 | ||
exclude = ''' | ||
/( | ||
| \.venv | ||
| venv | ||
)/ | ||
''' | ||
indent-width = 4 | ||
target-version = "py38" | ||
|
||
[tool.ruff.lint] | ||
select = ["E", "F", "W", "A", "PLC", "PLE", "PLW", "I"] | ||
ignore = ["A002", "E501"] | ||
|
||
# Allow fix for all enabled rules (when `--fix`) is provided. | ||
fixable = ["ALL"] | ||
unfixable = [] | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" | ||
|
||
[tool.ruff.format] | ||
quote-style = "double" | ||
indent-style = "space" | ||
skip-magic-trailing-comma = false | ||
line-ending = "auto" | ||
docstring-code-format = false | ||
docstring-code-line-length = "dynamic" | ||
|
||
[tool.pytest.ini_options] | ||
log_cli = true | ||
log_level = "INFO" | ||
|
||
[tool.coverage.report] | ||
show_missing = true | ||
skip_covered = false | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
source = ["cfripper"] | ||
|
||
[tool.setuptools] | ||
include-package-data = false | ||
|
||
[tool.setuptools.packages.find] | ||
# needed only because we did not adopt src layout yet | ||
include = ["cfripper*"] | ||
|
||
[tool.setuptools_scm] |
Oops, something went wrong.