diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e38a52..44eb3c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,29 +5,29 @@ ci: autoupdate_commit_msg: 'ci: `pre-commit.ci` auto update' repos: - repo: https://github.com/PyCQA/autoflake - rev: v2.2.0 + rev: v2.3.3 hooks: - id: autoflake args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] exclude: ^{{cookiecutter.project_name}} - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 8.0.1 hooks: - id: isort exclude: ^{{cookiecutter.project_name}} - - repo: https://github.com/psf/black - rev: 23.7.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.3.1 hooks: - id: black language_version: python3 exclude: ^{{cookiecutter.project_name}} - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.4.2 hooks: - id: codespell files: \.(py|md)$ - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -41,7 +41,7 @@ repos: - id: check-json - id: check-toml - repo: https://github.com/commitizen-tools/commitizen - rev: 3.5.4 + rev: v4.13.9 hooks: - id: commitizen stages: [commit-msg] @@ -52,39 +52,39 @@ repos: stages: [commit-msg] args: [--ignore=B6, --msg-filename] - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: 2.7.2 + rev: 3.6.1 hooks: - id: editorconfig-checker - repo: https://github.com/hadolint/hadolint - rev: v2.12.1-beta + rev: v2.14.0 hooks: - id: hadolint-docker args: ['--ignore', 'DL3006'] - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.23.3 + rev: 0.37.0 hooks: - id: check-github-workflows - id: check-renovate - repo: https://github.com/PyCQA/docformatter - rev: v1.7.5 + rev: v1.7.7 hooks: - id: docformatter additional_dependencies: [tomli] exclude: tests args: [--config, pyproject.toml] - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.9.4 hooks: - id: bandit additional_dependencies: ["bandit[toml]"] args: ["-c", "pyproject.toml"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: 0.13.0 + rev: v2.20.0 hooks: - id: pyproject-fmt args: [--indent, '2'] - repo: https://github.com/python-poetry/poetry - rev: 1.5.0 + rev: 2.3.2 hooks: - id: poetry-check - id: poetry-lock diff --git a/cookiecutter.json b/cookiecutter.json index ec4fa26..10aa2f2 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -7,4 +7,4 @@ "github_user": "Group4Life", "github_repository": "https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.project_name }}", "version": "0.0.0" -} \ No newline at end of file +} diff --git a/pyproject.toml b/pyproject.toml index a3cd6f5..aacccae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,62 +9,69 @@ name = "cookie" version = "1.0.4" description = "🐍🍪 A Python Cookiecutter tailored towards Group4Life projects" readme = "README.md" -authors = ["billsioros "] +authors = [ "billsioros " ] license = "MIT" homepage = "https://Group4Life.github.io/cookie" repository = "https://github.com/Group4Life/cookie" keywords = [] classifiers = [ - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", ] - -[tool.poetry.urls] -"Bug Tracker" = "https://github.com/Group4Life/cookie/issues" -"Changelog" = "https://github.com/Group4Life/cookie/releases" - -[tool.poetry.dependencies] -python = "^3.9" - -[tool.poetry.group.dev.dependencies] -python-semantic-release = "*" -isort = "*" -pre-commit = "*" -poethepoet = "*" -pytest = "*" -pytest-sugar = "*" -pytest-clarity = "*" -mkdocs = "*" -mkdocs-material = "*" -mkdocs-minify-plugin = "*" -mkdocs-redirects = "*" -mdx-truly-sane-lists = "*" -mike = "*" -pytest-cookies = "*" -black = "*" +dependencies.python = "^3.9" +group.dev.dependencies.python-semantic-release = "*" +group.dev.dependencies.isort = "*" +group.dev.dependencies.pre-commit = "*" +group.dev.dependencies.poethepoet = "*" +group.dev.dependencies.pytest = "*" +group.dev.dependencies.pytest-sugar = "*" +group.dev.dependencies.pytest-clarity = "*" +group.dev.dependencies.mkdocs = "*" +group.dev.dependencies.mkdocs-material = "*" +group.dev.dependencies.mkdocs-minify-plugin = "*" +group.dev.dependencies.mkdocs-redirects = "*" +group.dev.dependencies.mdx-truly-sane-lists = "*" +group.dev.dependencies.mike = "*" +group.dev.dependencies.pytest-cookies = "*" +group.dev.dependencies.black = "*" +urls."Bug Tracker" = "https://github.com/Group4Life/cookie/issues" +urls.Changelog = "https://github.com/Group4Life/cookie/releases" [tool.black] line-length = 99 -target-version = ["py37", "py38"] +target-version = [ "py37", "py38" ] skip-string-normalization = true exclude = "{{cookiecutter.project_name}}" [tool.isort] profile = "black" -src_paths = ["cookie", "hooks", "tests"] +src_paths = [ "cookie", "hooks", "tests" ] line_length = 99 -[tool.pytest.ini_options] -addopts = "-vv --color=yes" -log_cli = false -log_cli_date_format = "%Y-%m-%d %H:%M:%S" -log_cli_format = "%(asctime)s %(levelname)s %(message)s" -log_cli_level = "INFO" -python_files = "test_*.py" -python_functions = "test_*" -testpaths = "tests" +[tool.docformatter] +black = true +non-strict = true +non-cap = [ + "cookie", +] +recursive = true +in-place = true + +[tool.bandit] +recursive = true +exclude_dirs = [ "tests" ] + +[tool.pytest] +ini_options.addopts = "-vv --color=yes" +ini_options.log_cli = false +ini_options.log_cli_date_format = "%Y-%m-%d %H:%M:%S" +ini_options.log_cli_format = "%(asctime)s %(levelname)s %(message)s" +ini_options.log_cli_level = "INFO" +ini_options.python_files = "test_*.py" +ini_options.python_functions = "test_*" +ini_options.testpaths = "tests" [tool.semantic_release] upload_to_pypi = false @@ -72,44 +79,23 @@ version_toml = "pyproject.toml:tool.poetry.version" changelog_components = "semantic_release.changelog.changelog_headers,semantic_release.changelog.compare_url" build_command = false -[tool.poe.tasks] +[tool.poe] +tasks.clean.cmd = "rm -rf ./**/__pycache__ dist site .pytest_cache" +tasks.clean.help = "Clean up any auxiliary files" - [tool.poe.tasks.clean] - cmd = "rm -rf ./**/__pycache__ dist site .pytest_cache" - help = "Clean up any auxiliary files" +tasks.docs.shell = "python -c 'import webbrowser; webbrowser.open(\"http://127.0.0.1:8000\")'; poetry run mkdocs serve" +tasks.docs.help = "Build and serve the documentation" - [tool.poe.tasks.format] - shell = "poetry run isort .; poetry run black ." - help = "Format your codebase" +tasks.export.cmd = "poetry export --without-hashes --dev -o requirements.txt" - [tool.poe.tasks.hooks] - cmd = "poetry run pre-commit run --all-files" - help = "Run all pre-commit hooks" +tasks.format.shell = "poetry run isort .; poetry run black ." +tasks.format.help = "Format your codebase" - [tool.poe.tasks.test] - cmd = "poetry run pytest --cov=cookie" - help = "Run the test suite" +tasks.hooks.cmd = "poetry run pre-commit run --all-files" +tasks.hooks.help = "Run all pre-commit hooks" - [tool.poe.tasks.lint] - cmd = "poetry run ruff check src" - help = "Lint your code for errors" +tasks.lint.cmd = "poetry run ruff check src" +tasks.lint.help = "Lint your code for errors" - [tool.poe.tasks.docs] - shell = "python -c 'import webbrowser; webbrowser.open(\"http://127.0.0.1:8000\")'; poetry run mkdocs serve" - help = "Build and serve the documentation" - - [tool.poe.tasks.export] - cmd = "poetry export --without-hashes --dev -o requirements.txt" - -[tool.docformatter] -black = true -non-strict = true -non-cap = [ - "cookie", -] -recursive = true -in-place = true - -[tool.bandit] -recursive = true -exclude_dirs = ["tests"] +tasks.test.cmd = "poetry run pytest --cov=cookie" +tasks.test.help = "Run the test suite" diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 7e438f8..8c46193 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -9,127 +9,189 @@ name = "{{cookiecutter.project_name}}" version = "{{cookiecutter.version}}" description = "{{cookiecutter.project_description}}" readme = "README.md" -authors = ["{{cookiecutter.author}} <{{cookiecutter.email}}>"] +authors = [ "{{cookiecutter.author}} <{{cookiecutter.email}}>" ] homepage = "https://{{cookiecutter.github_user}}.github.io/{{cookiecutter.project_name}}" repository = "{{ cookiecutter.github_repository }}" keywords = [] classifiers = [ - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", ] - -[tool.poetry.urls] -"Bug Tracker" = "{{ cookiecutter.github_repository }}/issues" -"Changelog" = "{{ cookiecutter.github_repository }}/releases" - -[tool.poetry.dependencies] -python = ">=3.7,<4.0" - -[tool.poetry.group.dev.dependencies] -python-semantic-release = "*" -isort = "*" -mypy = "*" -black = "*" -pre-commit = "*" -poethepoet = "*" -coverage = {extras = ["toml"], version = "*" } -pytest = "*" -pytest-cov = "*" -pytest-sugar = "*" -pytest-clarity = "*" -mkdocs = "*" -mkdocs-material = "*" -mkdocs-minify-plugin = "*" -mkdocs-redirects = "*" -mkdocstrings = { extras = ["python"], version = "*" } -mdx-truly-sane-lists = "*" -ruff = "*" +dependencies.python = ">=3.7,<4.0" +group.dev.dependencies.python-semantic-release = "*" +group.dev.dependencies.isort = "*" +group.dev.dependencies.mypy = "*" +group.dev.dependencies.black = "*" +group.dev.dependencies.pre-commit = "*" +group.dev.dependencies.poethepoet = "*" +group.dev.dependencies.coverage = { extras = [ "toml" ], version = "*" } +group.dev.dependencies.pytest = "*" +group.dev.dependencies.pytest-cov = "*" +group.dev.dependencies.pytest-sugar = "*" +group.dev.dependencies.pytest-clarity = "*" +group.dev.dependencies.mkdocs = "*" +group.dev.dependencies.mkdocs-material = "*" +group.dev.dependencies.mkdocs-minify-plugin = "*" +group.dev.dependencies.mkdocs-redirects = "*" +group.dev.dependencies.mkdocstrings = { extras = [ "python" ], version = "*" } +group.dev.dependencies.mdx-truly-sane-lists = "*" +group.dev.dependencies.ruff = "*" +urls."Bug Tracker" = "{{ cookiecutter.github_repository }}/issues" +urls.Changelog = "{{ cookiecutter.github_repository }}/releases" [tool.black] line-length = 99 -target-version = ["py37", "py38"] +target-version = [ "py37", "py38" ] skip-string-normalization = true [tool.ruff] -select = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"] -ignore = [] - -fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"] -unfixable = [] - +target-version = "py310" +line-length = 99 exclude = [ - ".bzr", - ".direnv", - ".eggs", - ".git", - ".git-rewrite", - ".hg", - ".mypy_cache", - ".nox", - ".pants.d", - ".pytype", - ".ruff_cache", - ".svn", - ".tox", - ".venv", - "__pypackages__", - "_build", - "buck-out", - "build", - "dist", - "node_modules", - "venv", + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", ] -per-file-ignores = {} - -line-length = 99 - dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" - -target-version = "py310" - -[tool.ruff.mccabe] -max-complexity = 10 - -[tool.ruff.pydocstyle] -convention = "google" - -[tool.ruff.flake8-quotes] -docstring-quotes = "double" +fixable = [ + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "I", + "N", + "Q", + "S", + "T", + "W", + "ANN", + "ARG", + "BLE", + "COM", + "DJ", + "DTZ", + "EM", + "ERA", + "EXE", + "FBT", + "ICN", + "INP", + "ISC", + "NPY", + "PD", + "PGH", + "PIE", + "PL", + "PT", + "PTH", + "PYI", + "RET", + "RSE", + "RUF", + "SIM", + "SLF", + "TCH", + "TID", + "TRY", + "UP", + "YTT", +] +flake8-quotes.docstring-quotes = "double" +ignore = [] +mccabe.max-complexity = 10 +per-file-ignores = {} +pydocstyle.convention = "google" +select = [ + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "I", + "N", + "Q", + "S", + "T", + "W", + "ANN", + "ARG", + "BLE", + "COM", + "DJ", + "DTZ", + "EM", + "ERA", + "EXE", + "FBT", + "ICN", + "INP", + "ISC", + "NPY", + "PD", + "PGH", + "PIE", + "PL", + "PT", + "PTH", + "PYI", + "RET", + "RSE", + "RUF", + "SIM", + "SLF", + "TCH", + "TID", + "TRY", + "UP", + "YTT", +] +unfixable = [] [tool.isort] profile = "black" -src_paths = ["src/{{cookiecutter.package_name}}", "tests"] +src_paths = [ "src/{{cookiecutter.package_name}}", "tests" ] line_length = 99 known_first_party = "{{cookiecutter.package_name}}" -[tool.pytest.ini_options] -addopts = "-vv --color=yes" -log_cli = false -log_cli_date_format = "%Y-%m-%d %H:%M:%S" -log_cli_format = "%(asctime)s %(levelname)s %(message)s" -log_cli_level = "INFO" -python_files = "test_*.py" -python_functions = "test_*" -testpaths = "tests" - -[tool.coverage.paths] -source = ["src"] - -[tool.coverage.run] -branch = true -source = ["{{cookiecutter.package_name}}"] +[tool.docformatter] +black = true +non-strict = true +non-cap = [ + "{{cookiecutter.package_name}}", +] +recursive = true +in-place = true -[tool.coverage.report] -show_missing = true -fail_under = 100 -exclude_lines = ["if self.debug:", "pragma: no cover", "raise NotImplementedError", "if __name__ == .__main__.:"] -ignore_errors = true -omit = ["tests/*"] +[tool.bandit] +recursive = true +exclude_dirs = [ "tests" ] [tool.mypy] -files = ["src/{{cookiecutter.package_name}}"] +files = [ "src/{{cookiecutter.package_name}}" ] warn_unused_configs = true warn_return_any = true ignore_missing_imports = true @@ -140,6 +202,31 @@ show_error_codes = true show_error_context = true strict = true +[tool.pytest] +ini_options.addopts = "-vv --color=yes" +ini_options.log_cli = false +ini_options.log_cli_date_format = "%Y-%m-%d %H:%M:%S" +ini_options.log_cli_format = "%(asctime)s %(levelname)s %(message)s" +ini_options.log_cli_level = "INFO" +ini_options.python_files = "test_*.py" +ini_options.python_functions = "test_*" +ini_options.testpaths = "tests" + +[tool.coverage] +run.branch = true +run.source = [ "{{cookiecutter.package_name}}" ] +paths.source = [ "src" ] +report.exclude_lines = [ + "if __name__ == .__main__.:", + "if self.debug:", + "pragma: no cover", + "raise NotImplementedError" +] +report.fail_under = 100 +report.ignore_errors = true +report.omit = [ "tests/*" ] +report.show_missing = true + [tool.semantic_release] version_toml = "pyproject.toml:tool.poetry.version" changelog_components = "semantic_release.changelog.changelog_headers,semantic_release.changelog.compare_url" @@ -148,27 +235,14 @@ upload_to_pypi = false [tool.vulture] min_confidence = 95 -paths = ["src/{{cookiecutter.package_name}}", "tests"] - -[tool.poe.tasks] -clean = { cmd = "rm -rf ./**/__pycache__ dist site .pytest_cache .mypy_cache .coverage", help = "Clean up any auxiliary files" } -format = { shell = "poetry run isort .; poetry run black .", help = "Format your codebase" } -hooks = { cmd = "poetry run pre-commit run --all-files", help = "Run all pre-commit hooks" } -test = { cmd = "poetry run pytest --cov={{cookiecutter.package_name}}", help = "Run the test suite and produce a coverage report" } -type-check = { cmd = "poetry run mypy", help = "Run static type checking on your codebase" } -lint = { cmd = "poetry run ruff check src", help = "Lint your code for errors" } -docs = { shell = "python -c 'import webbrowser; webbrowser.open(\"http://127.0.0.1:8000\")'; poetry run mkdocs serve", help = "Build and serve the documentation" } -export = { cmd = "poetry export --without-hashes --dev -o requirements.txt" } - -[tool.docformatter] -black = true -non-strict = true -non-cap = [ - "{{cookiecutter.package_name}}", -] -recursive = true -in-place = true - -[tool.bandit] -recursive = true -exclude_dirs = ["tests"] +paths = [ "src/{{cookiecutter.package_name}}", "tests" ] + +[tool.poe] +tasks.clean = { cmd = "rm -rf ./**/__pycache__ dist site .pytest_cache .mypy_cache .coverage", help = "Clean up any auxiliary files" } +tasks.format = { shell = "poetry run isort .; poetry run black .", help = "Format your codebase" } +tasks.hooks = { cmd = "poetry run pre-commit run --all-files", help = "Run all pre-commit hooks" } +tasks.test = { cmd = "poetry run pytest --cov={{cookiecutter.package_name}}", help = "Run the test suite and produce a coverage report" } +tasks.type-check = { cmd = "poetry run mypy", help = "Run static type checking on your codebase" } +tasks.lint = { cmd = "poetry run ruff check src", help = "Lint your code for errors" } +tasks.docs = { shell = "python -c 'import webbrowser; webbrowser.open(\"http://127.0.0.1:8000\")'; poetry run mkdocs serve", help = "Build and serve the documentation" } +tasks.export = { cmd = "poetry export --without-hashes --dev -o requirements.txt" }