Skip to content

Commit 5863300

Browse files
committed
test: use our test action
1 parent 3888a98 commit 5863300

File tree

108 files changed

+1112
-2072
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1112
-2072
lines changed

.github/workflows/test.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1820

1921
- name: Setup Python
2022
uses: actions/setup-python@v5
@@ -40,6 +42,8 @@ jobs:
4042

4143
steps:
4244
- uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
4347

4448
- name: Setup Python
4549
uses: actions/setup-python@v5
@@ -85,20 +89,26 @@ jobs:
8589
with:
8690
version: 1.15.6
8791

92+
- name: Setup Ape
93+
uses: ApeWorX/github-action@v3
94+
8895
- name: Install Dependencies
8996
run: |
9097
python -m pip install --upgrade pip
9198
pip uninstall eth-ape --yes
9299
pip install .[test]
93100
101+
- name: Install Ape Dependencies
102+
run: ape pm install
103+
94104
- name: Run Functional Tests
95-
run: ape test tests/functional -m "not fuzzing" -s --cov=src --cov-append -n auto --dist loadgroup
105+
run: ape test tests/functional -m "not fuzzing" -s --cov=src --cov-append -n auto --dist loadgroup -v ERROR
96106

97107
- name: Run Integration Tests
98-
run: ape test tests/integration -m "not fuzzing" -s --cov=src --cov-append -n auto --dist loadgroup
108+
run: ape test tests/integration -m "not fuzzing" -s --cov=src --cov-append -n auto --dist loadgroup -v ERROR
99109

100110
- name: Run Performance Tests
101-
run: ape test tests/performance -s
111+
run: ape test tests/performance -s -v ERROR
102112

103113
fuzzing:
104114
runs-on: ubuntu-latest
@@ -108,6 +118,8 @@ jobs:
108118

109119
steps:
110120
- uses: actions/checkout@v4
121+
with:
122+
fetch-depth: 0
111123

112124
- name: Setup Python
113125
uses: actions/setup-python@v5

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: check-yaml
66

77
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.10.0 # Latest ruff version
8+
rev: v0.11.2 # Latest ruff version
99
hooks:
1010
- id: ruff
1111
args: [--fix, --exit-non-zero-on-fix]

docs/userguides/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ A simple example of configuring dependencies looks like this:
165165
[[tool.ape.dependencies]]
166166
name = "openzeppelin"
167167
github = "OpenZeppelin/openzeppelin-contracts"
168-
version = "4.4.2"
168+
version = "4.9.6"
169169
```
170170

171171
Or the equivalent YAML:
@@ -174,7 +174,7 @@ Or the equivalent YAML:
174174
dependencies:
175175
- name: openzeppelin
176176
github: OpenZeppelin/openzeppelin-contracts
177-
version: 4.4.2
177+
version: 4.9.6
178178
```
179179

180180
## Deployments

docs/userguides/dependencies.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ The following section highlights how to use each of them and what their differen
2424

2525
You can use dependencies from GitHub.
2626
For example, a common dependency for Solidity projects is [Open Zeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts).
27-
To use Open Zeppelin version 4.4.2 in your Ape Solidity project, add the following to your `ape-config.yaml` file:
27+
To use Open Zeppelin version 4.9.6 in your Ape Solidity project, add the following to your `ape-config.yaml` file:
2828

2929
```yaml
3030
dependencies:
3131
- name: OpenZeppelin
3232
github: OpenZeppelin/openzeppelin-contracts
33-
version: 4.4.2
33+
version: 4.9.6
3434
```
3535
3636
Then, follow the guide below about `remappings` to use the dependency.
@@ -209,7 +209,7 @@ You can also use Python to install dependencies, using `**kwargs` as the same fi
209209
from ape import project
210210

211211
project.dependencies.install(
212-
github="OpenZeppelin/openzeppelin-contracts", name="openzeppelin", version="4.4.2"
212+
github="OpenZeppelin/openzeppelin-contracts", name="openzeppelin", version="4.9.6"
213213
)
214214
```
215215

@@ -336,7 +336,7 @@ For example, if you are using dependencies like:
336336
dependencies:
337337
- name: OpenZeppelin
338338
github: OpenZeppelin/openzeppelin-contracts
339-
version: 4.4.2
339+
version: 4.9.6
340340
```
341341

342342
And your source files import from `openzeppelin` this way:

docs/userguides/testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ assert x != 0 # dev: invalid value
449449
Take for example:
450450

451451
```python
452-
# @version 0.3.7
452+
# @version 0.4.0
453453

454454
@external
455455
def check_value(_value: uint256) -> bool:
@@ -512,12 +512,12 @@ Similarly, if you require dev assertions for non-reentrant functions you must be
512512

513513
```python
514514
@internal
515-
@nonreentrant('lock')
515+
@nonreentrant
516516
def _foo_internal(): # dev: correct location
517517
pass
518518

