-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathpyproject.toml
More file actions
187 lines (166 loc) · 4.87 KB
/
pyproject.toml
File metadata and controls
187 lines (166 loc) · 4.87 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
180
181
182
183
184
185
186
187
[build-system]
requires = [
"hatchling>=1.18",
"hatch-kicad",
"hatch-fancy-pypi-readme",
"hatch-vcs",
]
build-backend = "hatchling.build"
[project]
name = "kbplacer"
authors = [
{ name = "adamws", email = "adamws@users.noreply.github.com" },
]
description = "KiCad plugin for automatic keyboard's key placement"
keywords = ["kicad"]
requires-python = ">=3.10"
license = {text = "GPL-3.0"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Manufacturing",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)"
]
dynamic = ["readme", "version"]
[project.urls]
"Homepage" = "https://github.com/adamws/kicad-kbplacer"
"Bug Tracker" = "https://github.com/adamws/kicad-kbplacer/issues"
"Sponsor" = "https://ko-fi.com/adamws"
[project.scripts]
kbplacer = "kbplacer.__main__:app"
[project.optional-dependencies]
schematic = [
"kicad-skip==0.2.5",
]
[tool.hatch]
build.targets.sdist.include = [
"kbplacer/*.py"
]
build.targets.sdist.exclude = [
"kbplacer/kbplacer_plugin_action.py"
]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "kbplacer/_version.py"
[tool.hatch.build.targets.kicad-package]
name = "Keyboard footprints placer"
description = "Plugin for mechanical keyboard design"
description_full = [
"Plugin for mechanical keyboard design.\n",
"It features automatic key placement and routing based on various ",
"layout descriptions like <a href='editor.keyboard-tools.xyz'>kle-ng</a>, ",
"<a href='www.github.com/ergogen/ergogen'>ergogen</a> and ",
"<a href='www.caniusevia.com'>via</a>.\n",
"To learn more visit project's homepage.",
]
identifier = "com.github.adamws.kicad-kbplacer"
author = { name = "adamws", web="https://adamws.github.io" }
tags = ["keyboard"]
status = "{env:KBPLACER_KICAD_STATUS:development}"
kicad_version = "6.0"
sources = ["kbplacer", "dist"] # rewrite paths
include = [
"kbplacer/*.py",
"kbplacer/icon.png",
]
artifacts = ["dist/locale"] # generated by `release/hatch_translate.py` hook
icon = "resources/icon.png"
download_url = "{env:KBPLACER_KICAD_RELEASE_URL:https://adamws.github.io/kicad-kbplacer/{zip_name}}"
[tool.hatch.build.targets.kicad-package.hooks.custom]
path = "release/hatch_translate.py"
[tool.hatch.build.targets.kicad-package.hooks.kicad-repository]
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
fragments = [
{ text = "KiCad plugin for mechanical keyboard design.\n" },
{ text = "https://github.com/adamws/kicad-kbplacer" },
]
[tool.hatch.envs.test]
features = [
"schematic",
]
dependencies = [
"lzstring==1.0.4",
"Pillow==10.4.0",
"pytest==8.3.0",
"pytest-benchmark==5.2.3",
"pytest-cov==7.0.0",
"pytest-metadata==3.1.1",
"pytest-html==4.1.1",
"PyVirtualDisplay==3.0",
"PyYAML==6.0.1",
"sexpdata==1.0.2",
"svgpathtools==1.6.1",
"xmldiff==2.7.0",
]
system-packages = true # for `pcbnew` module
[tool.hatch.envs.test.scripts]
test = "pytest {args:tests}"
test-plugin-install = "pytest -c /dev/null --ignore tools --test-plugin-installation --continue-on-collection-errors -k test_with_examples tests"
benchmark = "pytest tests/test_performance.py --no-cov --benchmark-enable --benchmark-autosave {args}"
[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=24.4.2",
"mypy>=1.0.0",
"ruff>=0.5.3",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:kbplacer tests}"
style = [
"ruff check --output-format=concise {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff check --fix --output-format=concise {args:.}",
"style",
]
all = [
"style",
"typing",
]
[tool.black]
target-version = ["py37"]
line-length = 88
[tool.ruff]
lint.select = ["ANN", "E", "F", "I", "N", "PL", "W"]
lint.ignore = [
# Ignore missing type annotations for `self` in method and `cls` in classmethod
"ANN101", "ANN102",
]
[tool.ruff.lint.per-file-ignores]
"kbplacer/kbplacer_plugin_action.py" = ["N802"]
"kbplacer/kbplacer_dialog.py" = ["N802"]
"kbplacer/help_dialog.py" = ["N802"]
"tests/**/*" = ["ANN"]
[tool.ruff.lint.isort]
known-first-party = ["hatch_kicad"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.coverage.run]
patch = ["subprocess"]
relative_files = true
omit = [
"kbplacer/_version.py",
]
[tool.hatch.envs.tools]
dependencies = [
"colormath==3.0.0",
"drawsvg==2.4.0",
"lzstring==1.0.4",
"pyurlon==0.1.0",
"PyYAML==6.0.1",
"shapely==2.0.6",
"solidpython==1.1.3",
"pytest>=6.0.0",
]
[tool.hatch.envs.tools.scripts]
layout2image = "python tools/layout2image.py {args}"
layout2url = "python tools/layout2url.py {args}"
layout2openscad = "python tools/layout2openscad.py {args}"
kle2kle = "python tools/kle2kle.py {args}"
test = "python tools/run_tests.py {args}"