Skip to content

Commit 3c496dd

Browse files
feat(cicd): tox github action (#3)
* feat(cicd): tox github action * chore: compile C files for source control * Update tox.yaml * chore: compile C files for source control * Update tox.yaml * chore: compile C files for source control * include mypy_extensions dep * chore: compile C files for source control * include all matrix combos * rename job * chore: compile C files for source control * fix matrix * chore: compile C files for source control --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent cc1314f commit 3c496dd

File tree

3 files changed

+151
-104
lines changed

3 files changed

+151
-104
lines changed

.github/workflows/tox.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tox
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
schedule:
9+
- cron: '0 12 * * 1-5' # Weekdays 12:00 UTC
10+
11+
jobs:
12+
test:
13+
name: Test (${{ matrix.jobtype }}, ${{ matrix.python-version}}, ${{ matrix.os }})
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, macos-latest, windows-latest]
19+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
20+
jobtype: [core, lint, wheel]
21+
env:
22+
TOXENV: py${{ matrix.python-version }}-${{ matrix.jobtype }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Upgrade pip and install tox
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install tox
35+
36+
- name: Cache tox, pip, and hypothesis
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
.tox
41+
.hypothesis
42+
~/.cache/pip
43+
~/.local
44+
key: ${{ runner.os }}-tox-${{ matrix.python-version }}-${{ matrix.jobtype }}-${{ hashFiles('setup.py', 'tox.ini') }}
45+
46+
- name: Run tox
47+
run: python -m tox run -r

build/ops.txt

Lines changed: 103 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,109 @@ L55:
788788
dec_ref r116
789789
goto L48
790790

791+
def __top_level__():
792+
r0, r1 :: object
793+
r2 :: bit
794+
r3 :: str
795+
r4, r5, r6 :: object
796+
r7 :: str
797+
r8 :: dict
798+
r9, r10 :: object
799+
r11 :: str
800+
r12 :: dict
801+
r13 :: object
802+
r14 :: str
803+
r15 :: list
804+
r16, r17 :: ptr
805+
r18 :: dict
806+
r19 :: str
807+
r20 :: i32
808+
r21 :: bit
809+
r22 :: str
810+
r23 :: dict
811+
r24 :: str
812+
r25 :: object
813+
r26 :: object[1]
814+
r27 :: object_ptr
815+
r28 :: object
816+
r29 :: str
817+
r30 :: dict
818+
r31 :: str
819+
r32 :: i32
820+
r33 :: bit
821+
r34 :: None
822+
L0:
823+
r0 = builtins :: module
824+
r1 = load_address _Py_NoneStruct
825+
r2 = r0 != r1
826+
if r2 goto L3 else goto L1 :: bool
827+
L1:
828+
r3 = 'builtins'
829+
r4 = PyImport_Import(r3)
830+
if is_error(r4) goto L12 (error at <module>:-1) else goto L2
831+
L2:
832+
builtins = r4 :: module
833+
dec_ref r4
834+
L3:
835+
r5 = ('version',)
836+
r6 = ('__version',)
837+
r7 = 'importlib.metadata'
838+
r8 = faster_hexbytes.globals :: static
839+
r9 = CPyImport_ImportFromMany(r7, r5, r6, r8)
840+
if is_error(r9) goto L12 (error at <module>:1) else goto L4
841+
L4:
842+
importlib.metadata = r9 :: module
843+
dec_ref r9
844+
r10 = ('HexBytes',)
845+
r11 = 'faster_hexbytes.main'
846+
r12 = faster_hexbytes.globals :: static
847+
r13 = CPyImport_ImportFromMany(r11, r10, r10, r12)
848+
if is_error(r13) goto L12 (error at <module>:5) else goto L5
849+
L5:
850+
faster_hexbytes.main = r13 :: module
851+
dec_ref r13
852+
r14 = 'HexBytes'
853+
r15 = PyList_New(1)
854+
if is_error(r15) goto L12 (error at <module>:9) else goto L6
855+
L6:
856+
r16 = get_element_ptr r15 ob_item :: PyListObject
857+
r17 = load_mem r16 :: ptr*
858+
inc_ref r14
859+
set_mem r17, r14 :: builtins.object*
860+
r18 = faster_hexbytes.globals :: static
861+
r19 = '__all__'
862+
r20 = CPyDict_SetItem(r18, r19, r15)
863+
dec_ref r15
864+
r21 = r20 >= 0 :: signed
865+
if not r21 goto L12 (error at <module>:9) else goto L7 :: bool
866+
L7:
867+
r22 = 'hexbytes'
868+
r23 = faster_hexbytes.globals :: static
869+
r24 = '__version'
870+
r25 = CPyDict_GetItem(r23, r24)
871+
if is_error(r25) goto L12 (error at <module>:11) else goto L8
872+
L8:
873+
r26 = [r22]
874+
r27 = load_address r26
875+
r28 = PyObject_Vectorcall(r25, r27, 1, 0)
876+
dec_ref r25
877+
if is_error(r28) goto L12 (error at <module>:11) else goto L9
878+
L9:
879+
r29 = cast(str, r28)
880+
if is_error(r29) goto L12 (error at <module>:11) else goto L10
881+
L10:
882+
r30 = faster_hexbytes.globals :: static
883+
r31 = '__version__'
884+
r32 = CPyDict_SetItem(r30, r31, r29)
885+
dec_ref r29
886+
r33 = r32 >= 0 :: signed
887+
if not r33 goto L12 (error at <module>:11) else goto L11 :: bool
888+
L11:
889+
return 1
890+
L12:
891+
r34 = <error> :: None
892+
return r34
893+
791894
def to_bytes(val):
792895
val :: union[bytes, str, object, bool, int]
793896
r0 :: bit
@@ -1361,106 +1464,3 @@ L7:
13611464
L8:
13621465
r26 = <error> :: None
13631466
return r26
1364-
1365-
def __top_level__():
1366-
r0, r1 :: object
1367-
r2 :: bit
1368-
r3 :: str
1369-
r4, r5, r6 :: object
1370-
r7 :: str
1371-
r8 :: dict
1372-
r9, r10 :: object
1373-
r11 :: str
1374-
r12 :: dict
1375-
r13 :: object
1376-
r14 :: str
1377-
r15 :: list
1378-
r16, r17 :: ptr
1379-
r18 :: dict
1380-
r19 :: str
1381-
r20 :: i32
1382-
r21 :: bit
1383-
r22 :: str
1384-
r23 :: dict
1385-
r24 :: str
1386-
r25 :: object
1387-
r26 :: object[1]
1388-
r27 :: object_ptr
1389-
r28 :: object
1390-
r29 :: str
1391-
r30 :: dict
1392-
r31 :: str
1393-
r32 :: i32
1394-
r33 :: bit
1395-
r34 :: None
1396-
L0:
1397-
r0 = builtins :: module
1398-
r1 = load_address _Py_NoneStruct
1399-
r2 = r0 != r1
1400-
if r2 goto L3 else goto L1 :: bool
1401-
L1:
1402-
r3 = 'builtins'
1403-
r4 = PyImport_Import(r3)
1404-
if is_error(r4) goto L12 (error at <module>:-1) else goto L2
1405-
L2:
1406-
builtins = r4 :: module
1407-
dec_ref r4
1408-
L3:
1409-
r5 = ('version',)
1410-
r6 = ('__version',)
1411-
r7 = 'importlib.metadata'
1412-
r8 = faster_hexbytes.globals :: static
1413-
r9 = CPyImport_ImportFromMany(r7, r5, r6, r8)
1414-
if is_error(r9) goto L12 (error at <module>:1) else goto L4
1415-
L4:
1416-
importlib.metadata = r9 :: module
1417-
dec_ref r9
1418-
r10 = ('HexBytes',)
1419-
r11 = 'faster_hexbytes.main'
1420-
r12 = faster_hexbytes.globals :: static
1421-
r13 = CPyImport_ImportFromMany(r11, r10, r10, r12)
1422-
if is_error(r13) goto L12 (error at <module>:5) else goto L5
1423-
L5:
1424-
faster_hexbytes.main = r13 :: module
1425-
dec_ref r13
1426-
r14 = 'HexBytes'
1427-
r15 = PyList_New(1)
1428-
if is_error(r15) goto L12 (error at <module>:9) else goto L6
1429-
L6:
1430-
r16 = get_element_ptr r15 ob_item :: PyListObject
1431-
r17 = load_mem r16 :: ptr*
1432-
inc_ref r14
1433-
set_mem r17, r14 :: builtins.object*
1434-
r18 = faster_hexbytes.globals :: static
1435-
r19 = '__all__'
1436-
r20 = CPyDict_SetItem(r18, r19, r15)
1437-
dec_ref r15
1438-
r21 = r20 >= 0 :: signed
1439-
if not r21 goto L12 (error at <module>:9) else goto L7 :: bool
1440-
L7:
1441-
r22 = 'hexbytes'
1442-
r23 = faster_hexbytes.globals :: static
1443-
r24 = '__version'
1444-
r25 = CPyDict_GetItem(r23, r24)
1445-
if is_error(r25) goto L12 (error at <module>:11) else goto L8
1446-
L8:
1447-
r26 = [r22]
1448-
r27 = load_address r26
1449-
r28 = PyObject_Vectorcall(r25, r27, 1, 0)
1450-
dec_ref r25
1451-
if is_error(r28) goto L12 (error at <module>:11) else goto L9
1452-
L9:
1453-
r29 = cast(str, r28)
1454-
if is_error(r29) goto L12 (error at <module>:11) else goto L10
1455-
L10:
1456-
r30 = faster_hexbytes.globals :: static
1457-
r31 = '__version__'
1458-
r32 = CPyDict_SetItem(r30, r31, r29)
1459-
dec_ref r29
1460-
r33 = r32 >= 0 :: signed
1461-
if not r33 goto L12 (error at <module>:11) else goto L11 :: bool
1462-
L11:
1463-
return 1
1464-
L12:
1465-
r34 = <error> :: None
1466-
return r34

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
author_email="[email protected]",
6262
url="https://github.com/ethereum/hexbytes",
6363
include_package_data=True,
64-
install_requires=[f"hexbytes=={version}"],
64+
install_requires=[f"hexbytes=={version}", "mypy_extensions"],
6565
python_requires=">=3.9, <4",
6666
extras_require=extras_require,
6767
py_modules=["faster_hexbytes"],

0 commit comments

Comments
 (0)