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

feat: add flag to install_vyper() for skipping validation #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
9 changes: 8 additions & 1 deletion vvm/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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
-------
Expand Down Expand Up @@ -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

Expand Down
Loading