diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..eaa8ddc --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,66 @@ +[project] +name = "system_tools" +version = "0.1.0" +description = "" +authors = [{ name = "Richie Cahill", email = "richie@tmmworkshop.com" }] +requires-python = "~=3.13.0" +readme = "README.md" +license = "MIT" +# these dependencies are a best effort and aren't guaranteed to work +dependencies = ["apprise", "apscheduler", "polars", "requests", "typer"] + +[dependency-groups] +dev = [ + "mypy", + "pyfakefs", + "pytest-cov", + "pytest-mock", + "pytest-xdist", + "pytest", + "ruff", + "types-requests", +] + +[tool.ruff] + +target-version = "py313" + +line-length = 120 + +lint.select = ["ALL"] +lint.ignore = [ + "G004", # (PERM) This is a performers nit + "COM812", # (TEMP) conflicts when used with the formatter + "ISC001", # (TEMP) conflicts when used with the formatter + "S603", # (PERM) This is known to cause a false positive +] + +[tool.ruff.lint.per-file-ignores] + +"tests/**" = [ + "S101", # (perm) pytest needs asserts +] + +[tool.ruff.lint.pydocstyle] +convention = "google" + +[tool.ruff.lint.flake8-builtins] +builtins-ignorelist = ["id"] + +[tool.ruff.lint.pylint] +max-args = 9 + +[tool.coverage.run] +source = ["system_tools"] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "if TYPE_CHECKING:", + "raise NotImplementedError", + "if __name__ == \"__main__\":", +] + +[tool.pytest.ini_options] +addopts = "-n auto -ra" +# --cov=system_tools --cov-report=term-missing --cov-report=xml --cov-report=html --cov-branch diff --git a/treefmt.toml b/treefmt.toml index 476bc72..8471893 100644 --- a/treefmt.toml +++ b/treefmt.toml @@ -12,3 +12,15 @@ command = "nixfmt" #options = [] # Glob pattern of files to include includes = ["*.nix"] + +[formatter.ruff-format] +command = "ruff" +options = ["format"] +includes = ["python/**/*.py"] +priority = 0 + +[formatter.ruff] +command = "ruff" +options = ["check", "--fix"] +includes = ["python/**/*.py"] +priority = 1