Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Python 3.8 and 3.10 in CI #2398

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
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
24 changes: 17 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ jobs:
# needs to run only on pull_request
lint:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.8', '3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: ${{ matrix.python }}
- name: Lint
if: github.event_name == 'pull_request'
env:
Expand All @@ -42,13 +45,14 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.8', '3.10']
type: ["ethereum_truffle", "ethereum_bench", "examples", "ethereum", "ethereum_vm", "native", "wasm", "wasm_sym", "other"]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: ${{ matrix.python }}
- name: Install NPM
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -118,12 +122,15 @@ jobs:

manticore-server:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.8', '3.10']
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: ${{ matrix.python }}

- name: 'Install tools'
run: |
Expand Down Expand Up @@ -159,12 +166,15 @@ jobs:
runs-on: ubuntu-20.04
if: github.event_name == 'schedule'
needs: tests
strategy:
matrix:
python: ['3.8', '3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: ${{ matrix.python }}
- name: Build Dist
run: |
python3 -m pip install wheel
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
type: ["ethereum_truffle", "ethereum_bench", "examples", "ethereum", "ethereum_vm", "native", "wasm", "wasm_sym", "other"]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
- name: Install NPM
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -64,10 +64,10 @@ jobs:
needs: tests
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
- name: Build Dist
run: |
python3 -m pip install wheel
Expand Down
4 changes: 2 additions & 2 deletions manticore/wasm/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
from ..utils.event import Eventful
from ..utils import config

from wasm import decode_module, Section
from wasm.wasmtypes import (
from wasm_tob import decode_module, Section
from wasm_tob.wasmtypes import (
SEC_TYPE,
SEC_IMPORT,
SEC_FUNCTION,
Expand Down
2 changes: 1 addition & 1 deletion manticore/wasm/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dataclasses import dataclass
from ..core.smtlib import issymbolic, BitVec
from ctypes import *
import wasm
import wasm_tob as wasm
import struct
from ..core.state import Concretize

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def rtd_dependent_deps():
author="Trail of Bits",
version=version,
packages=find_packages(exclude=["tests", "tests.*"]),
python_requires=">=3.7",
python_requires="<3.11,>=3.7",
install_requires=[
"pyyaml",
"protobuf~=3.20",
Expand All @@ -75,8 +75,8 @@ def rtd_dependent_deps():
"ply",
"rlp",
"intervaltree",
"crytic-compile>=0.2.2",
"wasm",
"crytic-compile<0.3,>=0.2.2",
"wasm-tob~=1.0",
"dataclasses; python_version < '3.7'",
"pyevmasm>=0.2.3",
]
Expand Down
2 changes: 1 addition & 1 deletion tests/other/test_smtlibv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ def check(ty: Type, pickle_size=None, sizeof=None, **kwargs):
not hasattr(x, "__dict__"),
)
"""
self.assertEqual(len(pickle_dumps(x)), pickle_size)
if sys.version_info[1] == 6: # Python 3.6
self.assertEqual(sys.getsizeof(x), sizeof)
elif sys.version_info[1] == 7: # Python 3.7
self.assertEqual(len(pickle_dumps(x)), pickle_size)
self.assertEqual(sys.getsizeof(x), sizeof + 8)
elif sys.version_info[1] >= 8: # Python 3.8+
self.assertEqual(sys.getsizeof(x), sizeof - 8)
Expand Down
Loading