The current required Python version is 3.10.
Poetry is a tool for dependency management and packaging for Python. It creates a lockfile to guarantee reproducible installs and distribution. Please browse through poetry usage if you are not familiar with it yet.
Please install it using the official installer. For macOS users,
brew installmay not install poetry correctly.
curl -sSL https://install.python-poetry.org | python3 -`
Poetry automatically creates new venv for packages with
pyproject.toml. (optional) VS Code users might find it useful to set
poetry config virtualenvs.in-project true. This makes it easier to manage the Python interpreter.
To ensure code consistency we have CI to check code style. We use
pylintwith some customization. You can run the CI check with
To automatically fix issues, run
In this project, all code are fully typed in order to ensure the reliability and maintainability of our codebase.
Using Type Hints and Pydantic in our project allows us to improve the quality and reliability of our code. Type hints provide a way to specify the expected data types for function arguments and return values, which can help catch errors at runtime and improve code readability. Pydantic adds additional features on top of type hints, such as automatic data validation and data conversion, which can help prevent errors and ensure that our code is working with consistent, correct data.
mypyas part of the
lintcommand to type check the code.
Addresses from transactions or smart contracts will be normalized to all lowercase internally. This makes it easier to query and aggregate across multiple data sources. Just make sure to
.lower()API inputs when comparing input addresses.
To run the whole test suite:
To run a single test:
poetry run python3 -m pytest <test_file.py[::describe_test_func[::it_does_abc]]>
You may need to set specific environment variables in order to run tests for some of the adapters. The required env vars can be found in the respective directory of the adapter. You can either provide the value of the env vars by adding a file called
dotenvdirectory (we have provided a file called
example.envfor your reference), or specify them directly as part of the command that runs the tests.
- Please create pull requests early to start the conversation about the changes.
- The pull request title should summarize the contribution. Prefix with [WIP] if the PR is still a work in progress.
- All new code should have an extensive suite of tests with necessary fixtures included. All CI tests need to pass before merging.