-
Notifications
You must be signed in to change notification settings - Fork 348
feat(tox): Implement eest environments #1408
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
base: forks/osaka
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[mypy] | ||
disable_error_code = import-untyped | ||
mypy_path = src, $MYPY_CONFIG_FILE_DIR/stubs | ||
plugins = pydantic.mypy |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
line-length = 99 | ||
|
||
[lint] | ||
select = ["E", "F", "B", "W", "I", "A", "N", "D", "C"] | ||
fixable = ["I", "B", "E", "F", "W", "D", "C"] | ||
ignore = ["D205", "D203", "D212", "D415", "C901", "A005", "C420"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
console_output_style = count | ||
minversion = 7.0 | ||
python_files = *.py | ||
testpaths = tests/ | ||
testpaths = tests/eest/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and many other of these changes are not required for tox, right? This is a task to be added to the Switch (similar to the line-length change), to avoid editing these sub-trees in EELS before the Switch? That means that this command will be broken in EELS until the Switch and standalone uvx commands from EELS won't work, but that's ok, I think. By standalone, I mean things like |
||
markers = | ||
slow | ||
pre_alloc_modify | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
console_output_style = count | ||
minversion = 7.0 | ||
python_files = *.py | ||
testpaths = tests/ | ||
testpaths = tests/eest/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could avoid this until the Switch by using |
||
markers = | ||
slow | ||
pre_alloc_modify | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from typing import Any, Callable | ||
|
||
class Memory: | ||
def __init__(self, location: str, verbose: int = ...) -> None: ... | ||
def cache(self, func: Callable[..., Any]) -> Callable[..., Any]: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .encode import encode | ||
|
||
__all__ = ("encode",) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from typing import Any, Dict | ||
|
||
def encode(payload: Dict[Any, Any], key: bytes, algorithm: str) -> str: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .hexary import HexaryTrie as HexaryTrie | ||
|
||
__all__ = ("HexaryTrie",) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from typing import Dict | ||
|
||
class HexaryTrie: | ||
db: Dict | ||
root_hash: bytes | ||
|
||
def __init__(self, db: Dict) -> None: ... | ||
def set(self, key: bytes, value: bytes) -> None: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .methods import is_xdist_worker | ||
|
||
__all__ = ("is_xdist_worker",) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import pytest | ||
|
||
def is_xdist_worker(session: pytest.Session) -> bool: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
min_version = 4.0 | ||
requires = | ||
tox-uv >=0.2.0 | ||
envlist = py3,pypy3,json_infra,static | ||
envlist = py3,pypy3,json_infra,static,eest-lint,eest-typecheck,eest-pytest,eest-tests-deployed,eest-tests-deployed-benchmark,eest-tests-develop | ||
|
||
[testenv] | ||
package = uv | ||
|
@@ -90,3 +90,82 @@ extras = doc | |
commands = | ||
docc --output "{toxworkdir}/docs" | ||
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs" / "index.html"))' | ||
|
||
|
||
[eest] | ||
runner = uv-venv-lock-runner | ||
package = editable | ||
wheel_build_env = .pkg | ||
python_source_dirs = src/ethereum_spec_tests tests/eest # .github/scripts | ||
ruff_config = ruff.eest.toml | ||
mypy_config = mypy.eest.ini | ||
|
||
[testenv:eest-lint] | ||
runner = {[eest]runner} | ||
package = {[eest]package} | ||
wheel_build_env = {[eest]wheel_build_env} | ||
description = Lint and code formatting checks (ruff) | ||
extras = lint | ||
commands = | ||
ruff check --config {[eest]ruff_config} --no-fix --show-fixes {[eest]python_source_dirs} | ||
ruff format --config {[eest]ruff_config} --check {[eest]python_source_dirs} | ||
|
||
[testenv:eest-typecheck] | ||
runner = {[eest]runner} | ||
package = {[eest]package} | ||
wheel_build_env = {[eest]wheel_build_env} | ||
description = Run type checking (mypy) | ||
extras = test,fill,lint | ||
commands = mypy --config-file {[eest]mypy_config} {[eest]python_source_dirs} | ||
|
||
|
||
[testenv:eest-pytest] | ||
runner = {[eest]runner} | ||
package = {[eest]package} | ||
wheel_build_env = {[eest]wheel_build_env} | ||
description = Run library and framework unit tests (pytest) | ||
setenv = | ||
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI) | ||
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:} | ||
CI = {env:CI:} | ||
extras = | ||
test | ||
fill | ||
lint # Required `gentest` for formatting tests | ||
commands = | ||
pytest -n auto ./src/ethereum_spec_tests | ||
|
||
|
||
[forks] | ||
develop = Osaka | ||
eip7692 = EOFv1 | ||
|
||
[testenv:eest-tests-deployed] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we'll need this environment post-Weld. We fill until the fork that the EELS branch points to and this will typically be a develop branch, so we fill until there. |
||
runner = {[eest]runner} | ||
package = {[eest]package} | ||
wheel_build_env = {[eest]wheel_build_env} | ||
description = Fill test cases in ./tests/ for deployed mainnet forks, except for slow/benchmark tests. | ||
extras = test,fill | ||
setenv = | ||
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI) | ||
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:} | ||
commands = ethereum-spec-fill -n auto -m "not slow" --output=/tmp/fixtures-tox --clean | ||
|
||
[testenv:eest-tests-deployed-benchmark] | ||
runner = {[eest]runner} | ||
package = {[eest]package} | ||
wheel_build_env = {[eest]wheel_build_env} | ||
description = Fill benchmarking test cases in ./tests/ for deployed mainnet forks, using evmone-t8n. | ||
extras = test,fill | ||
commands = ethereum-spec-fill -n auto -m "benchmark" --gas-benchmark-values 5 --output=/tmp/fixtures-tox --clean --evm-bin=evmone-t8n | ||
|
||
[testenv:eest-tests-develop] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This essentially duplicates the existing EELS |
||
runner = {[eest]runner} | ||
package = {[eest]package} | ||
wheel_build_env = {[eest]wheel_build_env} | ||
description = Fill test cases in ./tests/ for deployed and development mainnet forks | ||
setenv = | ||
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI) | ||
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:} | ||
Comment on lines
+167
to
+169
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope we don't need the resolver here 😄 but perhaps I don't understand your intention of adding this here? |
||
extras = test,fill | ||
commands = ethereum-spec-fill -n auto --until={[forks]develop} -k "not slow" --output=/tmp/fixtures-tox --clean |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added EEST's entrypoints here:
ethereum-spec-fill
->fill
#1400There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was mainly to provoke a discussion though, so that everyone knows what we're getting into :)