Merge pull request #1020 from ethereum/revert-981-only_setup_py

Revert 981 only setup py
This commit is contained in:
Diederik Loerakker 2019-05-02 01:03:56 +08:00 committed by GitHub
commit 3562264a5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 40 additions and 109 deletions

View File

@ -60,15 +60,15 @@ jobs:
- restore_cache: - restore_cache:
key: v1-specs-repo-{{ .Branch }}-{{ .Revision }} key: v1-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_cached_venv: - restore_cached_venv:
venv_name: v1-test_libs venv_name: v1-pyspec
reqs_checksum: '{{ checksum "test_libs/pyspec/setup.py" }}' reqs_checksum: '{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "test_libs/pyspec/requirements-testing.txt" }}'
- run: - run:
name: Install pyspec requirements name: Install pyspec requirements
command: make install_test command: make install_test
- save_cached_venv: - save_cached_venv:
venv_name: v1-test_libs venv_name: v1-pyspec
reqs_checksum: '{{ checksum "test_libs/pyspec/setup.py" }}' reqs_checksum: '{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "test_libs/pyspec/requirements-testing.txt" }}'
venv_path: ./test_libs/venv venv_path: ./test_libs/pyspec/venv
test: test:
docker: docker:
- image: circleci/python:3.6 - image: circleci/python:3.6
@ -77,8 +77,8 @@ jobs:
- restore_cache: - restore_cache:
key: v1-specs-repo-{{ .Branch }}-{{ .Revision }} key: v1-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_cached_venv: - restore_cached_venv:
venv_name: v1-test_libs venv_name: v1-pyspec
reqs_checksum: '{{ checksum "test_libs/pyspec/setup.py" }}' reqs_checksum: '{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "test_libs/pyspec/requirements-testing.txt" }}'
- run: - run:
name: Run py-tests name: Run py-tests
command: make citest command: make citest

7
.gitignore vendored
View File

