mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-24 01:20:56 +00:00
fix pyspec setup, and update usages: py_tests and in docs
This commit is contained in:
parent
3f6d6535ad
commit
05970c9383
@ -13,9 +13,10 @@ From within the py_tests folder:
|
||||
Install dependencies:
|
||||
```bash
|
||||
python3 -m venv venv
|
||||
. py_tests/venv/bin/activate
|
||||
. venv/bin/activate
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
Note: make sure to run `make pyspec` from the root of the specs repository, to build the pyspec requirement.
|
||||
|
||||
Run the tests:
|
||||
```
|
||||
|
@ -11,7 +11,7 @@ from eth2.phase0.spec import (
|
||||
process_attestation,
|
||||
slot_to_epoch,
|
||||
)
|
||||
from ..helpers import (
|
||||
from phase0.helpers import (
|
||||
build_empty_block_for_next_slot,
|
||||
get_valid_attestation,
|
||||
)
|
||||
|
@ -8,7 +8,7 @@ from eth2.phase0.spec import (
|
||||
advance_slot,
|
||||
process_block_header,
|
||||
)
|
||||
from ..helpers import (
|
||||
from phase0.helpers import (
|
||||
build_empty_block_for_next_slot,
|
||||
)
|
||||
|
||||
|
@ -8,7 +8,7 @@ from eth2.phase0.spec import (
|
||||
ZERO_HASH,
|
||||
process_deposit,
|
||||
)
|
||||
from ..helpers import (
|
||||
from phase0.helpers import (
|
||||
build_deposit,
|
||||
privkeys,
|
||||
pubkeys,
|
||||
|
@ -7,7 +7,7 @@ from eth2.phase0.spec import (
|
||||
get_current_epoch,
|
||||
process_proposer_slashing,
|
||||
)
|
||||
from ..helpers import (
|
||||
from phase0.helpers import (
|
||||
get_valid_proposer_slashing,
|
||||
)
|
||||
|
||||
|
@ -8,7 +8,7 @@ from eth2.phase0.spec import (
|
||||
get_current_epoch,
|
||||
process_voluntary_exit,
|
||||
)
|
||||
from ..helpers import (
|
||||
from phase0.helpers import (
|
||||
build_voluntary_exit,
|
||||
pubkey_to_privkey,
|
||||
)
|
||||
|
@ -4,4 +4,4 @@ oyaml==0.7
|
||||
pycryptodome==3.7.3
|
||||
py_ecc>=1.6.0
|
||||
pytest>=3.6,<3.7
|
||||
../pyspec
|
||||
../test_libs/pyspec
|
||||
|
@ -46,9 +46,9 @@ Simply open up the generator (not all at once) of choice in your favorite IDE/ed
|
||||
|
||||
```bash
|
||||
# Create a virtual environment (any venv/.venv/.venvs is git-ignored)
|
||||
python3 -m venv .venv
|
||||
python3 -m venv venv
|
||||
# Activate the venv, this is where dependencies are installed for the generator
|
||||
. .venv/bin/activate
|
||||
. venv/bin/activate
|
||||
```
|
||||
|
||||
Now that you have a virtual environment, write your generator.
|
||||
@ -57,8 +57,13 @@ It's recommended to extend the base-generator.
|
||||
Create a `requirements.txt` in the root of your generator directory:
|
||||
```
|
||||
eth-utils==1.4.1
|
||||
../test_libs/gen_helpers
|
||||
../../test_libs/gen_helpers
|
||||
```
|
||||
And optionally, to include pyspec, add:
|
||||
```
|
||||
../../test_libs/pyspec
|
||||
```
|
||||
Note: make sure to run `make pyspec` from the root of the specs repository, to build the pyspec requirement.
|
||||
|
||||
Install all the necessary requirements (re-run when you add more):
|
||||
```bash
|
||||
|
@ -1,9 +1,8 @@
|
||||
from distutils.core import setup
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name='pyspec',
|
||||
version='1.0',
|
||||
packages=['eth2.debug', 'eth2.phase0', 'eth2.utils'],
|
||||
packages=find_packages(),
|
||||
install_requires=[
|
||||
"eth-utils>=1.3.0,<2",
|
||||
"eth-typing>=2.1.0,<3.0.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user