Bump black 26.3.1→26.5.1 and ruff 0.6.0→0.15.20 in pyproject.toml. Unpin black (== → >=) to match ruff convention. Sync .pre-commit-config.yaml revs to match. Drop default_language_version — hooks work on any Python ≥3.10. Document dual-config pattern in AGENTS.md to prevent future drift.
266 lines
8.0 KiB
TOML
266 lines
8.0 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=61.0", "setuptools-scm>=8.0", "wheel"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "pandas-ta-classic"
|
|
dynamic = ["version"] # Version is dynamically determined from git tags
|
|
description = "Technical Analysis Indicators - Pandas TA Classic is an easy to use Python 3 Pandas Extension with a comprehensive collection of indicators and TA-Lib patterns."
|
|
readme = "README.md"
|
|
license = {text = "MIT"}
|
|
authors = [
|
|
{name = "xgboosted"}
|
|
]
|
|
maintainers = [
|
|
{name = "xgboosted"}
|
|
]
|
|
keywords = ["technical analysis", "trading", "python3", "pandas"]
|
|
classifiers = [
|
|
"Development Status :: 5 - Production/Stable",
|
|
"Operating System :: OS Independent",
|
|
"Natural Language :: English",
|
|
"Intended Audience :: Developers",
|
|
"Intended Audience :: Financial and Insurance Industry",
|
|
"Intended Audience :: Science/Research",
|
|
"Topic :: Office/Business :: Financial",
|
|
"Topic :: Office/Business :: Financial :: Investment",
|
|
"Topic :: Scientific/Engineering",
|
|
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
# Python version classifiers below are PLACEHOLDERS
|
|
# Replaced dynamically by CI/CD during release based on generate-matrix job
|
|
# Format: LATEST_PYTHON_VERSION and 4 preceding minor versions
|
|
"Programming Language :: Python :: {{LATEST-4}}",
|
|
"Programming Language :: Python :: {{LATEST-3}}",
|
|
"Programming Language :: Python :: {{LATEST-2}}",
|
|
"Programming Language :: Python :: {{LATEST-1}}",
|
|
"Programming Language :: Python :: {{LATEST}}",
|
|
]
|
|
requires-python = ">=3.9" # Minimum Python version - dynamically updated by CI/CD during release
|
|
dependencies = [
|
|
"numpy>=2.0.0",
|
|
"pandas>=2.0.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
# Core optional runtime dependencies
|
|
optional = [
|
|
"scipy",
|
|
"scikit-learn",
|
|
"statsmodels",
|
|
"stochastic",
|
|
"tqdm",
|
|
]
|
|
|
|
# External oracle libraries for parity tests
|
|
oracle = [
|
|
"ta-lib",
|
|
"tulipy",
|
|
]
|
|
|
|
# CI code quality tools
|
|
lint = [
|
|
"ruff>=0.15.20",
|
|
"black>=26.5.1",
|
|
]
|
|
|
|
# PyPI publishing tools
|
|
publish = [
|
|
"build>=0.10.0",
|
|
"twine>=4.0.0",
|
|
"setuptools-scm>=7.0.0",
|
|
]
|
|
|
|
# Development tools (code quality, linting, building)
|
|
dev = [
|
|
# Include testing dependencies
|
|
"pandas-ta-classic[test]",
|
|
|
|
# Include documentation dependencies
|
|
"pandas-ta-classic[docs]",
|
|
|
|
# Include lint and publish tools
|
|
"pandas-ta-classic[lint]",
|
|
"pandas-ta-classic[publish]",
|
|
|
|
# Type checking and linting
|
|
"mypy>=1.0.0",
|
|
"isort>=5.0.0",
|
|
|
|
# Pre-commit hooks
|
|
"pre-commit>=3.0.0",
|
|
]
|
|
|
|
# Testing framework
|
|
test = [
|
|
"pytest>=7.0.0",
|
|
"pytest-cov>=4.0.0",
|
|
"pytest-benchmark>=4.0.0",
|
|
"hypothesis>=6.0.0"
|
|
]
|
|
|
|
# Documentation building
|
|
docs = [
|
|
"sphinx>=5.0.0",
|
|
"sphinx-rtd-theme>=1.0.0",
|
|
"myst-parser>=2.0.0",
|
|
"matplotlib",
|
|
"mplfinance"
|
|
]
|
|
|
|
# Performance optimization
|
|
performance = [
|
|
"numba>=0.58.0",
|
|
"cython>=3.0.0"
|
|
]
|
|
|
|
# Data sources and external integrations
|
|
integration = [
|
|
"backtesting",
|
|
"vectorbt",
|
|
"backtrader",
|
|
"yfinance",
|
|
"alpha-vantage"
|
|
]
|
|
|
|
# Complete environment with all features
|
|
all = [
|
|
"pandas-ta-classic[optional,oracle,dev,test,docs,performance,integration]"
|
|
]
|
|
|
|
[project.urls]
|
|
Homepage = "https://github.com/xgboosted/pandas-ta-classic"
|
|
Repository = "https://github.com/xgboosted/pandas-ta-classic.git"
|
|
Documentation = "https://xgboosted.github.io/pandas-ta-classic/"
|
|
"Bug Tracker" = "https://github.com/xgboosted/pandas-ta-classic/issues"
|
|
|
|
[tool.pytest.ini_options]
|
|
markers = [
|
|
"regression: snapshot regression tests — run with -m regression",
|
|
]
|
|
filterwarnings = [
|
|
"error::UserWarning:pandas_ta_classic",
|
|
]
|
|
|
|
[tool.black]
|
|
line-length = 150
|
|
skip-string-normalization = true
|
|
exclude = '''
|
|
/(
|
|
\.venv
|
|
| \.git
|
|
| __pycache__
|
|
| \.eggs
|
|
| .*\.egg-info
|
|
)/
|
|
'''
|
|
|
|
[tool.ruff]
|
|
exclude = [
|
|
".venv",
|
|
".git",
|
|
"__pycache__",
|
|
".eggs",
|
|
"*.egg-info",
|
|
]
|
|
line-length = 150
|
|
|
|
[tool.setuptools]
|
|
packages = [
|
|
"pandas_ta_classic",
|
|
"pandas_ta_classic.candles",
|
|
"pandas_ta_classic.cycles",
|
|
"pandas_ta_classic.momentum",
|
|
"pandas_ta_classic.overlap",
|
|
"pandas_ta_classic.performance",
|
|
"pandas_ta_classic.statistics",
|
|
"pandas_ta_classic.trend",
|
|
"pandas_ta_classic.utils",
|
|
"pandas_ta_classic.utils.data",
|
|
"pandas_ta_classic.volatility",
|
|
"pandas_ta_classic.volume"
|
|
]
|
|
|
|
[tool.setuptools_scm]
|
|
# Automatically determine version from git tags
|
|
# Tagged releases: X.Y.Z (e.g., 0.3.34)
|
|
# Commits after tag: X.Y.(Z+1).devN (e.g., 0.3.35.dev1, 0.3.35.dev2)
|
|
# This avoids .post0 on tagged commits while still tracking development versions
|
|
write_to = "pandas_ta_classic/_version.py"
|
|
# Default scheme: gives clean version on tags, next minor .devN after tags
|
|
local_scheme = "no-local-version" # Omit local version for clean releases
|
|
fallback_version = "0.0.0" # Fallback if not in a git repository
|
|
|
|
[tool.mypy]
|
|
packages = ["pandas_ta_classic"]
|
|
python_version = "3.9"
|
|
warn_return_any = false
|
|
warn_unused_configs = true
|
|
ignore_missing_imports = true
|
|
disallow_untyped_defs = false
|
|
check_untyped_defs = true
|
|
no_implicit_optional = true
|
|
strict_optional = true
|
|
# Suppress false positives from pandas/numpy partial stubs.
|
|
# - union-attr, operator, index: pandas methods like .diff()/.shift() are typed
|
|
# as returning Optional[Any] in pandas' built-in stubs (no py.typed marker),
|
|
# causing chained-operation errors that are not real bugs in our code.
|
|
# - attr-defined: under numpy 2.0 + Python 3.9, numpy stubs type some results
|
|
# as ndarray[...] instead of Optional[Any], causing false positives for pandas
|
|
# Series methods (.shift(), .name, etc.) on the same patterns.
|
|
# - no-redef: each category __init__.py re-exports functions by name
|
|
# (e.g. `from .roc import roc`), which shadows the submodule of the same
|
|
# name. mypy sees this as a redefinition, but it works correctly at runtime.
|
|
disable_error_code = ["union-attr", "operator", "no-redef", "index", "attr-defined"]
|
|
|
|
# Per-module overrides for pre-existing code issues that require logic changes
|
|
# (not annotation-only) to fix properly.
|
|
[[tool.mypy.overrides]]
|
|
module = "pandas_ta_classic.core"
|
|
# assignment: wildcard imports (from .performance import *) shadow module names
|
|
# with function names — same __init__.py re-export pattern as no-redef.
|
|
# arg-type: Strategy(ta=None) — None is intentional sentinel for "all indicators".
|
|
# return-value: version property returns importlib version string, typed as
|
|
# Callable by mypy due to _meta.py import pattern.
|
|
disable_error_code = ["assignment", "arg-type", "return-value"]
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "pandas_ta_classic._meta"
|
|
# _meta.py re-assigns `version` from importlib.metadata.version (Callable)
|
|
# to a str — pre-existing structural pattern.
|
|
disable_error_code = ["assignment"]
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = [
|
|
"pandas_ta_classic.trend.increasing",
|
|
"pandas_ta_classic.trend.decreasing",
|
|
"pandas_ta_classic.candles.cdl_doji",
|
|
]
|
|
# float(Optional[float]) false positive: is_percent()/is_volatility() guards
|
|
# against None at runtime, but mypy can't narrow the type without TypeGuard
|
|
# (available only in typing_extensions for Python <3.10).
|
|
disable_error_code = ["arg-type"]
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "pandas_ta_classic.trend.xsignals"
|
|
# **dict[str, Optional[int]] unpacking into tsignals() positional args —
|
|
# pre-existing call pattern that mypy cannot verify via **kwargs unpacking.
|
|
disable_error_code = ["arg-type"]
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = [
|
|
"pandas_ta_classic.volatility.bbands",
|
|
"pandas_ta_classic.volatility.atr",
|
|
"pandas_ta_classic.trend.aroon",
|
|
"pandas_ta_classic.overlap.trima",
|
|
"pandas_ta_classic.overlap.t3",
|
|
"pandas_ta_classic.overlap.dema",
|
|
"pandas_ta_classic.momentum.macd",
|
|
"pandas_ta_classic.momentum.dm",
|
|
]
|
|
# Under numpy 2.0 + Python 3.9, numpy stubs type arithmetic results as
|
|
# ndarray[Any, dtype[floating[_64Bit]]] precisely, causing false-positive
|
|
# assignment errors when the variable is later reassigned with Optional[Any]
|
|
# or Union types from pandas operations. Not reproducible under Python 3.13.
|
|
disable_error_code = ["assignment"]
|