Contributing
Run the tests
You need Python 3.11 or later and uv. You don't need a wallet, an RPC endpoint or funds.
- Clone the repository.
-
Install the locked environment. This also installs hyper-vyper itself as an editable package, so Vyper and Titanoboa find
hyper_vyperwithout-p. -
Run the tests:
-
Compile an example:
Repository tests describes each kind of test.
Checks
CI runs these commands, so run them before you open a pull request.
uv sync --locked
uv run --locked hyper-vyper-check-source src examples tutorials
uv run --locked ruff check scripts tests tutorials src examples
uv run --locked ruff format --check scripts tests tutorials src examples
uv run --locked pytest
uv run --locked pytest -m packaging
npm ci --prefix tests/reference --ignore-scripts --no-audit --no-fund
uv run --locked scripts/solidity_reference.py --check
If you add a revert reason to the library, add it to the table in the API reference. A test enforces this.
If you intentionally make a function behave differently from Solidity, record the difference in compatibility.
Don't rebuild tests/reference/artifact.json only to make a failing comparison pass.
Documentation
Zensical builds the site from zensical.toml and the Markdown files in docs/.
UV_PROJECT_ENVIRONMENT=.venv-docs uv run --locked --only-group docs zensical serve
UV_PROJECT_ENVIRONMENT=.venv-docs uv run --locked --only-group docs zensical build --strict
The site is at http://127.0.0.1:8000 while serve runs.
Write Markdown with one line per paragraph, list item or table row, and never hard-wrap it. Editors and GitHub wrap it for display, and a diff then shows only the sentence that changed.
Titanoboa needs an older MkDocs version than Zensical, so you can't install the docs group and the test group together. UV_PROJECT_ENVIRONMENT=.venv-docs puts the docs group in its own environment and leaves the test environment intact.
CI deploys the site to GitHub Pages on each push to main.
Release a version
The Release workflow publishes to PyPI with trusted publishing, so the repository holds no PyPI token. Before it runs, it repeats the checks, builds the wheel and the sdist, and runs twine check on both.
- Update
versioninpyproject.tomland add the release toCHANGELOG.md. -
Run the workflow by hand from the Actions tab. This publishes the build to TestPyPI, and you can install it from there to check it:
-
Tag the release commit on
mainand push the tag. The tag must bevfollowed by the version inpyproject.toml, or the workflow stops:
PyPI doesn't let you upload the same version twice, so a mistake needs a new version number.