Update template

main
mat ess 2023-08-11 16:06:01 -04:00
parent c211bb11a2
commit b87b071d75
1 changed files with 112 additions and 17 deletions

View File

@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "roll" name = "roll"
description = "for initiative!" description = "for initiative!"
readme = "README.md" readme = "README.md"
requires-python = ">=3.8" requires-python = ">=3.11"
keywords = [] keywords = []
# license-files = { paths = ["LICENSE.txt"] } # license-files = { paths = ["LICENSE.txt"] }
authors = [ authors = [
@ -15,9 +15,6 @@ authors = [
classifiers = [ classifiers = [
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: PyPy",
@ -35,29 +32,127 @@ Source = "https://git.mat.services/mat/roll"
[project.scripts] [project.scripts]
roll = "roll.cli:roll" roll = "roll.cli:roll"
[tool.hatch.envs.default]
dependencies = [
"pytest",
"pytest-cov",
]
[tool.hatch.envs.default.scripts]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=roll --cov=tests {args}"
no-cov = "cov --no-cov {args}"
[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311"]
[tool.hatch.version] [tool.hatch.version]
path = "roll/__about__.py" path = "roll/__about__.py"
[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
[[tool.hatch.envs.all.matrix]]
python = ["3.11"]
[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"pyright>=1.1.319",
"ruff>=0.0.243",
"pytest", # for types in tests
]
[tool.hatch.envs.lint.scripts]
typing = "pyright --project pyproject.toml --dependencies {args:roll tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
all = [
"style",
"typing",
]
[tool.black]
target-version = ["py311"]
line-length = 120
skip-string-normalization = true
[tool.ruff]
target-version = "py311"
line-length = 120
select = [
"A",
"ARG",
"B",
"C",
"DTZ",
"E",
"EM",
"F",
"FBT",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
# Ignore insecure random checks
"S311",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
]
unfixable = [
# Don't touch unused imports
"F401",
]
[tool.ruff.isort]
known-first-party = ["roll"]
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
[tool.coverage.run] [tool.coverage.run]
source_pkgs = ["roll", "tests"]
branch = true branch = true
parallel = true parallel = true
omit = [ omit = [
"roll/__about__.py", "roll/__about__.py",
] ]
[tool.coverage.paths]
roll = ["roll", "*/roll/roll"]
tests = ["tests", "*/roll/tests"]
[tool.coverage.report] [tool.coverage.report]
exclude_lines = [ exclude_lines = [
"no cov", "no cov",