-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
159 lines (136 loc) · 3.85 KB
/
pyproject.toml
File metadata and controls
159 lines (136 loc) · 3.85 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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "sts-lib"
requires-python = "~=3.8"
description = "An open library for flexible simplified-traditional Chinese text conversion."
readme = "README.md"
# Use dynamic license (and provide it in setup.py) since the format introduced
# by PEP 639 requires setuptools>=77.0.3, which does not support Python 3.8.
# ref: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
dynamic = [
"license",
"version",
]
authors = [
{name = "Danny Lin", email = "danny0838@gmail.com"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"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",
"Programming Language :: Python :: 3.14",
]
[project.urls]
Homepage = "https://github.com/danny0838/sts-lib"
[project.scripts]
sts = "sts.cli:main"
[project.optional-dependencies]
yaml = [
"pyyaml>=5.0",
]
[dependency-groups]
dev = [
"tox>=4.21.2",
]
lint = [
"flake8>=6.1",
"Flake8-pyproject>=1.2.3",
"pep8-naming>=0.13.2",
"flake8-comprehensions>=3.8",
"flake8-quotes>=3.4",
"flake8-bugbear>=22.6.22",
"flake8-isort>=5.0",
"isort>=5.9.2",
]
scripts = [
"jinja2",
"requests",
]
[tool.setuptools.packages.find]
include = ["sts*"]
[tool.setuptools.package-data]
sts = [
"data/*.html",
"data/config/*.json",
"data/dictionary/*.txt",
"data/scheme/*.txt",
]
[tool.setuptools.dynamic.version]
attr = "sts.__version__"
[tool.flake8]
exclude = [
".git",
".tox",
".venv",
"build",
"dist",
"setup.py",
]
max-line-length = 160
# Flake8 Rules
# https://www.flake8rules.com/
# W503: Line break occurred before a binary operator
ignore = [
"W503",
]
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
# skip directories included by default
# ref: https://pycqa.github.io/isort/docs/configuration/options.html
[tool.tox]
env_list = ["py314", "py313", "py312", "py311", "py310", "py39", "py38"]
min_version = "4.22"
[tool.tox.env_run_base]
description = "run unit tests"
package = "editable"
extras = ["yaml"]
pass_env = ["STS_RUN_SLOW_TESTS"]
commands = [["python", "-m", "unittest", {replace = "posargs", extend = true}]]
[tool.tox.env.release]
description = "build and release to PyPI"
package = "skip"
deps = [
"build",
"twine>=4.0",
]
pass_env = [
"TWINE_USERNAME",
"TWINE_PASSWORD",
]
commands = [
# Purge previously built files by bdist (wheel) to prevent deleted files
# being included in the package.
["python", "-c", "import shutil; shutil.rmtree('build', ignore_errors=True)"],
["python", "-m", "build", "--sdist", "--wheel"],
["python", "-m", "twine", "upload", "--skip-existing", "dist/*"],
]
[tool.tox.env.lint]
description = "lint source code"
package = "skip"
dependency_groups = ["lint"]
commands = [["flake8", {replace = "posargs", default = ["."], extend = true}]]
[tool.tox.env.isort]
description = "sort imports for the source code"
package = "skip"
dependency_groups = ["lint"]
commands = [["isort", {replace = "posargs", default = ["."], extend = true}]]
[tool.tox.env.fetch]
description = "fetch and update external resources"
package = "editable"
dependency_groups = ["scripts"]
commands = [["python", "scripts/fetch.py", {replace = "posargs", extend = true}]]
[tool.tox.env.build]
description = "build or update resource files or static site"
package = "editable"
dependency_groups = ["scripts"]
commands = [["python", "scripts/build.py", {replace = "posargs", extend = true}]]