Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions .github/workflows/pr-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,63 +18,63 @@ jobs:
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths: '[
"compiler/**",
"edg_core/**",
"electronics_model/**",
"electronics_abstract_parts/**",
"electronics_lib/**",
"edg/**",
"examples/**.py"
]'
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths: '[
"compiler/**",
"edg_core/**",
"electronics_model/**",
"electronics_abstract_parts/**",
"electronics_lib/**",
"edg/**",
"examples/**.py"
]'

black_latest_3_11:
black_latest_3_13:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
Comment on lines +34 to 36
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming the job IDs (eg black_latest_3_11 -> black_latest_3_13) will change the required status check names reported to GitHub. If branch protection rules depend on the old names, merges may be blocked until those rules are updated. Consider keeping stable job IDs and only changing the displayed name/step config, or coordinate the branch protection update.

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'

- name: install mypy
- name: install black
run: |
pip install -r requirements.txt
pip install black
- name: black
run: black --check .

mypy_latest_3_11:
mypy_latest_3_13:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.11'
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: install mypy
run: |
pip install -r requirements.txt
pip install mypy mypy-protobuf
mypy --version
- name: mypy
run: mypy --install-types .
- name: install mypy
run: |
pip install -r requirements.txt
pip install mypy mypy-protobuf
mypy --version
- name: mypy
run: mypy --install-types .

packagetest_latest_3_11:
packagetest_latest_3_13:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'

- name: install dependencies
run: pip install -r requirements.txt
Expand All @@ -85,30 +85,30 @@ jobs:
- name: toptest
run: cd examples && python test_blinky.py

unittest_latest_3_11:
unittest_latest_3_13:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.11'
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: install dependencies
run: pip install -r requirements.txt
- name: unittest
run: python -m unittest discover
- name: install dependencies
run: pip install -r requirements.txt
- name: unittest
run: python -m unittest discover

unittest_latest_3_9:
unittest_latest_3_10:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.9'
python-version: '3.10'

- name: install dependencies
run: pip install -r requirements.txt
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/pr-scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,37 @@ jobs:
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths: '["compiler/**"]'
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths: '["compiler/**"]'

sbt:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
- uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: install dependencies
run: pip install -r requirements.txt
- name: sbt test
run: cd compiler && sbt -v +test
- uses: actions/checkout@v6
- name: Setup JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: install dependencies
run: pip install -r requirements.txt
- name: sbt test
run: cd compiler && sbt -v +test

scalafmt-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checking the code with scalafmt
uses: AvaPL/scalafmt-native-formatter@v0
with:
conf-path: compiler/.scalafmt.conf
- uses: actions/checkout@v6
- name: Checking the code with scalafmt
uses: AvaPL/scalafmt-native-formatter@v0
with:
conf-path: compiler/.scalafmt.conf
2 changes: 1 addition & 1 deletion edg/BoardCompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def compile_board(design: Type[Block], target_dir_name: Optional[Tuple[str, str]]) -> CompiledDesign:
if target_dir_name is not None:
(target_dir, target_name) = target_dir_name
target_dir, target_name = target_dir_name
if not os.path.exists(target_dir):
os.makedirs(target_dir)
assert os.path.isdir(target_dir), f"target_dir {target_dir} to compile_board must be directory"
Expand Down
1 change: 0 additions & 1 deletion edg/abstract_parts/AbstractLed.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .PartsTablePart import PartsTableSelector
from .StandardFootprint import StandardFootprint, HasStandardFootprint


LedColor = str # type alias
LedColorLike = StringLike # type alias

Expand Down
1 change: 0 additions & 1 deletion edg/abstract_parts/ESeriesUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from ..electronics_model import *


SeriesDefaultType = TypeVar("SeriesDefaultType")


Expand Down
2 changes: 1 addition & 1 deletion edg/abstract_parts/PassiveConnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ def generate(self) -> None:
# TODO ideally this is require, but we don't support set ops in the IR
assert length in self.allowed_pins, f"requested length {length} outside allowed length {self.allowed_pins}"

(footprint, mfr, part) = self.part_footprint_mfr_name(length)
footprint, mfr, part = self.part_footprint_mfr_name(length)
self.footprint("J", footprint, {pin_name: pin_port for (pin_name, pin_port) in self.pins.items()}, mfr, part)
1 change: 0 additions & 1 deletion edg/abstract_parts/StandardFootprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from ..electronics_model import *


StandardPinningType = TypeVar("StandardPinningType", bound=Block)
PinningFunction = Callable[[StandardPinningType], Dict[str, CircuitPort]]

