-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathpyproject.toml
More file actions
176 lines (162 loc) · 7.74 KB
/
pyproject.toml
File metadata and controls
176 lines (162 loc) · 7.74 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
[project]
name = "polymarket-apis"
version = "0.5.7"
description = "Unified Polymarket APIs with Pydantic data validation - Clob, Gamma, Data, Web3, Websockets, GraphQL clients."
readme = "README.md"
requires-python = ">=3.12"
authors = [
{ name = "Razvan Gheorghe", email = "razvan@gheorghe.me" }
]
# PEP 631-compliant dependencies table
dependencies = [
"python-dateutil>=2.9.0",
"pydantic>=2.10.5",
"poly-eip712-structs>=0.0.1",
"py-order-utils>=0.3.2",
"httpx[http2]>=0.25.1",
"web3>=7.0",
"lomond>=0.3.3",
"gql[httpx]>=4.0.0",
]
[dependency-groups]
lint = [
"ruff>=0.12.0"
]
dev = [
"ruff>=0.12.0",
"notebook>=7.3.2",
"python-dotenv>=1.0.1",
"plotly>=5.24.1",
"jupyter-contrib-nbextensions>=0.7.0",
"jupyter>=1.1.1",
"pyrefly>=0.39.4",
"mypy>=1.18.2",
"types-python-dateutil>=2.9.0.20251008",
"pdoc>=16.0.0",
"pytest>=8.4.1",
"pytest-asyncio>=1.1.0",
"pytest-mock>=3.14.1",
"respx>=0.22.0",
"pytest-xdist>=3.8.0",
"pre-commit>=4.5.1",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["src/polymarket_apis"]
[tool.uv]
managed = true
[tool.pyrefly]
python_version = "3.12"
[tool.mypy]
ignore_missing_imports = true
plugins = ["pydantic.mypy"]
[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests"]
addopts = "-ra --strict-markers --strict-config"
markers = [
"contract: deterministic mocked tests with no external network calls",
"prod_read: live read-only tests against production polymarket endpoints",
"auth_clob: authenticated clob tests that avoid state-changing operations",
"amoy_web3: tiny web3 state-changing tests on amoy only",
"amoy_gasless: optional gasless relay tests on amoy",
"websocket_live: live websocket smoke/invariant tests",
]
[tool.ruff]
lint.extend-select = [
"E", # Pycodestyle errors (style issues)
"W", # Pycodestyle warnings (style issues)
"C90", # McCabe – complexity metric for functions
"I", # isort – import ordering checks
"N", # PEP8 Naming – naming conventions
"D", # Pydocstyle – docstring formatting
"UP", # Pyupgrade – upgrades syntax to newer Python versions
"YTT", # Flake8-2020 – checks for Python 2020 best practices
# "ANN", # Flake8-annotations – enforces type annotation style
"ASYNC",# Flake8-async – checks async/await usage
"S", # Flake8-bandit – security issues
"BLE", # Flake8-blind-except – flags bare excepts
"FBT", # Flake8-boolean-trap – potential pitfalls with booleans
"B", # Flake8-bugbear – common bug patterns
"A", # Flake8-builtins – misuse of Python built-in names
# "COM", # Flake8-commas – trailing/comma issues
# "CPY", # Flake8-copyright – copyright header checks
"C4", # Flake8-comprehensions – best practices in comprehensions
"DTZ", # Flake8-datetimez – requires timezone-aware datetime objects
"T10", # Flake8-debugger – debugger statements (e.g. pdb)
"DJ", # Flake8-django – Django-specific conventions
"EM", # Flake8-errmsg – error message style
"EXE", # Flake8-executable – executable file checks
"FA", # Flake8-future-annotations – future import for annotations
"ISC", # Flake8-implicit-str-concat – warns on implicit string concatenation
"ICN", # Flake8-import-conventions – enforces conventional import aliases
"LOG", # Flake8-logging – proper logging usage
"G", # Flake8-logging-format – logging format string issues
"INP", # Flake8-no-pep420 – warns against non-PEP420 namespace usage
"PIE", # Flake8-pie – Python improvement suggestions
# "T20", # Flake8-print – disallows print statements
"PYI", # Flake8-pyi – checks for type stub (.pyi) consistency
"PT", # Flake8-pytest-style – pytest best practices
"Q", # Flake8-quotes – enforces quote style consistency
"RSE", # Flake8-raise – proper raise statement usage
"RET", # Flake8-return – return statement issues
"SLF", # Flake8-self – flags instance methods that don't use self
"SLOT", # Flake8-slots – suggests use of __slots__ where appropriate
"SIM", # Flake8-simplify – code simplification hints
"TC", # Flake8-type-checking – proper import of typing in type checks
"INT", # Flake8-gettext – checks for proper internationalization usage
"ARG", # Flake8-unused-arguments – flags unused function arguments
"PTH", # Flake8-use-pathlib – encourages pathlib over os.path
"FIX", # Flake8-fixme – flags FIXME comments
# "ERA", # Eradicate – detects commented-out code (potentially dangerous)
"PD", # Pandas-vet – checks pandas-specific code practices
"PGH", # Pygrep-hooks – custom grep hooks for linting
"PL", # Pylint – integration with Pylint conventions
"TRY", # Tryceratops – try/except usage suggestions
"FLY", # Flynt – f-string conversion suggestions
"NPY", # NumPy-specific rules – ensures NumPy coding standards
"FAST", # FastAPI – FastAPI-specific linting rules
"AIR", # Airflow – Airflow-specific linting rules
"PERF", # Perflint – performance-related checks
"FURB", # Refurb – rules for code refurbishment
# "DOC", # Pydoclint – docstring linting and consistency
"RUF", # Ruff-specific rules – additional Ruff checks
]
lint.ignore = [
"UP007", # non-pep604-annotation-union
"UP045", # non-pep604-annotation-optional
"TID", # Flake8-tidy-imports – enforces specific import styles (e.g., no relative imports)
"E501", # Pycodestyle - line too long
"D1", # Pydocstyle - missing docstring in public module, class, or function
"FBT001", # Flake8-boolean-trap - boolean-type-hint-positional-argument
"FBT002", # Flake8-boolean-trap - boolean-default-value-positional-argument
"FBT003", # Flake8-boolean-trap - boolean-positional-value-in-call
"D203", # Pydocstyle - one blank line required before class docstring
"D212", # Pydocstyle - summary line should be immediately after the opening quotes.
"D401", # Pydocstyle - Checks for docstring first lines that are not in an imperative mood.
"N805", # PEP8 Naming - invalid-first-argument-name-for-method
"S105", # Flake8-bandit - Checks for potential uses of hardcoded passwords in strings.
"S311", # Flake8-bandit - Standard pseudo-random generators are not suitable for security/cryptographic purposes
"S324", # Flake8-bandit - Use of weak or broken cryptographic hash functions in hashlib and crypt libraries
"PERF401", # Perflint - Checks for for loops that can be replaced by a list comprehension.
"RET504", # Flake8-return - Checks for variable assignments that immediately precede a return of the assigned variable.
"FA102", # Flake8-future-annotations - Missing `from __future__ import annotations`, but uses PEP 604 union
"TC001", # Flake8-type-checking - typing-only-first-party-import
"TC003", # Flake8-type-checking - typing-only-standard-library-import
"C901", # McCabe - complex-structure
"PLR0911", # Pylint - too-many-return-statments
"PLR0912", # Pylint - too-many-branches
"PLR0913", # Pylint - too-many-arguments
"PLR0915", # Pylint - too-many-statements
"PLR2004", # Pylint - magic-value-comparison
"A001", # Flake8-builtins - builtin-variable-shadowing
"A002", # Flake8-builtins - builtin-argument-shadowing
"FURB110", # refurb - if-exp-instead-of-or-operator
"PLC0415" # Pylint - import-outside-top-level
]
[project.urls]
repository = "https://github.com/qualiaenjoyer/polymarket-apis"