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

add solc-select as required dep #407

Merged
merged 1 commit into from
Mar 15, 2023
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
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