Skip to content

Commit 4278221

Browse files
authored
Update test Python versions, reblacken (#447)
Bump latest to Python3.13, and bumps 3.9 to 3.10 as 3.9 is no longer available. Reblacken, it appears the default style has changed. Also cleans up YAML formatting and updates actions versions
1 parent 62c42e5 commit 4278221

19 files changed

Lines changed: 79 additions & 91 deletions

.github/workflows/pr-python.yml

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,63 +18,63 @@ jobs:
1818
outputs:
1919
should_skip: ${{ steps.skip_check.outputs.should_skip }}
2020
steps:
21-
- id: skip_check
22-
uses: fkirc/skip-duplicate-actions@master
23-
with:
24-
paths: '[
25-
"compiler/**",
26-
"edg_core/**",
27-
"electronics_model/**",
28-
"electronics_abstract_parts/**",
29-
"electronics_lib/**",
30-
"edg/**",
31-
"examples/**.py"
32-
]'
21+
- id: skip_check
22+
uses: fkirc/skip-duplicate-actions@master
23+
with:
24+
paths: '[
25+
"compiler/**",
26+
"edg_core/**",
27+
"electronics_model/**",
28+
"electronics_abstract_parts/**",
29+
"electronics_lib/**",
30+
"edg/**",
31+
"examples/**.py"
32+
]'
3333

34-
black_latest_3_11:
34+
black_latest_3_13:
3535
needs: pre_job
3636
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
3737
runs-on: ubuntu-latest
3838
steps:
39-
- uses: actions/checkout@v1
40-
- uses: actions/setup-python@v1
39+
- uses: actions/checkout@v6
40+
- uses: actions/setup-python@v6
4141
with:
42-
python-version: '3.11'
42+
python-version: '3.13'
4343

44-
- name: install mypy
44+
- name: install black
4545
run: |
4646
pip install -r requirements.txt
4747
pip install black
4848
- name: black
4949
run: black --check .
5050

51-
mypy_latest_3_11:
51+
mypy_latest_3_13:
5252
needs: pre_job
5353
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
5454
runs-on: ubuntu-latest
5555
steps:
56-
- uses: actions/checkout@v1
57-
- uses: actions/setup-python@v1
58-
with:
59-
python-version: '3.11'
56+
- uses: actions/checkout@v6
57+
- uses: actions/setup-python@v6
58+
with:
59+
python-version: '3.13'
6060

61-
- name: install mypy
62-
run: |
63-
pip install -r requirements.txt
64-
pip install mypy mypy-protobuf
65-
mypy --version
66-
- name: mypy
67-
run: mypy --install-types .
61+
- name: install mypy
62+
run: |
63+
pip install -r requirements.txt
64+
pip install mypy mypy-protobuf
65+
mypy --version
66+
- name: mypy
67+
run: mypy --install-types .
6868

69-
packagetest_latest_3_11:
69+
packagetest_latest_3_13:
7070
needs: pre_job
7171
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
7272
runs-on: ubuntu-latest
7373
steps:
74-
- uses: actions/checkout@v1
75-
- uses: actions/setup-python@v1
74+
- uses: actions/checkout@v6
75+
- uses: actions/setup-python@v6
7676
with:
77-
python-version: '3.11'
77+
python-version: '3.13'
7878

7979
- name: install dependencies
8080
run: pip install -r requirements.txt
@@ -85,30 +85,30 @@ jobs:
8585
- name: toptest
8686
run: cd examples && python test_blinky.py
8787

88-
unittest_latest_3_11:
88+
unittest_latest_3_13:
8989
needs: pre_job
9090
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
9191
runs-on: ubuntu-latest
9292
steps:
93-
- uses: actions/checkout@v1
94-
- uses: actions/setup-python@v1
95-
with:
96-
python-version: '3.11'
93+
- uses: actions/checkout@v6
94+
- uses: actions/setup-python@v6
95+
with:
96+
python-version: '3.13'
9797

98-
- name: install dependencies
99-
run: pip install -r requirements.txt
100-
- name: unittest
101-
run: python -m unittest discover
98+
- name: install dependencies
99+
run: pip install -r requirements.txt
100+
- name: unittest
101+
run: python -m unittest discover
102102

103-
unittest_latest_3_9:
103+
unittest_latest_3_10:
104104
needs: pre_job
105105
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
106106
runs-on: ubuntu-latest
107107
steps:
108-
- uses: actions/checkout@v1
109-
- uses: actions/setup-python@v1
108+
- uses: actions/checkout@v6
109+
- uses: actions/setup-python@v6
110110
with:
111-
python-version: '3.9'
111+
python-version: '3.10'
112112

113113
- name: install dependencies
114114
run: pip install -r requirements.txt

