Skip to content

Commit

Permalink
Merge pull request #11 from NethermindEth/master
Browse files Browse the repository at this point in the history
Version 0.1.0
  • Loading branch information
elicbarbieri authored Aug 29, 2024
2 parents 57237dd + 8668f60 commit e409438
Show file tree
Hide file tree
Showing 175 changed files with 16,096 additions and 8,309 deletions.
46 changes: 41 additions & 5 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Load Cached Poetry
id: cached-poetry
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry config virtualenvs.in-project true
poetry install --no-interaction --all-extras
poetry install --no-interaction --with docs --with evm --with dev
lint:
runs-on: ubuntu-latest
Expand All @@ -53,7 +53,7 @@ jobs:
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Load Cached Virtualenv
id: cached-poetry-dependencies
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Load Cached Virtualenv
id: cached-poetry-dependencies
Expand All @@ -108,6 +108,42 @@ jobs:
- name: Run Uniswap V3 Tests
run: poetry run pytest -v tests/uniswap_v3

test-backfill:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Load Cached Virtualenv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Load Cached Poetry
id: cached-poetry
uses: actions/cache@v3
with:
path: /home/runner/.local
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}

- name: Add Cached Poetry to PATH
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH

- name: Run Backfill Logic Tests
run: poetry run pytest -v tests/backfill

- name: Run ABI Decoding Tests
run: poetry run pytest -v tests/abi_decoding

validate-docs:
runs-on: ubuntu-latest
needs: build
Expand All @@ -119,7 +155,7 @@ jobs:
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Load Cached Virtualenv
id: cached-poetry-dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Load Cached Poetry
id: cached-poetry
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ __pycache__

# environments
env/

pyrevm/

# Documentation:
docs/build/
_autosummary/
_build/
html/
html/

# Dist Files
dist/
14 changes: 10 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: 23.3.0
rev: 24.8.0
hooks:
- id: black
language_version: python3.10
Expand All @@ -15,12 +15,18 @@ repos:
hooks:
- id: pylint
name: pylint
entry: poetry run pylint
args: ['--rcfile=pyproject.toml', --disable=redefined-builtin]
entry: poetry run pylint nethermind/entro
args: [
'-rn',
'-sn',
'--rcfile=pyproject.toml',
'--disable=redefined-builtin',
]
language: system
types: [python]
require_serial: true
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.11.2
hooks:
- id: 'mypy'
additional_dependencies:
Expand Down
412 changes: 408 additions & 4 deletions README.md

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions docs/source/Exceptions.rst

This file was deleted.

27 changes: 16 additions & 11 deletions docs/source/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ improvements over ganache, or any other EVM implementations.
The evm instance is used during testing & development, and is not required for normal usage of the library. To
enable this functionality, pass the option exact_math=True to the PoolFactory object.

.. code-block:: console
.. code-block:: shell
$ git clone https://github.com/nethermindETH/python-eth-amm.git
$ cd python-eth-amm
$ git clone https://github.com/elicbarbieri/pyrevm.git # temporary until official pyrevm supports result decoding
$ poetry env use python3.10
$ git clone https://github.com/nethermindETH/entro.git
$ cd entro
$ poetry env use python3.12
$ poetry install --all-extras
$ poetry run pytest
$ maturin develop --release pyrevm/
Development Guide
Expand All @@ -52,7 +50,7 @@ Installing & Manually Running Pre-Commit
Linting & Pre-commits
^^^^^^^^^^^^^^^^^^^^^

.. code-block:: console
.. code-block:: shell
$ poetry run pre-commit install
$ poetry run pre-commit run --all-files
Expand All @@ -61,15 +59,22 @@ Test Environment
^^^^^^^^^^^^^^^^

.. code-block::
:caption: tests/.env
:caption: integration_tests/.env
SQLALCHEMY_DB_URI='postgresql://user:pass@host:5432/db_name'
ARCHIVE_NODE_RPC_URL='http://node_ip:8545'
# PG_* env vars are used to create the database docker-container for testing
PG_PASS=secret
PG_PORT=5432 # Offset to 5430 to avoid conflicts with local postgres
ETH_JSON_RPC=http://localhost:8545
ETH_ARCHIVE_JSON_RPC=http://...
ETHERSCAN_API_KEY=
STARKNET_JSON_RPC=https://free-rpc.nethermind.io/mainnet-juno/
Running Tests
^^^^^^^^^^^^^

.. code-block:: console
.. code-block:: shell
$ poetry run pytest tests/
Expand Down
6 changes: 0 additions & 6 deletions docs/source/PoolFactory.rst

This file was deleted.

Loading

0 comments on commit e409438

Please sign in to comment.