-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
133 lines (122 loc) · 4.36 KB
/
Copy pathpyproject.toml
File metadata and controls
133 lines (122 loc) · 4.36 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
[build-system]
requires = ["setuptools>=68.0"]
build-backend = "setuptools.build_meta"
[project]
name = "quant_platform"
version = "0.1.0"
description = "A-Share Multi-Factor Quantitative Trading Platform"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.10"
authors = [
{ name = "Quant Platform Contributors" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Financial and Insurance Industry",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business :: Financial :: Investment",
]
[project.scripts]
quant = "main:main"
[tool.setuptools.packages.find]
# The repo root IS the quant_platform package; subpackages (core, data, ...)
# are discovered directly. Using include=["*"] because find_packages returns
# subpackage names (core, data) without the "quant_platform." prefix, so
# "quant_platform*" would match nothing.
include = ["*"]
# ---------------------------------------------------------------------------
# ruff — fast Python linter (replaces flake8 + isort + autoflake)
# ---------------------------------------------------------------------------
[tool.ruff]
target-version = "py311"
line-length = 120
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "UP", "B", "SIM", "T20"]
ignore = [
"E501", # line-too-long — handled by formatter
"E402", # module-import-not-at-top-of-file — needed for sys.path setup
"E731", # lambda-assignment — sometimes clearer
"T201", # print statements — OK for CLI scripts
"N806", # non-lowercase variable — ML code uses X/y conventionally
"N803", # non-lowercase argument — ML code conventions
"B007", # unused loop variable — common when using enumerate for index
"SIM108", # ternary preference — if/else is clearer in many cases
"SIM102", # nested if — readability preference
"SIM105", # suppress context manager — try/except pass is explicit
"SIM117", # nested with — readability preference
"E701", # multiple statements on one line
"N805", # first-argument-name — valid for some patterns
"E741", # ambiguous variable name — `l` is readable in context
"F401", # unused import — some needed for re-exports / side effects
"F811", # redefined variable — common in test parametrization
"SIM113", # enumerate with start=0 — redundant but harmless
"SIM115", # open with context handler — fine for simple cases
"B005", # strip with set — acceptable
"B017", # assertRaises Exception — not always a concern
"UP042", # StrEnum — Python 3.10 compat
]
[tool.ruff.format]
quote-style = "single"
# ---------------------------------------------------------------------------
# mypy — static type checking
# ---------------------------------------------------------------------------
[tool.mypy]
python_version = "3.10"
ignore_missing_imports = true
strict = false
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_unimported = false
disallow_untyped_defs = false
no_implicit_optional = true
check_untyped_defs = false
[[tool.mypy.overrides]]
module = [
"quant_platform.utils.cyext.*",
"tushare",
"baostock",
"akshare",
"cvxpy",
"shap",
"numba",
]
ignore_missing_imports = true
# ---------------------------------------------------------------------------
# pytest
# ---------------------------------------------------------------------------
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"asyncio: marks tests as async",
]
asyncio_mode = "auto"
filterwarnings = [
"ignore::DeprecationWarning:dateutil.*",
"ignore::DeprecationWarning:pytz.*",
"ignore::DeprecationWarning:openpyxl.*",
"ignore::UserWarning:sklearn.*",
]
# ---------------------------------------------------------------------------
# coverage
# ---------------------------------------------------------------------------
[tool.coverage.run]
source = ["quant_platform"]
omit = [
"*/tests/*",
"*/node_modules/*",
"*/frontend/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]