Skip to content

Commit 430d640

Browse files
python313Packages.atopile: 0.2.69 -> 0.11.2 (#393261)
2 parents 70a640b + 93364bd commit 430d640

File tree

8 files changed

+417
-66
lines changed

8 files changed

+417
-66
lines changed

pkgs/development/python-modules/easyeda2ato/default.nix renamed to pkgs/development/python-modules/atopile-easyeda2kicad/default.nix

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
{
22
lib,
33
buildPythonPackage,
4-
fetchPypi,
5-
setuptools,
4+
fetchFromGitHub,
5+
hatchling,
6+
hatch-vcs,
67
pydantic,
78
requests,
89
}:
910

1011
buildPythonPackage rec {
11-
pname = "easyeda2ato";
12-
version = "0.2.7";
12+
pname = "atopile-easyeda2kicad";
13+
version = "0.9.5";
1314
pyproject = true;
1415

15-
# repo version does not match
16-
src = fetchPypi {
17-
inherit pname version;
18-
19-
hash = "sha256-bHhBN+h9Vx9Q4wZVKxMzkEEXzV7hKoQz8i+JpkSFsYA=";
16+
src = fetchFromGitHub {
17+
owner = "atopile";
18+
repo = "easyeda2kicad.py";
19+
tag = "v${version}";
20+
hash = "sha256-TLGLNe/Lk2WpYMzmX2iK3S27/QRqTOdHqO8XIMZSda4=";
2021
};
2122

22-
build-system = [ setuptools ];
23+
build-system = [
24+
hatchling
25+
hatch-vcs
26+
];
2327

2428
dependencies = [
2529
pydantic
@@ -32,8 +36,8 @@ buildPythonPackage rec {
3236

3337
meta = {
3438
description = "Convert any LCSC components (including EasyEDA) to KiCad library";
35-
homepage = "https://github.com/uPesy/easyeda2kicad.py";
36-
changelog = "https://github.com/uPesy/easyeda2kicad.py/releases/tag/v${version}";
39+
homepage = "https://github.com/atopile/easyeda2kicad.py";
40+
changelog = "https://github.com/atopile/easyeda2kicad.py/releases/tag/v${version}";
3741
license = lib.licenses.agpl3Only;
3842
maintainers = with lib.maintainers; [ sigmanificient ];
3943
mainProgram = "easyeda2kicad";

pkgs/development/python-modules/atopile/default.nix

Lines changed: 151 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,75 @@
22
lib,
33
buildPythonPackage,
44
fetchFromGitHub,
5+
6+
cmake,
7+
ninja,
58
# build-system
69
hatchling,
710
scikit-build-core,
811
hatch-vcs,
912
nanobind,
1013
# deps
1114
antlr4-python3-runtime,
12-
attrs,
15+
atopile-easyeda2kicad,
16+
black,
1317
case-converter,
14-
cattrs,
15-
click,
16-
deepdiff,
17-
easyeda2ato,
18-
eseries,
19-
fake-useragent,
20-
fastapi,
18+
cookiecutter,
19+
dataclasses-json,
20+
deprecated,
21+
fastapi-github-oidc,
22+
freetype-py,
2123
gitpython,
22-
igraph,
23-
jinja2,
24+
kicad-python,
25+
kicadcliwrapper,
26+
matplotlib,
27+
mcp,
28+
more-itertools,
2429
natsort,
25-
networkx,
26-
pandas,
30+
numpy,
31+
ordered-set,
32+
pathvalidate,
2733
pint,
34+
posthog,
35+
psutil,
36+
pydantic-settings,
2837
pygls,
29-
quart-cors,
30-
quart-schema,
31-
quart,
38+
questionary,
39+
requests,
3240
rich,
3341
ruamel-yaml,
34-
schema,
35-
scipy,
42+
ruff,
3643
semver,
37-
toolz,
44+
sexpdata,
45+
shapely,
46+
typer,
3847
urllib3,
39-
uvicorn,
40-
watchfiles,
41-
pyyaml,
48+
zstd,
49+
pythonOlder,
50+
4251
# tests
4352
pytestCheckHook,
44-
pytest-xdist,
53+
54+
pytest-benchmark,
4555
pytest-timeout,
56+
pytest-datafiles,
57+
pytest-xdist,
58+
hypothesis,
59+
writableTmpDirAsHomeHook,
4660
}:
4761

4862
buildPythonPackage rec {
4963
pname = "atopile";
50-
version = "0.2.69";
64+
version = "0.11.2";
5165
pyproject = true;
5266

67+
disabled = pythonOlder "3.13";
68+
5369
src = fetchFromGitHub {
5470
owner = "atopile";
5571
repo = "atopile";
5672
tag = "v${version}";
57-
hash = "sha256-mQYnaWch0lVzz1hV6WboYxBGe3ruw+mK2AwMx13DQJM=";
73+
hash = "sha256-JczlQulHlViV9pg0uPXd9Boagp74VBdZ1UMDXh2c3DA=";
5874
};
5975

6076
build-system = [
@@ -64,59 +80,142 @@ buildPythonPackage rec {
6480
nanobind
6581
];
6682

83+
dontUseCmakeConfigure = true; # skip cmake configure invocation
84+
85+
nativeBuildInputs = [
86+
cmake
87+
ninja
88+
];
89+
6790
dependencies = [
6891
antlr4-python3-runtime
69-
attrs
92+
atopile-easyeda2kicad
93+
black # used as a dependency
7094
case-converter
71-
cattrs
72-
click
73-
deepdiff
74-
easyeda2ato
75-
eseries
76-
fake-useragent
77-
fastapi
95+
cookiecutter
96+
dataclasses-json
97+
deprecated
98+
fastapi-github-oidc
99+
freetype-py
78100
gitpython
79-
igraph
80-
jinja2
101+
kicad-python
102+
kicadcliwrapper
103+
matplotlib
104+
mcp
105+
more-itertools
81106
natsort
82-
networkx
83-
pandas
107+
numpy
108+
ordered-set
109+
pathvalidate
84110
pint
111+
posthog
112+
psutil
113+
pydantic-settings
85114
pygls
86-
quart-cors
87-
quart-schema
88-
quart
115+
questionary
116+
requests
89117
rich
90118
ruamel-yaml
91-
schema
92-
scipy
119+
ruff
93120
semver
94-
toolz
121+
sexpdata
122+
shapely
123+
typer
95124
urllib3
96-
uvicorn
97-
watchfiles
98-
pyyaml # required for ato
125+
zstd
99126
];
100127

101-
pythonRelaxDeps = [ "antlr4-python3-runtime" ];
128+
pythonRelaxDeps = [
129+
"posthog"
130+
"zstd"
131+
];
102132

103133
pythonImportsCheck = [ "atopile" ];
104134

135+
nativeCheckInputs = [
136+
writableTmpDirAsHomeHook
137+
pytestCheckHook
138+
pytest-xdist
139+
pytest-benchmark
140+
pytest-datafiles
141+
pytest-timeout
142+
hypothesis
143+
];
144+
105145
preCheck = ''
146+
# do not report worker logs to filee
147+
substituteInPlace test/conftest.py \
148+
--replace-fail "worker_id =" "worker_id = None #"
149+
150+
# unrecognized flags
106151
substituteInPlace pyproject.toml \
107152
--replace-fail "--html=artifacts/test-report.html" "" \
108-
--replace-fail "--self-contained-html" ""
153+
--replace-fail "--self-contained-html" "" \
154+
--replace-fail "--numprocesses=auto" "" \
155+
156+
# Replace this function call that cause test to hang
157+
substituteInPlace \
158+
test/cli/test_packages.py \
159+
test/library/test_names.py \
160+
test/test_examples.py \
161+
test/test_parse_utils.py \
162+
--replace-fail "_repo_root()" "Path('$(pwd)')"
163+
164+
# Fix crash due to empty list in fixture tests
165+
substituteInPlace \
166+
test/test_examples.py \
167+
test/test_parse_utils.py \
168+
--replace-fail "p.stem" "p.stem if isinstance(p, Path) else p"
109169
'';
110170

111-
nativeCheckInputs = [
112-
pytestCheckHook
113-
pytest-xdist
114-
pytest-timeout
171+
disabledTestPaths = [
172+
# timouts
173+
"test/test_cli.py"
174+
"test/cli/test_packages.py"
175+
"test/end_to_end/test_net_naming.py"
176+
"test/end_to_end/test_pcb_export.py"
177+
"test/exporters/bom/test_bom.py"
178+
"test/front_end/test_front_end_pick.py"
179+
"test/libs/picker/test_pickers.py"
180+
];
181+
182+
disabledTests = [
183+
# timeout
184+
"test_build_error_logging"
185+
"test_performance_mifs_bus_params"
186+
"test_resistor"
187+
"test_reserved_attrs"
188+
# requires internet
189+
"test_simple_pick"
190+
"test_simple_negative_pick"
191+
"test_jlcpcb_pick_resistor"
192+
"test_jlcpcb_pick_capacitor"
193+
"test_regression_rp2040_usb_diffpair_full"
194+
"test_model_translations"
195+
# type error
196+
"test_alternate_trait_constructor_with_params"
197+
"test_parameterised_trait_with_params"
198+
"test_trait_alternate_constructor_precedence"
199+
"test_trait_template_enum"
200+
"test_trait_template_enum_invalid"
201+
# failure
202+
"test_solve_voltage_divider_complex"
115203
];
116204

205+
# in order to use pytest marker, we need to use ppytestFlagsArray
206+
# using pytestFlags causes `ERROR: file or directory not found: slow`
207+
pytestFlagsArray = [
208+
"-m='not slow and not not_in_ci and not regression'"
209+
"--timeout=10" # any test taking long, timouts with more than 60s
210+
"--benchmark-disable"
211+
"--tb=line"
212+
];
213+
214+
doCheck = true;
215+
117216
meta = {
118217
description = "Design circuit boards with code";
119-
homepage = "https://aiopg.readthedocs.io/";
218+
homepage = "https://atopile.io";
120219
downloadPage = "https://github.com/atopile/atopile";
121220
changelog = "https://github.com/atopile/atopile/releases/tag/${src.rev}";
122221
license = with lib.licenses; [ mit ];
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
buildPythonPackage,
3+
fetchFromGitHub,
4+
hatchling,
5+
hatch-vcs,
6+
fastapi,
7+
pyjwt,
8+
httpx,
9+
requests,
10+
pytestCheckHook,
11+
lib,
12+
}:
13+
buildPythonPackage rec {
14+
pname = "fastapi-github-oidc";
15+
version = "0.3.0";
16+
pyproject = true;
17+
18+
src = fetchFromGitHub {
19+
owner = "atopile";
20+
repo = "fastapi-github-oidc";
21+
tag = version;
22+
hash = "sha256-FS50++Hy9h0RFrSnc4PbXFPh/1OO0JOaFdIZwoXa86A=";
23+
};
24+
25+
build-system = [
26+
hatchling
27+
hatch-vcs
28+
];
29+
30+
dependencies = [
31+
fastapi
32+
pyjwt
33+
httpx
34+
requests
35+
];
36+
37+
pythonImportsCheck = [
38+
"github_oidc.client"
39+
"github_oidc.server"
40+
];
41+
42+
nativeCheckInputs = [ pytestCheckHook ];
43+
44+
disabledTests = [
45+
"test_with_auth" # calls github api
46+
];
47+
48+
meta = {
49+
description = "FastAPI compatible middleware to authenticate Github OIDC Tokens";
50+
homepage = "https://github.com/atopile/fastapi-github-oidc";
51+
changelog = "https://github.com/atopile/fastapi-github-oidc/releases/tag/${src.tag}";
52+
license = with lib.licenses; [ mit ];
53+
maintainers = with lib.maintainers; [ sigmanificient ];
54+
};
55+
}

0 commit comments

Comments
 (0)