Expand Down
4 changes: 2 additions & 2 deletions edg/core/Blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def add_ports(self, ports: Iterable[BasePort]) -> None:
elif len(self.ports) == 2:
is_export = self._is_export()
if is_export:
(ext_port, int_port) = is_export
ext_port, int_port = is_export
initializers = ext_port._get_initializers([])
if initializers:
raise UnconnectableError(
Expand Down Expand Up @@ -198,7 +198,7 @@ def make_connection(self) -> Optional[Union[ConnectedLink, Export]]:

is_export = self._is_export()
if is_export:
(ext_port, int_port) = is_export
ext_port, int_port = is_export
return Connection.Export(isinstance(ext_port, BaseVector), ext_port, int_port)

bridged_connects: List[Tuple[BasePort, edgir.LocalPath]] = []
Expand Down
1 change: 0 additions & 1 deletion edg/core/BufferSerializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import google.protobuf as protobuf
import struct


MessageType = TypeVar("MessageType", bound=protobuf.message.Message)
kHeaderMagicByte = b"\xfe"

Expand Down
1 change: 0 additions & 1 deletion edg/core/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from .IdentityDict import IdentityDict
from .IdentitySet import IdentitySet


ElementType = TypeVar("ElementType")


Expand Down
1 change: 0 additions & 1 deletion edg/core/Generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from .HdlUserExceptions import *
from .HierarchyBlock import Block


CastableType = TypeVar("CastableType", bound=Any)


Expand Down
1 change: 0 additions & 1 deletion edg/core/Refinements.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from .. import edgrpc
from .HierarchyBlock import Block


DesignPath = Iterable[str]
DesignPostfix = Iterable[str]

Expand Down
6 changes: 3 additions & 3 deletions edg/electronics_model/test_kicad.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ def generate_net(self, design: Type[Block]) -> Tuple[str, str]:
return NetlistBackend().run(compiled)[0][1], GenerateBom().run(compiled)[0][1]

def test_basic_kicad(self) -> None:
(net, bom) = self.generate_net(test_netlist.TestBasicCircuit)
net, bom = self.generate_net(test_netlist.TestBasicCircuit)
with open(os.path.splitext(os.path.basename(__file__))[0] + "_basic.net", "w") as f:
f.write(net)
with open(os.path.splitext(os.path.basename(__file__))[0] + "_basic.csv", "w") as f:
f.write(bom)

def test_multisink_kicad(self) -> None:
(net, bom) = self.generate_net(test_netlist.TestMultisinkCircuit)
net, bom = self.generate_net(test_netlist.TestMultisinkCircuit)
with open(os.path.splitext(os.path.basename(__file__))[0] + "_multisink.net", "w") as f:
f.write(net)
with open(os.path.splitext(os.path.basename(__file__))[0] + "_multisink.csv", "w") as f:
f.write(bom)

def test_multinet_kicad(self) -> None:
(net, bom) = self.generate_net(test_netlist.TestMultinetCircuit)
net, bom = self.generate_net(test_netlist.TestMultinetCircuit)
with open(os.path.splitext(os.path.basename(__file__))[0] + "_multinet.net", "w") as f:
f.write(net)
with open(os.path.splitext(os.path.basename(__file__))[0] + "_multinet.csv", "w") as f:
Expand Down
1 change: 0 additions & 1 deletion edg/hdl_server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from ..core import *
from ..core.Core import NonLibraryProperty


EDG_PROTO_VERSION = 7


Expand Down
1 change: 0 additions & 1 deletion edg/parts/Microcontroller_Esp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from .PassiveConnector_Header import PinHeader254
from .PassiveConnector_TagConnect import TagConnect


# contains common blocks for ESP microcontrollers


Expand Down
1 change: 0 additions & 1 deletion edg/parts/Rf_Pn7160.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from ..abstract_parts import *
from .JlcPart import JlcPart


# TODO: some of these are pretty general RF building blocks and can be moved into shared libraries
# but until there are enough use cases they'll be buried here for now
# TODO: this is a bit of a structural mess right now, as with the other RF blocks, and needs refactoring
Expand Down
1 change: 0 additions & 1 deletion edg/parts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@
from .Jacdac import JacdacMountingData1, JacdacMountingGnd2, JacdacMountingGnd4, JacdacMountingPwr3
from .Jacdac import JacdacDeviceTop


# compatibility shims
import deprecated as __deprecated # not to be exported

Expand Down
4 changes: 2 additions & 2 deletions examples/jlcpcb_pcba_postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ def remap_by_dict(elt: str, remap_dict: Dict[str, str]) -> str:

# correct offsets before applying rotation
if lcsc_opt is not None and lcsc_opt in PART_OFFSETS:
(xoff, yoff) = PART_OFFSETS[lcsc_opt]
xoff, yoff = PART_OFFSETS[lcsc_opt]
rot = math.radians(float(row[rot_index]))
row[x_index] = str((float(row[x_index]) + xoff * math.cos(rot) + yoff * math.sin(rot)))
row[y_index] = str((float(row[y_index]) + xoff * math.sin(rot) - yoff * math.cos(rot)))
print(f"correct offset for row {i+1} ref {refdes}, {lcsc_opt}")
elif package in PACKAGE_OFFSETS:
(xoff, yoff) = PACKAGE_OFFSETS[package]
xoff, yoff = PACKAGE_OFFSETS[package]
rot = math.radians(float(row[rot_index]))
row[x_index] = str((float(row[x_index]) + xoff * math.cos(rot) + yoff * math.sin(rot)))
row[y_index] = str((float(row[y_index]) + xoff * math.sin(rot) - yoff * math.cos(rot)))
Expand Down
1 change: 0 additions & 1 deletion examples/resources/upgrade_pcb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# otherwise, this import fails since the root path is incorrect
from edg.electronics_model.KiCadSchematicParser import group_by_car, parse_symbol, test_cast


if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Update timestamps on a kicad_pcb file from a new netlist."
Expand Down