-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
162 lines (143 loc) · 4.26 KB
/
pyproject.toml
File metadata and controls
162 lines (143 loc) · 4.26 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
[build-system]
requires = ["setuptools>=64", "setuptools-scm[toml]>=8", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "deep-solutions"
dynamic = ["version"]
description = "A Python package for deep learning solutions"
readme = "README.md"
authors = [
{name = "ZDHuang", email = "your.email@example.com"}
]
keywords = ["deep-learning", "machine-learning", "solutions"]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"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",
]
# Core dependencies
dependencies = [
"numpy>=1.17.0",
"scipy>=1.5.0",
"matplotlib>=3.3.0",
"torch>=1.7.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"ruff>=0.4.0",
"mypy>=1.0.0",
"build>=0.10.0",
"twine>=4.0.0",
"tox>=4.0.0",
"tox-gh>=1.0.0",
"commitizen>=3.0.0",
"pre-commit>=3.0.0",
]
docs = [
"sphinx>=6.0.0",
"sphinx-rtd-theme>=1.2.0",
]
[project.urls]
Homepage = "https://github.com/FrostyHec/deep-solutions"
Documentation = "https://github.com/FrostyHec/deep-solutions/blob/main/README.md"
Repository = "https://github.com/FrostyHec/deep-solutions"
Issues = "https://github.com/FrostyHec/deep-solutions/issues"
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools.packages.find]
where = ["src"]
include = ["deep_solutions*"]
exclude = ["tests*"]
# ============================================================
# setuptools-scm: Auto-generate version from Git Tag
# ============================================================
[tool.setuptools_scm]
write_to = "src/deep_solutions/_version.py"
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
write_to_template = """# file generated by setuptools-scm
# ruff: noqa
# don't change, don't track in version control
__all__ = [
\"__version__\",
\"__version_tuple__\",
\"version\",
\"version_tuple\",
]
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple
from typing import Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object
version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
__version__ = version = {version!r}
__version_tuple__ = version_tuple = {version_tuple!r}
"""
# ============================================================
# Ruff: Code formatting and Lint (replaces black/isort/flake8)
# ============================================================
[tool.ruff]
target-version = "py38"
line-length = 88
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by formatter)
]
[tool.ruff.lint.isort]
known-first-party = ["deep_solutions"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# ============================================================
# pytest configuration
# ============================================================
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --cov=deep_solutions --cov-report=term-missing"
# ============================================================
# mypy type check configuration
# ============================================================
[tool.mypy]
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
# ============================================================
# Commitizen configuration
# ============================================================
[tool.commitizen]
name = "cz_conventional_commits"
version_provider = "scm"
tag_format = "v$version"
update_changelog_on_bump = true
changelog_file = "CHANGELOG.md"