diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index bb6bd161..7d3059db 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -19,10 +19,10 @@ jobs: - name: Checkout Code uses: actions/checkout@v2 - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: 3.8 - name: Install dependencies run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a82eeee7..8722a81f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,10 +48,10 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ steps.node.outputs.version }} - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v3 with: - python-version: 3.6 + python-version: 3.8 - name: Install dependencies run: | pip install "solc-select>=v1.0.0b1" diff --git a/.github/workflows/darglint.yml b/.github/workflows/darglint.yml index 31443112..36a2fbed 100644 --- a/.github/workflows/darglint.yml +++ b/.github/workflows/darglint.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v1 with: - python-version: 3.6 + python-version: 3.8 - name: Run Tests run: | bash scripts/ci_darglint.sh diff --git a/.github/workflows/etherscan.yml b/.github/workflows/etherscan.yml index bd5d88d0..a65b5754 100644 --- a/.github/workflows/etherscan.yml +++ b/.github/workflows/etherscan.yml @@ -26,10 +26,10 @@ jobs: run: | echo 'C:\msys64\mingw64\bin' >> "$GITHUB_PATH" echo 'C:\msys64\usr\bin' >> "$GITHUB_PATH" - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v3 with: - python-version: 3.6 + python-version: 3.8 - name: Install dependencies run: | pip install "solc-select>=v1.0.0b1" diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 6109eac7..2fc65a16 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -19,10 +19,10 @@ jobs: - name: Checkout Code uses: actions/checkout@v2 - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: 3.8 - name: Install dependencies run: | diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index d271f756..32ee3bd2 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -19,10 +19,10 @@ jobs: - name: Checkout Code uses: actions/checkout@v2 - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: 3.8 - name: Install dependencies run: | diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 6b4437e1..f4028291 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -19,10 +19,10 @@ jobs: - name: Checkout Code uses: actions/checkout@v2 - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: 3.8 - name: Install dependencies run: | diff --git a/crytic_compile/platform/brownie.py b/crytic_compile/platform/brownie.py index e1992ff8..b779299b 100755 --- a/crytic_compile/platform/brownie.py +++ b/crytic_compile/platform/brownie.py @@ -206,8 +206,9 @@ def _get_version(compiler: Dict) -> str: str: Compiler version """ version = compiler.get("version", "") - version = version[len("Version: ") :] - version = version[0 : version.find("+")] + if "Version:" in version: + version = version.split("Version:")[1].strip() + version = version[0 : version.find("+")] # TODO handle not "+" not found return version diff --git a/crytic_compile/platform/solc_standard_json.py b/crytic_compile/platform/solc_standard_json.py index 6c24320e..c5380130 100644 --- a/crytic_compile/platform/solc_standard_json.py +++ b/crytic_compile/platform/solc_standard_json.py @@ -4,6 +4,7 @@ import json import logging import os +from pathlib import Path import shutil import subprocess from typing import TYPE_CHECKING, Dict, List, Optional, Union, Any @@ -132,7 +133,8 @@ def run_solc_standard_json( Returns: Dict: Solc json output """ - cmd = [compiler_version.compiler, "--standard-json", "--allow-paths", "."] + working_dir_resolved = Path(working_dir if working_dir else ".").resolve() + cmd = [compiler_version.compiler, "--standard-json", "--allow-paths", str(working_dir_resolved)] additional_kwargs: Dict = {"cwd": working_dir} if working_dir else {} env = dict(os.environ) diff --git a/pyproject.toml b/pyproject.toml index f7d303d2..89638915 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] -target-version = ["py36"] +target-version = ["py38"] line-length = 100 [tool.pylint.messages_control] disable = """ diff --git a/scripts/ci_test_dapp.sh b/scripts/ci_test_dapp.sh index 986605d5..f481a88c 100755 --- a/scripts/ci_test_dapp.sh +++ b/scripts/ci_test_dapp.sh @@ -2,6 +2,11 @@ ### Test dapp integration +# work around having two python versions loading libraries from each other in CI +OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" +alias crytic-compile='LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH crytic-compile' +unset LD_LIBRARY_PATH + DIR=$(mktemp -d) cd "$DIR" || exit 255 diff --git a/setup.py b/setup.py index e7e45a9b..68af0e41 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ author="Trail of Bits", version="0.2.4", packages=find_packages(), - python_requires=">=3.6", + python_requires=">=3.8", install_requires=["pysha3>=1.0.2", "cbor2"], license="AGPL-3.0", long_description=long_description,