-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
180 lines (167 loc) · 5.27 KB
/
pyproject.toml
File metadata and controls
180 lines (167 loc) · 5.27 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
[project]
name = "measure"
version = "0.5.1"
description = "A metrics library that allows the user to swap metrics provider (statsd, cloudwatch, etc.) and provides an abstraction for creating metrics."
readme = "README.md"
requires-python = ">=3.13"
license = { text = "MIT" }
authors = [
{ name = "Adam Hitchcock", email = "adam@northisup.com" },
]
keywords = ["metrics", "statsd", "cloudwatch", "measurement"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Monitoring",
]
dependencies = []
[project.optional-dependencies]
boto3 = ["boto3"]
all = ["boto3"]
[project.urls]
Homepage = "https://github.com/NorthIsUp/measure"
Repository = "https://github.com/NorthIsUp/measure"
Issues = "https://github.com/NorthIsUp/measure/issues"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["measure"]
[tool.hatch.build.targets.sdist]
include = [
"measure",
"tests",
"README.md",
"pyproject.toml",
]
[dependency-groups]
dev = [
"pytest",
"pytest-cov",
"mock",
"django",
"boto3",
"ruff",
"pyright",
]
[tool.ruff]
line-length = 140
preview = true
target-version = "py313"
extend-exclude = ["**/examples/**"]
# specific rules to enable
lint.extend-select = [
"A", # shadowing
"ANN", # annotations
"ASYNC", # async rules
"B", # bugbear common python bugs
"BLE", # blind except
"COM", # comma rules
"E", # errors
"F", # pyflakes
"FA", # future annotations
"FURB", # refurb rules
"I", # imports + isort
"ISC", # implicit string concatenation
"N", # pep8-naming
"PLR", # refactor rules
"RUF", # ruff rules
"TC", # type checking
"UP", # upgrades
"YTT", # modern syntax
]
# specific rules to exclude
lint.ignore = [
"A002", # Function argument {name} is shadowing a Python builtin
"A005", # Module {name} shadows a Python standard-library module
"ANN401", # any-type — explicit Any is sometimes correct
"BLE001", # Blind Exception
"COM812", # Trailing comma missing
"COM819", # prohibited-trailing-comma
"E501", # line too long
"E741", # Ambiguous variable name
"N806", # Variable in function should be lowercase
"N816", # mixedCase variable in global scope (used for fallback import aliases)
"N999", # Invalid module name
"PLR0911", # too many return statements for method
"PLR0912", # too many branches
"PLR0913", # too many arguments for method
"PLR0914", # too many local variables
"PLR0915", # too many statements
"PLR0916", # too many Boolean expressions
"PLR0917", # too many positional arguments for method
"PLR2004", # Magic value used in comparison
"PLR6301", # could be a function, class method, or static method
"RET504", # Unnecessary assignment to {name} before return statement
"RUF001", # Ambiguous unicode characters in strings
"RUF067", # __init__ module should only contain docstrings and re-exports
"TC006", # Type checking: Add quotes to type expression in typing.cast()
"TC007", # Type checking: Add quotes to type alias
"TRY002", # Create your own exception
"TRY401", # Redundant exception object in logging.exception
"UP009", # UTF-8 encoding declaration is unnecessary
]
# specific fixes to be more aggressive with
lint.extend-safe-fixes = [
"FA",
"FA102", # Add 'from __future__ import annotations' import
"TC",
"UP",
]
lint.future-annotations = true
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["ANN", "PLR", "S101", "N802", "COM818"]
[tool.pyproject-fmt]
column_width = 1 # always wrap lists
indent = 4
keep_full_version = false # remove unnecessary trailing ``.0``'s from version specifiers
[tool.pytest.ini_options]
addopts = [
"-vv",
"-ra",
]
filterwarnings = [
"error::pytest.PytestUnknownMarkWarning",
"ignore::DeprecationWarning",
"ignore::ResourceWarning",
]
log_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_level = "DEBUG"
testpaths = ["tests"]
[tool.pyright]
venv = ".venv"
venvPath = "."
exclude = [
"**/__pycache__",
"**/.venv",
"tests",
]
pythonVersion = "3.13"
reportConstantRedefinition = "error"
reportDeprecated = "warning"
reportDuplicateImport = "error"
reportImportCycles = "none"
reportIncompatibleMethodOverride = "error"
reportInconsistentConstructor = "warning"
reportInvalidTypeVarUse = "error"
reportMatchNotExhaustive = "warning"
reportMissingImports = "error"
reportMissingModuleSource = "warning"
reportMissingTypeStubs = false
reportPrivateImportUsage = "error"
reportSelfClsParameterName = "error"
reportUnnecessaryTypeIgnoreComment = "warning"
reportUntypedBaseClass = "error"
reportUntypedClassDecorator = "error"
reportUntypedFunctionDecorator = "warning"
reportUnusedImport = "error"
strictDictionaryInference = true
strictListInference = true
strictSetInference = true
typeCheckingMode = "basic"