Skip to content

Commit

Permalink
chore: upgrade ape (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Dec 8, 2021
1 parent 4c4e090 commit 02b73fd
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Ape compiler plugin around [VVM](https://github.com/vyperlang/vvm)

## Dependencies

* [python3](https://www.python.org/downloads) version 3.6 or greater, python3-dev
* [python3](https://www.python.org/downloads) version 3.7 or greater, python3-dev

## Installation

Expand All @@ -28,7 +28,15 @@ python3 setup.py install

## Quick Usage

TODO: Describe library overview in code
In your project, make sure you have a `contracts/` directory containing Vyper files (`.vy`).

Then, while this plugin is installed, compile your contracts:

```bash
ape compile
```

The byte-code and ABI for your contracts should now exist in a `__local__.json` file in a `.build/` directory.

## Development

Expand Down
8 changes: 7 additions & 1 deletion ape_vyper/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import List, Optional, Set

import vvm # type: ignore
from ape.api.compiler import CompilerAPI
from ape.api import CompilerAPI, ConfigItem
from ape.exceptions import CompilerError
from ape.types import ABI, Bytecode, ContractType
from ape.utils import cached_property
Expand Down Expand Up @@ -44,7 +44,13 @@ def get_pragma_spec(source: str) -> Optional[NpmSpec]:
return None


class VyperConfig(ConfigItem):
pass


class VyperCompiler(CompilerAPI):
config = VyperConfig()

@property
def name(self) -> str:
return "vyper"
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
url="https://github.com/ApeWorX/ape-vyper",
include_package_data=True,
install_requires=[
"eth-ape>=0.1.0a29",
"eth-ape>=0.1.0a31",
"tqdm>=4.60.0,<5.0",
"vvm>=0.1.0,<0.2.0",
],
python_requires=">=3.6,<4",
python_requires=">=3.7,<4",
extras_require=extras_require,
py_modules=["ape_vyper"],
license="Apache-2.0",
Expand Down
3 changes: 1 addition & 2 deletions tests/contracts/failing_contracts/contract_with_error.vy
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# @version 0.2.8
# @version 0.3.1

@external
def foo1() -> bool:
hello = world
return True

3 changes: 1 addition & 2 deletions tests/contracts/passing_contracts/contract.vy
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# @version 0.2.8
# @version 0.3.1

@external
def foo1() -> bool:
return True

1 change: 0 additions & 1 deletion tests/contracts/passing_contracts/contract_no_pragma.vy
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
@external
def foo1() -> bool:
return True

0 comments on commit 02b73fd

Please sign in to comment.