-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathpyproject.toml
More file actions
150 lines (130 loc) · 4.08 KB
/
pyproject.toml
File metadata and controls
150 lines (130 loc) · 4.08 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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "mixpanel"
dynamic = ["version"]
description = "Official Mixpanel library for Python"
readme = "README.rst"
license = "Apache-2.0"
authors = [
{name = "Mixpanel, Inc.", email = "dev@mixpanel.com"},
]
requires-python = ">=3.9"
dependencies = [
"requests>=2.4.2, <3",
"httpx>=0.27.0",
"pydantic>=2.0.0",
"asgiref>=3.0.0",
"json-logic==0.7.0a0"
]
keywords = ["mixpanel", "analytics"]
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
[project.urls]
Homepage = "https://github.com/mixpanel/mixpanel-python"
[project.optional-dependencies]
test = [
"pytest>=8.4.1",
"pytest-asyncio>=0.23.0",
"responses>=0.25.8",
"respx>=0.21.0",
"pytest-cov"
]
dev = [
"tox>=4.28.4",
"build",
"twine",
"sphinx",
"ghp-import",
"pre-commit",
]
[tool.setuptools.dynamic]
version = {attr = "mixpanel.__version__"}
[tool.setuptools.packages.find]
exclude = ["demo", "docs"]
[tool.tox]
envlist = ["py39", "py310", "py311", "py312", "pypy39", "pypy311"]
[tool.tox.env_run_base]
extras = ["test"]
commands = [
["pytest", "{posargs}"],
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
# --- Ruff configuration (strict guide: select ALL, exclude explicitly) ---
[tool.ruff]
target-version = "py39"
line-length = 88
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# --- Rule conflicts ---
"D203", # conflicts with D211 (no-blank-line-before-class)
"D213", # conflicts with D212 (multi-line-summary-first-line)
"COM812", # conflicts with ruff formatter
"ISC001", # conflicts with ruff formatter
# --- Type annotations (separate effort for existing codebase) ---
"ANN", # all annotation rules — 150+ violations, separate PR
# --- Docstrings (separate effort) ---
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D105", # undocumented-magic-method
"D107", # undocumented-public-init
# --- Boolean arguments (public API, can't change) ---
"FBT", # boolean-type-hint / boolean-default / boolean-positional
# --- TODO/FIXME enforcement (not needed) ---
"TD002", # missing-todo-author
"TD003", # missing-todo-link
"FIX001", # line-contains-fixme
"FIX002", # line-contains-todo
# --- Exception message style (too invasive) ---
"EM101", # raw-string-in-exception
"EM103", # dot-format-in-exception
"TRY003", # raise-vanilla-args
# --- Other pragmatic exclusions ---
"PLR0913", # too-many-arguments (public API signatures)
"E501", # line-too-long (formatter handles code; remaining are strings/comments)
"FA100", # future-rewritable-type-annotation (interacts with Pydantic runtime, defer)
]
[tool.ruff.lint.per-file-ignores]
"test_mixpanel.py" = [
"S101", # assert
"S105", # hardcoded-password-string (test fixtures)
"S106", # hardcoded-password-func-arg
"SLF001", # private-member-access
"PLR2004", # magic-value-comparison
"D", # all docstring rules
"PT018", # pytest-composite-assertion
]
"mixpanel/flags/test_*.py" = [
"S101", "S105", "S106", "SLF001", "PLR2004",
"D", "PT018", "B006",
]
"demo/*.py" = [
"INP001", # implicit-namespace-package
"T201", # print
"S105", # hardcoded tokens
"S311", # suspicious-non-cryptographic-random-usage
"D", # docstrings
]
"mixpanel/flags/types.py" = [
"A005", # shadows stdlib `types` module (renaming would break imports)
]
"docs/conf.py" = [
"INP001", "A001", "ERA001", "D",
]
[tool.ruff.lint.isort]
known-first-party = ["mixpanel"]
[tool.ruff.lint.pydocstyle]
convention = "google"