519519
@external
520-
@nonreentrant('lock')
520+
@nonreentrant
521521
def foo():
522522
self._foo_internal() # dev: incorrect location
523523
```

pyproject.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22
requires = ["setuptools>=75.0.0", "wheel", "setuptools_scm[toml]>=5.0"]
33

44
[tool.ape]
5-
contracts_folder = "tests/functional/data/contracts/ethereum/local"
5+
name = "ape"
6+
contracts_folder = "tests/functional/data/contracts"
7+
8+
[[tool.ape.dependencies]]
9+
name = "openzeppelin"
10+
version = "4.9.6"
11+
github = "OpenZeppelin/openzeppelin-contracts"
12+
13+
[[tool.ape.dependencies]]
14+
name = "openzeppelin"
15+
version = "5.2.0"
16+
github = "OpenZeppelin/openzeppelin-contracts"
617

718
[tool.ape.test]
819
show_internal = true

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
"pytest-timeout>=2.2.0,<3", # For avoiding timing out during tests
2121
"hypothesis>=6.2.0,<7.0", # Strategy-based fuzzer
2222
"hypothesis-jsonschema==0.19.0", # JSON Schema fuzzer extension
23+
"ape-vyper>=0.8.9,<0.9", # Needed for compiling test contracts
24+
"ape-solidity>=0.8.5,<0.9", # Needed for compiling test contracts
2325
],
2426
"lint": [
25-
"ruff>=0.10.0", # Unified linter and formatter
27+
"ruff>=0.11.2", # Unified linter and formatter
2628
"mypy>=1.15.0,<1.16.0", # Static type analyzer
2729
"types-PyYAML", # Needed due to mypy typeshed
2830
"types-requests", # Needed due to mypy typeshed

src/ape/api/accounts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ def declare(self, contract: "ContractContainer", *args, **kwargs) -> ReceiptAPI:
338338
:class:`~ape.api.transactions.ReceiptAPI`: The receipt of the declare transaction.
339339
"""
340340

341+
kwargs["sender"] = self
341342
transaction = self.provider.network.ecosystem.encode_contract_blueprint(
342343
contract.contract_type, *args, **kwargs
343344
)

src/ape/api/address.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,13 @@ def codesize(self) -> int:
170170
"""
171171
The number of bytes in the smart contract.
172172
"""
173-
174173
return len(self.code)
175174

176175
@property
177176
def is_contract(self) -> bool:
178177
"""
179178
``True`` when there is code associated with the address.
180179
"""
181-
182180
return len(HexBytes(self.code)) > 0
183181

184182
@cached_property

src/ape/contracts/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ def identifier_lookup(self) -> dict[str, "ABI_W_SELECTOR_T"]:
930930
def source_path(self) -> Optional[Path]:
931931
"""
932932
Returns the path to the local contract if determined that this container
933-
belongs to the active project by cross checking source_id.
933+
belongs to the active project by cross-checking source_id.
934934
"""
935935
if not (source_id := self.contract_type.source_id):
936936
return None
@@ -1537,6 +1537,9 @@ def at(
15371537
txn_hash (Union[str, HexBytes]): The hash of the transaction that deployed the
15381538
contract, if available. Defaults to ``None``.
15391539
fetch_from_explorer (bool): Set to ``False`` to avoid fetching from an explorer.
1540+
proxy_info (:class:`~ape.api.networks.ProxyInfoAPI` | None): Proxy info object to set
1541+
to avoid detection; defaults to ``None`` which will detect it if ``detect_proxy=True``.
1542+
detect_proxy (bool): Set to ``False`` to avoid detecting missing proxy info.
15401543
15411544
Returns:
15421545
:class:`~ape.contracts.ContractInstance`

src/ape/managers/chain.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,6 @@ def gas_price(self) -> int:
768768
"""
769769
The price for what it costs to transact.
770770
"""
771-
772771
return self.provider.gas_price
773772

774773
@property

src/ape/managers/compilers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def compile(
155155

156156
yield contract
157157

158-
except CompilerError as err:
158+
except Exception as err:
159159
# One of the compilers failed. Show the error but carry on.
160160
logger.log_debug_stack_trace()
161161
errors.append(err)

src/ape/managers/converters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def get_converter(self, name: str) -> ConverterAPI:
425425

426426
def convert_method_args(
427427
self,
428-
abi: Union["MethodABI", "ConstructorABI", "EventABI"],
428+
abi: Union["MethodABI", "ConstructorABI", "EventABI", "ConstructorABI"],
429429
arguments: Sequence[Any],
430430
):
431431
input_types = [i.canonical_type for i in abi.inputs]

0 commit comments

Comments
 (0)