Skip to content

Commit

Permalink
Merge pull request #407 from crytic/solc-select-dep
Browse files Browse the repository at this point in the history
add solc-select as required dep
  • Loading branch information
montyly authored Mar 15, 2023
2 parents 6e67990 + e86d876 commit 156f623
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
17 changes: 5 additions & 12 deletions crytic_compile/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
import logging
from typing import Optional
from solc_select.solc_select import installed_versions, install_artifacts

LOGGER = logging.getLogger("CryticCompile")

Expand Down Expand Up @@ -40,15 +41,7 @@ def look_for_installed_version(self) -> None:
Returns:
"""

# pylint: disable=import-outside-toplevel
try:
from solc_select import solc_select

if self.version not in solc_select.installed_versions():
solc_select.install_artifacts([self.version])

except ImportError:
LOGGER.info(
'solc-select is not installed.\nRun "pip install solc-select" to enable automatic switch of solc versions'
)
if self.version not in installed_versions():
# TODO: check that the solc version was installed.
# Blocked by https://github.com/crytic/solc-select/issues/143
install_artifacts([self.version])
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
version="0.3.0",
packages=find_packages(),
python_requires=">=3.8",
install_requires=["pycryptodome>=3.4.6", "cbor2"],
install_requires=["pycryptodome>=3.4.6", "cbor2", "solc-select>=v1.0.2"],
extras_require={
"dev": [
"black==22.3.0",
"pylint==2.13.4",
"mypy==0.942",
"darglint==1.8.0",
"solc-select>=v1.0.0b1",
]
},
license="AGPL-3.0",
Expand Down

0 comments on commit 156f623

Please sign in to comment.