-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
132 lines (112 loc) · 3.84 KB
/
Copy pathpyproject.toml
File metadata and controls
132 lines (112 loc) · 3.84 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
127
128
129
130
131
132
[project]
name = "service-print-renderer"
version = "0.0.0" # NOTE: the version is not used
description = "The worker that consumes print jobs from SQS and updates DynamoDB"
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"boto3~=1.42",
"playwright~=1.54",
"python-dotenv~=1.2",
"pyyaml~=6.0",
"types-pyyaml~=6.0",
# OpenTelemetry packages
"opentelemetry-sdk~=1.43",
"opentelemetry-exporter-otlp~=1.43",
"opentelemetry-instrumentation-botocore==0.64b0",
]
[dependency-groups]
dev = [
"debugpy",
"ty",
"pytest",
"pytest-cov",
"pytest-xdist",
"ruff>=0.16",
"boto3-stubs[dynamodb,s3,sqs]~=1.42",
]
[tool.uv]
package = false # Do not install as a package
#===============================================================================
# ty configuration
[tool.ty.environment]
root = ["."]
[tool.ty.src]
exclude = ["app/tests"]
#===============================================================================
# Ruff configuration
[tool.ruff]
src = ["app"]
# Same as Black.
line-length = 100
indent-width = 4
# Assume Python 3.14
target-version = "py314"
#------------------------------------------------------------------------------
# Linting configuration
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN401", # Ignore Any typehint
"ANN002", # Ignore typehint for *args
"ANN003", # Ignore typehint for **kwargs
"D", # Ignore pydocstyle
"CPY", # Ignore flake8-copyright: internal service, not a distributed library
"EM", # Ignore flake8-errmsg
"TRY003", # Ignore long messages in exception constructors
"FBT001", # Ignore boolean-type-hint-positional-argument
"FBT002", # Ignore boolean-default-value-positional-argument
"PTH123", # Ignore builtin-open
"TD", # Ignore flake8-todos
"FIX", # Ignore fixme comments
"COM812", # flak8-commas missing-trailing-comma is ignored to avoid conflict with formatter which enforces trailing commas
# Don't force runtime imports used only in annotations into TYPE_CHECKING
# blocks. Plain top-level imports keep annotations readable; TYPE_CHECKING is
# reserved for imports that genuinely cannot run at runtime (e.g. dev-only
# boto3 stubs).
"TC001", # Ignore type annotation not in TYPE_CHECKING block for first party import
"TC002", # Ignore type annotation not in TYPE_CHECKING block for third party import
"TC003", # Ignore type annotation not in TYPE_CHECKING block for standard library import
]
# Allow fix for all enabled rules (when `--fix`) is provided.
unfixable = []
fixable = ["ALL"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
#------------------------------------------------------------------------------
# ruff ignore per files
[tool.ruff.lint.per-file-ignores]
"app/tests/**" = [
"S101", # Ignore usage of assert statements in tests
"ANN201", # Ignore missing return type hints in tests
"ANN001", # Ignore missing type hints in tests
"PLR2004", # Ignore magic number in tests
"SLF001", # Ignore private member access in tests
]
"app/*.py" = [
"INP001", # Ignore implicit namespace packages in root app files
]
#------------------------------------------------------------------------------
# Isort configuration
[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"third-party",
"test",
"first-party",
"local-folder",
]
[tool.ruff.lint.isort.sections]
test = ["pytest"]
#===============================================================================
# Pytest configuration
[tool.pytest]
pythonpath = ["app"]
python_files = ["test_*.py"]
#==============================================================================
# Coverage configuration
[tool.coverage.run]
omit = ["*/tests/*"]
[tool.coverage.report]
exclude_lines = ["if TYPE_CHECKING:"]