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

Fix Python 3.12 compatibility #516

Merged
merged 3 commits into from
Jan 11, 2024
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
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-2022"]
python: ${{ (github.event_name == 'pull_request' && fromJSON('["3.8", "3.12"]')) || fromJSON('["3.8", "3.9", "3.10", "3.11", "3.12"]') }}
type: ["brownie", "buidler", "dapp", "embark", "hardhat", "solc", "truffle", "waffle", "foundry", "standard", "vyper", "solc_multi_file", "hardhat_multi_file"]
exclude:
# Currently broken, tries to pull git:// which is blocked by GH
Expand All @@ -32,6 +33,15 @@ jobs:
# Explore foundry support in windows
- os: windows-2022
type: foundry
# Deprecation alerts in vyper with newer python, which trip tests
- python: 3.12
type: vyper
# brownie does not install correctly with Python 3.12
- python: 3.12
type: brownie
# TODO: review failure executing npx on Windows
- os: windows-2022
python: 3.12
steps:
- uses: actions/checkout@v4
- name: Set up shell
Expand All @@ -43,10 +53,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18.15
- name: Set up Python 3.8
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install "solc-select>=v1.0.0b1"
Expand Down
5 changes: 2 additions & 3 deletions crytic_compile/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
This is the Slither cli script
"""
import argparse
from importlib.metadata import version
import json
import logging
import os
import sys
from typing import TYPE_CHECKING, Any, Optional

from pkg_resources import require

from crytic_compile.crytic_compile import compile_all, get_platforms
from crytic_compile.cryticparser import DEFAULTS_FLAG_IN_CONFIG, cryticparser
from crytic_compile.platform import InvalidCompilation
Expand Down Expand Up @@ -109,7 +108,7 @@ def parse_args() -> argparse.Namespace:
parser.add_argument(
"--version",
help="displays the current version",
version=require("crytic-compile")[0].version,
version=version("crytic-compile"),
action="version",
)

Expand Down