-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
138 lines (124 loc) · 4.04 KB
/
pyproject.toml
File metadata and controls
138 lines (124 loc) · 4.04 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "host-image-backup"
dynamic = ["version"]
description = "A Python-based command-line tool for backing up images from multiple image hosting services to local storage"
authors = [{ name = "Wenjie Xu", email = "wenjie.xu.cn@outlook.com" }]
dependencies = [
"typer",
"requests",
"pyyaml",
"tqdm",
"oss2",
"cos-python-sdk-v5",
"python-dotenv",
"rich",
"loguru",
"pydantic",
"pillow",
]
requires-python = ">=3.10"
readme = "README.md"
license = { text = "MIT" }
keywords = ["image", "host", "backup", "CLI", "oss"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Utilities",
]
[project.optional-dependencies]
dev = ["pytest", "pytest-cov", "black", "flake8", "mypy", "pre-commit", "ruff"]
[project.urls]
Homepage = "https://waynexucn.github.io/app/HostImageBackup/index.html"
Repository = "https://github.com/WayneXuCN/HostImageBackup"
Issues = "https://github.com/WayneXuCN/HostImageBackup/issues"
[project.scripts]
host-image-backup = "host_image_backup.cli:app"
hib = "host_image_backup.cli:app"
# 插件系统:内置提供商入口点 (允许外部包追加新的 providers)
[project.entry-points."host_image_backup.providers"]
oss = "host_image_backup.providers.oss:OSSProvider"
cos = "host_image_backup.providers.cos:COSProvider"
sms = "host_image_backup.providers.sms:SMSProvider"
imgur = "host_image_backup.providers.imgur:ImgurProvider"
github = "host_image_backup.providers.github:GitHubProvider"
# Provider Config 动态发现入口点(名称需与 providers 一致)
[project.entry-points."host_image_backup.provider_configs"]
oss = "host_image_backup.config:OSSConfig"
cos = "host_image_backup.config:COSConfig"
sms = "host_image_backup.config:SMSConfig"
imgur = "host_image_backup.config:ImgurConfig"
github = "host_image_backup.config:GitHubConfig"
[tool.hatch.version]
path = "src/host_image_backup/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["src/host_image_backup"]
[tool.ruff]
# Basic settings
line-length = 88
target-version = "py310"
# Excluded files and directories
exclude = [
".eggs",
"*.egg-info",
".git",
".hg",
".mypy_cache",
"__pycache__",
".tox",
".venv",
"build",
"dist",
]
[tool.ruff.lint]
# Enabled rule sets
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes (syntax error checking)
"I", # isort (import sorting)
"B", # flake8-bugbear (common bug checking)
"C4", # flake8-comprehensions (comprehension optimizations)
"UP", # pyupgrade (Python version upgrade suggestions)
"SIM", # flake8-simplify (code simplification)
"Q", # flake8-quotes (quote checking)
]
# Ignored rules
ignore = [
"E501", # Line length (handled by formatter)
"B008", # Mutable default values in function arguments (sometimes needed)
]
[tool.ruff.format]
quote-style = "double" # Use double quotes
indent-style = "space" # Use space indentation
skip-magic-trailing-comma = false # Do not skip magic trailing comma
line-ending = "auto" # Use automatic line ending
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --cov=src/host_image_backup --cov-report=term-missing --cov-report=html"