fix pyspec setup, and update usages: py_tests and in docs

This commit is contained in:
protolambda 2019-03-28 23:10:16 +08:00
parent 3f6d6535ad
commit 05970c9383
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
11 changed files with 18 additions and 13 deletions

View File

@ -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:
```

View File

View File

@ -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,
)

View File

@ -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,
)

View File

@ -8,7 +8,7 @@ from eth2.phase0.spec import (
ZERO_HASH,
process_deposit,
)
from ..helpers import (
from phase0.helpers import (
build_deposit,
privkeys,
pubkeys,

View File

@ -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,
)

View File

@ -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,
)

View File

@ -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

View File

@ -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

View File

@ -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",