[project]
name = "polymarket-apis"
version = "0.4.0"
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",
    "wsaccel>=0.6.7",
    "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",
]

[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


[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
]


[project.urls]
repository = "https://github.com/qualiaenjoyer/polymarket-apis"
