-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
126 lines (112 loc) · 3.2 KB
/
pyproject.toml
File metadata and controls
126 lines (112 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "sfs-processor"
version = "1.0.0"
description = "Konvertera svensk författningssamling (SFS) från JSON till Markdown och andra format"
readme = "README.md"
requires-python = ">=3.10"
authors = [
{name = "Martin Rimskog", email = "martin@marca.se"},
]
dependencies = [
"requests>=2.25.0",
"pyyaml>=6.0",
"markdown>=3.4.0",
]
[project.optional-dependencies]
test = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"requests-mock>=1.11.0",
]
dev = [
"ruff>=0.1.0",
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"requests-mock>=1.11.0",
]
[project.scripts]
sfs-processor = "sfs_processor:main"
[tool.setuptools]
py-modules = ["sfs_processor"]
[tool.setuptools.packages.find]
where = ["."]
include = ["formatters*", "exporters*", "temporal*", "downloaders*", "util*", "scripts*"]
exclude = ["test*", "logs*", "data*", "reports*", "output*", "sfs_docs*"]
[tool.ruff]
line-length = 120
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]
[tool.ruff.lint.isort]
known-first-party = ["formatters", "exporters", "temporal", "util", "downloaders"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused imports in __init__ files
"test_*.py" = ["ARG"] # unused arguments in tests
[tool.pytest.ini_options]
# Test discovery
testpaths = ["test"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
# Output options
addopts = [
"-v", # Verbose output
"--tb=short", # Shorter traceback format
"--strict-markers", # Error on unknown markers
"--color=yes", # Colored output
"-ra", # Show summary of all test outcomes
"--cov=.", # Coverage for all modules
"--cov-report=term-missing", # Show missing lines in coverage
"--cov-report=html:htmlcov", # HTML coverage report
"--cov-branch", # Branch coverage
]
# Markers for test categorization
markers = [
"unit: Unit tests that don't require external resources",
"integration: Integration tests that test multiple components",
"api: Tests that interact with external APIs (mocked)",
"slow: Tests that take significant time to run",
]
# Coverage settings
[tool.coverage.run]
branch = true
source = ["."]
omit = [
"test/*",
"*/test_*",
"*/__pycache__/*",
"*/site-packages/*",
".venv/*",
"venv/*",
"sfs_docs/*",
"output/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@(abc\\.)?abstractmethod",
]