-
Notifications
You must be signed in to change notification settings - Fork 682
Expand file tree
/
Copy pathpyproject.toml
More file actions
179 lines (159 loc) · 4.99 KB
/
pyproject.toml
File metadata and controls
179 lines (159 loc) · 4.99 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
177
178
179
#[build-system] #remove for python2
#requires = ["setuptools>=64.0", "wheel", "setuptools_scm"]
#build-backend = "setuptools.build_meta"
#[tool.setuptools_scm]
#local_scheme = "no-local-version"
[project]
name = "ddns"
dynamic = ["version"]
description = "Dynamic DNS client for multiple providers, supporting IPv4 and IPv6."
authors = [{ name = "NewFuture", email = "python@newfuture.cc" }]
readme = "README.md"
license = "MIT"
requires-python = ">=2.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Topic :: Internet",
"Topic :: Internet :: Name Service (DNS)",
"Topic :: System :: Networking",
"Topic :: Software Development",
'Programming Language :: Python :: 2.7',
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"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",
]
keywords = ["ddns", "ipv6", "ipv4", "dns", "dnspod", "alidns", "cloudflare"]
dependencies = []
[project.urls]
Homepage = "https://ddns.newfuture.cc"
Documentation = "https://ddns.newfuture.cc"
Repository = "https://github.com/NewFuture/DDNS"
"Bug Tracker" = "https://github.com/NewFuture/DDNS/issues"
Source = "https://github.com/NewFuture/DDNS"
[project.scripts]
ddns = "ddns.__main__:main"
# Optional dependencies
[project.optional-dependencies]
dev = [
"ruff",
"mock;python_version<'3.3'", # For Python 2.7 compatibility
]
# 可选的 pytest 支持(不是默认测试框架)
pytest = [
"pytest>=6.0",
"pytest-cov",
"mock;python_version<'3.3'",
]
# Setuptools configuration
[tool.setuptools]
platforms = ["any"]
packages = ["ddns", "ddns.config", "ddns.provider", "ddns.scheduler", "ddns.util"]
package-dir= {"ddns" = "ddns"}
#[tool.setuptools.packages.find]
#where = ["."]
[tool.setuptools.dynamic]
version = { attr = "ddns.__version__" }
# description = { attr = "ddns.__description__" }
# 测试配置 - 使用 unittest 作为默认测试框架
[tool.unittest]
start-directory = "tests"
pattern = "test_*.py"
# unittest 不需要额外配置,使用内置的 test discovery
# pytest 兼容配置(保持与 pytest 的兼容性)
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = ["-v", "--tb=short"]
# 确保 pytest 可以找到 test_base 模块
pythonpath = [".", "tests"]
# Ruff configuration - unified formatting and linting
[tool.ruff]
# Same line length as black was using
line-length = 120
# Ruff minimum supported version is py37, but project supports py27+
target-version = "py37"
exclude = [
".eggs",
".git",
".hg",
".mypy_cache",
".tox",
".venv",
"build",
"dist",
"__pycache__",
"*.egg-info",
]
[tool.ruff.lint]
# Enable pycodestyle (E, W), pyflakes (F), and mccabe (C) - same as flake8 defaults
# Deliberately exclude pyupgrade (UP) rules to maintain Python 2 compatibility
# (UP rules would convert u"" strings to "" which breaks py2 compatibility)
select = ["E", "W", "F", "C"]
# Same ignores as flake8 configuration, but using ruff rule codes
ignore = [
# "E203", # whitespace before ':' - not needed in ruff, formatter handles this
"E501", # line too long (handled by formatter)
"UP025", # unicode-kind-prefix (keep u"..." for Py2 compatibility)
]
# Same max complexity as flake8
mccabe = { max-complexity = 12 }
[tool.ruff.lint.per-file-ignores]
# Allow unused imports and redefined names in tests (same as flake8)
"tests/*" = ["F401", "F811"]
[tool.ruff.format]
line-ending = "auto"
indent-style = "space"
quote-style = "double"
skip-magic-trailing-comma = true # py2
docstring-code-format = true
docstring-code-line-length = "dynamic"
# 类型检查配置
[tool.pyright]
typeCheckingMode = "standard"
autoImportCompletions = true
autoFormatStrings = true
completeFunctionParens = true
supportAllPythonDocuments = true
importFormat = "relative"
generateWithTypeAnnotation = true
diagnosticMode = "workspace"
indexing = true
useLibraryCodeForTypes = true
# Coverage configuration (可选,仅在使用 pytest-cov 时需要)
# 要使用覆盖率报告,需要安装: pip install pytest pytest-cov
# 然后运行: pytest tests/ --cov=ddns --cov-report=term-missing
[tool.coverage.run]
source = ["ddns"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
"*/.*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
show_missing = true
precision = 2