diff --git a/README.md b/README.md index acf7e82..791885a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,32 @@ cd vvm python3 setup.py install ``` +## Quickstart + +Use `vvm` to install versions of Vyper: + +```python +from vvm import install_vyper + +install_vyper(version="0.4.0") +``` + +**Note**: On macOS with the Apple chips, installing some versions of Vyper may fail if you have not first run this +command: + +```python +softwareupdate --install-rosetta +``` + +To install Vyper without validating the binary (which is useful in the case where you did first run the command above +but will later or are managing versions of Vyper without running them), you can set `skip_validation=False`. + +```python +from vvm import install_vyper + +install_vyper(version="0.4.0", validate=False) +``` + ## Testing `vvm` is tested on Linux, OSX and Windows with Vyper versions `>=0.1.0-beta.16`. diff --git a/vvm/install.py b/vvm/install.py index a311021..95a9fd0 100644 --- a/vvm/install.py +++ b/vvm/install.py @@ -222,6 +222,7 @@ def install_vyper( show_progress: bool = False, vvm_binary_path: Union[Path, str] = None, headers: Dict = None, + validate: bool = True, ) -> Version: """ Download and install a precompiled version of `vyper`. @@ -235,6 +236,11 @@ def install_vyper( the `tqdm` package. vvm_binary_path : Path | str, optional User-defined path, used to override the default installation directory. + validate : bool + Set to False to skip validating the downloaded binary. Defaults to True. + Useful for when debugging why a binary fails to run on your OS (may need + additional setup) or if managing binaries without needing to run them + (such as a mirror). Returns ------- @@ -276,7 +282,8 @@ def install_vyper( if os_name != "windows": install_path.chmod(install_path.stat().st_mode | stat.S_IEXEC) - _validate_installation(version, vvm_binary_path) + if validate: + _validate_installation(version, vvm_binary_path) return version