@ -4,10 +4,6 @@ venv
.venvs .venvs
.venv .venv
/.pytest_cache /.pytest_cache
*.egg
*.egg-info
eggs
.eggs
build/ build/
output/ output/
@ -17,6 +13,3 @@ eth2.0-spec-tests/
# Dynamically built from Markdown spec # Dynamically built from Markdown spec
test_libs/pyspec/eth2spec/phase0/spec.py test_libs/pyspec/eth2spec/phase0/spec.py
# vscode
.vscode/**

View File

@ -2,7 +2,6 @@ SPEC_DIR = ./specs
SCRIPT_DIR = ./scripts SCRIPT_DIR = ./scripts
TEST_LIBS_DIR = ./test_libs TEST_LIBS_DIR = ./test_libs
PY_SPEC_DIR = $(TEST_LIBS_DIR)/pyspec PY_SPEC_DIR = $(TEST_LIBS_DIR)/pyspec
CONFIG_HELPERS_DIR = $(TEST_LIBS_DIR)/config_helpers
YAML_TEST_DIR = ./eth2.0-spec-tests/tests YAML_TEST_DIR = ./eth2.0-spec-tests/tests
GENERATOR_DIR = ./test_generators GENERATOR_DIR = ./test_generators
CONFIGS_DIR = ./configs CONFIGS_DIR = ./configs
@ -24,8 +23,7 @@ all: $(PY_SPEC_ALL_TARGETS) $(YAML_TEST_DIR) $(YAML_TEST_TARGETS)
clean: clean:
rm -rf $(YAML_TEST_DIR) rm -rf $(YAML_TEST_DIR)
rm -rf $(GENERATOR_VENVS) rm -rf $(GENERATOR_VENVS)
rm -rf $(TEST_LIBS_DIR)/venv rm -rf $(PY_SPEC_DIR)/venv $(PY_SPEC_DIR)/.pytest_cache
rm -rf $(PY_SPEC_DIR)/.pytest_cache
rm -rf $(PY_SPEC_ALL_TARGETS) rm -rf $(PY_SPEC_ALL_TARGETS)
# "make gen_yaml_tests" to run generators # "make gen_yaml_tests" to run generators
@ -33,17 +31,13 @@ gen_yaml_tests: $(PY_SPEC_ALL_TARGETS) $(YAML_TEST_TARGETS)
# installs the packages to run pyspec tests # installs the packages to run pyspec tests
install_test: install_test:
cd $(TEST_LIBS_DIR); python3 -m venv venv; . venv/bin/activate; \ cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; pip3 install -r requirements-testing.txt;
cd ..; cd $(CONFIG_HELPERS_DIR); pip3 install -e .; \
cd ../..; cd $(PY_SPEC_DIR); pip3 install -e .[dev];
test: $(PY_SPEC_ALL_TARGETS) test: $(PY_SPEC_ALL_TARGETS)
cd $(TEST_LIBS_DIR); . venv/bin/activate; \ cd $(PY_SPEC_DIR); . venv/bin/activate; python -m pytest .
cd ..; cd $(PY_SPEC_DIR); python -m pytest .;
citest: $(PY_SPEC_ALL_TARGETS) citest: $(PY_SPEC_ALL_TARGETS)
cd $(TEST_LIBS_DIR); . venv/bin/activate; \ cd $(PY_SPEC_DIR); mkdir -p test-reports/eth2spec; . venv/bin/activate; python -m pytest --junitxml=test-reports/eth2spec/test_results.xml .
cd ..; cd $(PY_SPEC_DIR); mkdir -p test-reports/eth2spec; python -m pytest --junitxml=test-reports/eth2spec/test_results.xml .
# "make pyspec" to create the pyspec for all phases. # "make pyspec" to create the pyspec for all phases.
pyspec: $(PY_SPEC_ALL_TARGETS) pyspec: $(PY_SPEC_ALL_TARGETS)

View File

@ -72,7 +72,7 @@ Note: make sure to run `make pyspec` from the root of the specs repository, to b
Install all the necessary requirements (re-run when you add more): Install all the necessary requirements (re-run when you add more):
```bash ```bash
pip3 install -e .[pyspec] pip3 install -r requirements.txt
``` ```
And write your initial test generator, extending the base generator: And write your initial test generator, extending the base generator:

View File

@ -0,0 +1 @@
ruamel.yaml==0.15.87

View File

@ -1,20 +1,9 @@
from setuptools import setup, find_packages from distutils.core import setup
deps = {
'preset_loader': [
"ruamel.yaml==0.15.87",
],
}
deps['dev'] = (
deps['preset_loader']
)
install_requires = deps['preset_loader']
setup( setup(
name='config_helpers', name='config_helpers',
packages=find_packages(exclude=["tests", "tests.*"]), packages=['preset_loader'],
install_requires=install_requires, install_requires=[
"ruamel.yaml==0.15.87"
]
) )

View File

@ -0,0 +1,2 @@
ruamel.yaml==0.15.87
eth-utils==1.4.1

View File

@ -1,21 +1,10 @@
from setuptools import setup, find_packages from distutils.core import setup
deps = {
'gen_base': [
"ruamel.yaml==0.15.87",
"eth-utils==1.4.1",
],
}
deps['dev'] = (
deps['gen_base']
)
install_requires = deps['gen_base']
setup( setup(
name='gen_helpers', name='gen_helpers',
packages=find_packages(exclude=["tests", "tests.*"]), packages=['gen_base'],
install_requires=install_requires, install_requires=[
"ruamel.yaml==0.15.87",
"eth-utils==1.4.1"
]
) )

View File

@ -38,7 +38,7 @@ Install dependencies:
```bash ```bash
python3 -m venv venv python3 -m venv venv
. venv/bin/activate . venv/bin/activate
pip3 install -e .[dev] pip3 install -r requirements-testing.txt
``` ```
Note: make sure to run `make -B pyspec` from the root of the specs repository, Note: make sure to run `make -B pyspec` from the root of the specs repository,
to build the parts of the pyspec module derived from the markdown specs. to build the parts of the pyspec module derived from the markdown specs.

View File

@ -0,0 +1,3 @@
-r requirements.txt
pytest>=3.6,<3.7
../config_helpers

View File

@ -0,0 +1,4 @@
eth-utils>=1.3.0,<2
eth-typing>=2.1.0,<3.0.0
pycryptodome==3.7.3
py_ecc>=1.6.0

View File

@ -1,28 +1,13 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
setup(
deps = { name='pyspec',
'pyspec': [ packages=find_packages(),
tests_require=["pytest"],
install_requires=[
"eth-utils>=1.3.0,<2", "eth-utils>=1.3.0,<2",
"eth-typing>=2.1.0,<3.0.0", "eth-typing>=2.1.0,<3.0.0",
"pycryptodome==3.7.3", "pycryptodome==3.7.3",
"py_ecc>=1.6.0", "py_ecc>=1.6.0",
], ]
'test': [
"pytest>=3.6,<3.7",
],
}
deps['dev'] = (
deps['pyspec'] +
deps['test']
)
install_requires = deps['pyspec']
setup(
name='pyspec',
packages=find_packages(exclude=["tests", "tests.*"]),
install_requires=install_requires,
extras_require=deps,
) )

View File

@ -1,29 +0,0 @@
from setuptools import setup, find_packages
deps = {
'pyspec': [
"eth-utils>=1.3.0,<2",
"eth-typing>=2.1.0,<3.0.0",
"pycryptodome==3.7.3",
"py_ecc>=1.6.0",
],
'test': [
"pytest>=3.6,<3.7",
],
}
deps['dev'] = (
deps['pyspec'] +
deps['test']
)
install_requires = deps['pyspec']
setup(
name='pyspec',
packages=find_packages(exclude=["tests", "tests.*"]),
install_requires=install_requires,
extras_require=deps,
)