Skip to content

Commit 25b7244

Browse files
committed
[Dep Downloader] Better KiAuto versions
- Added KiCad 7, 8, 9 and 10 requirements - Better check in kibot-check - Better information about the minimum working version for the installed KiCad See #926
1 parent 5de9da7 commit 25b7244

25 files changed

Lines changed: 439 additions & 65 deletions

docs/source/dependencies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- Compare schematics for `kiri` (v2.2.0)
2323
- Print the page frame in GUI mode for `pcb_print` (v1.6.7)
2424

25-
`KiKit <https://github.com/INTI-CMNB/KiKit>`__ :index:`: <pair: dependency; KiKit>` v1.7.0 |image11| |Auto-download|
25+
`KiKit <https://github.com/INTI-CMNB/KiKit>`__ :index:`: <pair: dependency; KiKit>` v1.5.1 |image11| |Auto-download|
2626

2727
- Mandatory for: `panelize`, `stencil_3d`, `stencil_for_jig`
2828
- Optional to separate multiboard projects for general use

kibot/config_reader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,8 +1585,8 @@ def print_dependencies(markdown=True, jsn=False, rst=False):
15851585
needed.append(global2human(r.output))
15861586
else:
15871587
optional.append(r)
1588-
if r.version and (version is None or r.version > version):
1589-
version = r.version
1588+
if r.min_version and (version is None or r.min_version > version):
1589+
version = r.min_version
15901590
if r.max_version and (max_version is None or r.max_version < max_version):
15911591
max_version = r.max_version
15921592
ver = compose_version(version, max_version)
@@ -1610,8 +1610,8 @@ def print_dependencies(markdown=True, jsn=False, rst=False):
16101610
print()
16111611
for o in optional:
16121612
ver = ''
1613-
if o.version:
1614-
ver = ' (v'+'.'.join(map(str, o.version))+')'
1613+
if o.min_version:
1614+
ver = ' (v'+'.'.join(map(str, o.min_version))+')'
16151615
print(f'{ind}- {extra}{o.desc} for {global2human(o.output)}{ver}')
16161616
print_dep_comments(dep, extra, ind)
16171617
print()

kibot/dep_downloader.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
version_k6: 1.5.0
7878
version_k7: 1.6.0
7979
version_k9: 1.7.0
80+
version_k10: 1.8.0
8081
- from: KiKit
8182
role: Separate multiboard projects
8283
- name: Xvfbwrapper
@@ -915,13 +916,14 @@ def check_tool_dep(context, dep, fatal=False):
915916

916917
class ToolDependencyRole(object):
917918
""" Class used to define the role of a tool """
918-
def __init__(self, desc=None, version=None, output=None, max_version=None, all_versions=None):
919+
def __init__(self, desc=None, version=None, output=None, max_version=None, all_versions=None, min_version=None):
919920
# Is this tool mandatory
920921
self.mandatory = desc is None
921922
# If not mandatory, for what?
922923
self.desc = desc
923924
# Which version is needed?
924925
self.version = version
926+
self.min_version = min_version
925927
self.max_version = max_version
926928
self.all_versions = all_versions
927929
# Which output needs it?
@@ -986,6 +988,21 @@ def get_dep_version(dep):
986988
# Look if we have a version depending on KiCad version
987989
k_ver = GS.kicad_version_major
988990
all_versions = {kv: dep['version_k'+str(kv)] for kv in range(5, 25) if 'version_k'+str(kv) in dep}
991+
992+
# Minimum requirement
993+
# Try a version for all KiCad versions
994+
min_version = dep.get('version', None)
995+
if min_version is None:
996+
# Look for the smallest KiCad version
997+
for i in range(5, 25):
998+
n_version = 'version_k'+str(i)
999+
if n_version in dep:
1000+
min_version = dep[n_version]
1001+
break
1002+
if min_version is not None:
1003+
min_version = version_str2tuple(str(min_version))
1004+
1005+
# Actually needed
9891006
version = None
9901007
while k_ver >= 5 and version is None:
9911008
version = dep.get('version_k'+str(k_ver), None)
@@ -995,7 +1012,8 @@ def get_dep_version(dep):
9951012
version = dep.get('version', None)
9961013
if version is not None:
9971014
version = version_str2tuple(str(version))
998-
return all_versions, version
1015+
1016+
return all_versions, version, min_version
9991017

10001018

10011019
def register_dep(context, dep):
@@ -1014,11 +1032,12 @@ def register_dep(context, dep):
10141032
desc = dep['role']
10151033
if desc.lower() == 'mandatory':
10161034
desc = None
1017-
all_versions, version = get_dep_version(dep)
1035+
all_versions, version, min_version = get_dep_version(dep)
10181036
max_version = dep.get('max_version', None)
10191037
if max_version is not None:
10201038
max_version = version_str2tuple(str(max_version))
1021-
role = ToolDependencyRole(desc=desc, version=version, max_version=max_version, all_versions=all_versions)
1039+
role = ToolDependencyRole(desc=desc, version=version, max_version=max_version, all_versions=all_versions,
1040+
min_version=min_version)
10221041
# Solve the URLs
10231042
github = dep.get('github', None)
10241043
url_def = url_down_def = None

kibot/out_diff.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
- from: KiAuto
1919
role: Compare schematics
2020
version: 2.2.0
21+
version_k7: 2.2.8
22+
version_k8: 2.3.2
23+
version_k9: 2.3.5
24+
version_k10: 2.3.7
2125
"""
2226
from hashlib import sha1
2327
from itertools import combinations

kibot/out_dxf_sch_print.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
role: mandatory
1010
command: eeschema_do
1111
version: 2.3.6
12+
version_k10: 2.3.7
1213
"""
1314
from .gs import GS
1415
from .out_any_sch_print import Any_SCH_PrintOptions

kibot/out_gencad.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
- from: KiAuto
99
role: mandatory
1010
version: 1.6.5
11+
version_k7: 2.2.8
12+
version_k8: 2.3.2
13+
version_k9: 2.3.5
14+
version_k10: 2.3.7
1115
"""
1216
import os
1317
from .gs import GS

kibot/out_hpgl_sch_print.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
role: mandatory
1010
command: eeschema_do
1111
version: 2.3.6
12+
version_k10: 2.3.7
1213
"""
1314
from .gs import GS
1415
from .out_any_sch_print import Any_SCH_PrintOptions

kibot/out_info.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
- from: KiAuto
99
role: Show KiAuto installation information
1010
version: 2.0.0
11+
version_k7: 2.2.8
12+
version_k8: 2.3.2
13+
version_k9: 2.3.5
14+
version_k10: 2.3.7
1115
"""
1216
import os
1317
import sys

kibot/out_kiri.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
- from: KiAuto
1919
role: Compare schematics
2020
version: 2.2.0
21+
version_k7: 2.2.8
22+
version_k8: 2.3.2
23+
version_k9: 2.3.5
24+
version_k10: 2.3.7
2125
"""
2226
import datetime
2327
import glob

kibot/out_netlist.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
role: mandatory
1010
command: eeschema_do
1111
version: 2.0.0
12+
version_k7: 2.2.8
13+
version_k8: 2.3.2
14+
version_k9: 2.3.5
15+
version_k10: 2.3.7
1216
"""
1317
import os
1418
from .gs import GS

0 commit comments

Comments
 (0)