.github/workflows/pr-scala.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,37 @@ jobs:
1717
outputs:
1818
should_skip: ${{ steps.skip_check.outputs.should_skip }}
1919
steps:
20-
- id: skip_check
21-
uses: fkirc/skip-duplicate-actions@master
22-
with:
23-
paths: '["compiler/**"]'
20+
- id: skip_check
21+
uses: fkirc/skip-duplicate-actions@master
22+
with:
23+
paths: '["compiler/**"]'
2424

2525
sbt:
2626
needs: pre_job
2727
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v1
31-
- name: Setup JDK
32-
uses: actions/setup-java@v2
33-
with:
34-
distribution: temurin
35-
java-version: 17
36-
- uses: actions/setup-python@v1
37-
with:
38-
python-version: '3.10'
39-
- name: Setup sbt launcher
40-
uses: sbt/setup-sbt@v1
41-
- name: install dependencies
42-
run: pip install -r requirements.txt
43-
- name: sbt test
44-
run: cd compiler && sbt -v +test
30+
- uses: actions/checkout@v6
31+
- name: Setup JDK
32+
uses: actions/setup-java@v5
33+
with:
34+
distribution: temurin
35+
java-version: 17
36+
- uses: actions/setup-python@v6
37+
with:
38+
python-version: '3.13'
39+
- name: Setup sbt launcher
40+
uses: sbt/setup-sbt@v1
41+
- name: install dependencies
42+
run: pip install -r requirements.txt
43+
- name: sbt test
44+
run: cd compiler && sbt -v +test
4545

4646
scalafmt-lint:
4747
runs-on: ubuntu-latest
4848
steps:
49-
- uses: actions/checkout@v3
50-
- name: Checking the code with scalafmt
51-
uses: AvaPL/scalafmt-native-formatter@v0
52-
with:
53-
conf-path: compiler/.scalafmt.conf
49+
- uses: actions/checkout@v6
50+
- name: Checking the code with scalafmt
51+
uses: AvaPL/scalafmt-native-formatter@v0
52+
with:
53+
conf-path: compiler/.scalafmt.conf

edg/BoardCompiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
def compile_board(design: Type[Block], target_dir_name: Optional[Tuple[str, str]]) -> CompiledDesign:
1414
if target_dir_name is not None:
15-
(target_dir, target_name) = target_dir_name
15+
target_dir, target_name = target_dir_name
1616
if not os.path.exists(target_dir):
1717
os.makedirs(target_dir)
1818
assert os.path.isdir(target_dir), f"target_dir {target_dir} to compile_board must be directory"

edg/abstract_parts/AbstractLed.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from .PartsTablePart import PartsTableSelector
1010
from .StandardFootprint import StandardFootprint, HasStandardFootprint
1111

12-
1312
LedColor = str # type alias
1413
LedColorLike = StringLike # type alias
1514

edg/abstract_parts/ESeriesUtil.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from ..electronics_model import *
88

9-
109
SeriesDefaultType = TypeVar("SeriesDefaultType")
1110

1211

edg/abstract_parts/PassiveConnector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ def generate(self) -> None:
6060
# TODO ideally this is require, but we don't support set ops in the IR
6161
assert length in self.allowed_pins, f"requested length {length} outside allowed length {self.allowed_pins}"
6262

63-
(footprint, mfr, part) = self.part_footprint_mfr_name(length)
63+
footprint, mfr, part = self.part_footprint_mfr_name(length)
6464
self.footprint("J", footprint, {pin_name: pin_port for (pin_name, pin_port) in self.pins.items()}, mfr, part)

edg/abstract_parts/StandardFootprint.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from ..electronics_model import *
55

6-
76
StandardPinningType = TypeVar("StandardPinningType", bound=Block)
87
PinningFunction = Callable[[StandardPinningType], Dict[str, CircuitPort]]
98

edg/core/Blocks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def add_ports(self, ports: Iterable[BasePort]) -> None:
106106
elif len(self.ports) == 2:
107107
is_export = self._is_export()
108108
if is_export:
109-
(ext_port, int_port) = is_export
109+
ext_port, int_port = is_export
110110
initializers = ext_port._get_initializers([])
111111
if initializers:
112112
raise UnconnectableError(
@@ -198,7 +198,7 @@ def make_connection(self) -> Optional[Union[ConnectedLink, Export]]:
198198

199199
is_export = self._is_export()
200200
if is_export:
201-
(ext_port, int_port) = is_export
201+
ext_port, int_port = is_export
202202
return Connection.Export(isinstance(ext_port, BaseVector), ext_port, int_port)
203203

204204
bridged_connects: List[Tuple[BasePort, edgir.LocalPath]] = []

edg/core/BufferSerializer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import google.protobuf as protobuf
44
import struct
55

6-
76
MessageType = TypeVar("MessageType", bound=protobuf.message.Message)
87
kHeaderMagicByte = b"\xfe"
98

edg/core/Core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from .IdentityDict import IdentityDict
1111
from .IdentitySet import IdentitySet
1212

13-
1413
ElementType = TypeVar("ElementType")
1514

1615

0 commit comments

Comments
 (0)