Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
109 lines (96 loc) · 2.69 KB
/
Copy pathpyproject.toml
File metadata and controls
109 lines (96 loc) · 2.69 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "example-py"
version = "0.0.1"
description = "A nice example project"
readme = "README.md"
requires-python = ">=3.11"
license = "MIT"
authors = [
{ name = "X Author Name", email = "x-pt@example.com" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.11",
]
dependencies = []
[dependency-groups]
dev = [
"pytest>=8.3.5",
"pytest-cov>=6.0.0",
"allure-pytest>=2.13.5",
"ruff>=0.9.9",
"mypy>=1.15.0",
"pre-commit>=4.1.0",
]
[project.urls]
Documentation = "https://github.com/x-pt/example-py#readme"
Issues = "https://github.com/x-pt/example-py/issues"
Source = "https://github.com/x-pt/example-py"
[tool.hatch.build.targets.wheel]
packages = ["src/example_py"]
[tool.pytest.ini_options]
minversion = "8.1"
addopts = [
"-ra",
"-q",
"--cov=example-py",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=lcov",
"--alluredir=allure-results",
]
consider_namespace_packages=true # Enable this to allow using the same filename in different test directories without needing __init__.py in each one
pythonpath = ["src", "."]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"integration: marks tests as integration tests (deselect with '-m \"not integration\"')",
]
[tool.coverage.run]
source_pkgs = ["example_py"]
branch = true
parallel = true
omit = [
"*/.venv/*",
"*/tests/*",
"*/site-packages/*",
]
[tool.coverage.paths]
example_py = ["src/example_py", "*/example-py/src/example_py"]
tests = ["tests", "*/example-py/tests"]
[tool.coverage.report]
exclude_lines = [
"if __name__ == .__main__.:",
"if self.debug:",
"if TYPE_CHECKING:",
"no cov",
"raise NotImplementedError",
"pass",
"pragma: no cover",
]
show_missing = true # Show missing lines in the report
precision = 2 # Number of decimal places to use when rounding
[tool.mypy]
# Enable strict mode for comprehensive type checking
strict = true
python_version = "3.11"
# Error reporting settings
pretty = true # Beautify output for better readability
show_error_codes = true # Display error codes for easier troubleshooting
show_error_context = true # Show context for errors to aid debugging
# Ignore missing type hints for third-party libraries
ignore_missing_imports = true
# Exclude specific paths or files from type checking
exclude = [
"tests/",
"setup.py",
]
# Relax type-checking rules for test files (e.g., allow functions without type annotations)
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false