Elf-simulations is currently supported only for Python 3.10.
Follow Pyenv install instructions.
Clone the repo into a <repo_location> of your choice.
git clone https://github.com/delvtech/elf-simulations.git <repo_location>
Here we use venv which is part of the built-in standard Python library. You can use another virtual environment package if you prefer, like pyenv-virtualenv.
cd <repo_location>
pyenv install 3.10
pyenv local 3.10
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install --upgrade -e ".[with-dependencies]"
The dependencies includes postgresql, which is required to work with files in elfpy/data
.
If you intend to improve the documentation, then you must also install the packages:
python -m pip install --upgrade -e ".[with-dependencies,docs]"
An explanation of what the above steps do:
pyenv install 3.10
You should now see the correct version when you runpyenv versions
.pyenv local 3.10
This command creates a.python-version
file in your current directory. If you have pyenv active in your environment, this file will automatically activate this version for you.python -m venv .venv
This will create a.venv
folder in your repo directory that stores the local python build & packages. After this command you should be able to type which python and see that it points to an executable inside.venv/
.python -m pip install --upgrade -e ".[with-dependencies]"
This installs elfpy locally such that the install updates automatically any time you change the source code. This also installs all dependencies defined inpyproject.toml
.
We run several tests and offer utilities that depend on executing Hyperdrive solidity contracts. This is not required to use elfpy.
NOTE: The Hyperdrive solidity implementation is currently under security review, and thus is not available publicly. The following instructions will not work for anyone who is not a member of Delv.
Clone the hyperdrive repo, then create a sym link at hyperdrive_solidity/
pointing to the repo location.
git clone https://github.com/delvtech/hyperdrive.git ../hyperdrive
ln -s ../hyperdrive hyperdrive_solidity
Complete the steps in Hyperdrive's Pre-requisites section.
Install Ape plugins with python -m pip install --upgrade -e ".[ape]"
You can test that everything is working by calling: python -m pytest .
You can test against a local testnet node using Anvil with anvil
.
We use Docker for building images.
NOTE: pip
might complain about dependency incompatibility between eth-ape and some plugins. This discrepancy comes from apeworx, although our examples should run without dealing with the incompatibility.