From 97906a633910b8989576dc7371f4ca438d435cdf Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Mon, 22 Apr 2019 18:07:55 +0800 Subject: [PATCH] Only use `setup.py` --- .circleci/config.yml | 6 ++--- Makefile | 2 +- test_generators/README.md | 2 +- test_libs/config_helpers/requirements.txt | 1 - test_libs/config_helpers/setup.py | 15 +++++++++--- test_libs/gen_helpers/requirements.txt | 2 -- test_libs/gen_helpers/setup.py | 18 ++++++++++---- test_libs/pyspec/README.md | 2 +- test_libs/pyspec/requirements-testing.txt | 3 --- test_libs/pyspec/requirements.txt | 4 ---- test_libs/pyspec/setup.py | 29 ++++++++++++++++++----- 11 files changed, 55 insertions(+), 29 deletions(-) delete mode 100644 test_libs/config_helpers/requirements.txt delete mode 100644 test_libs/gen_helpers/requirements.txt delete mode 100644 test_libs/pyspec/requirements-testing.txt delete mode 100644 test_libs/pyspec/requirements.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f806b00f..28d949de4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,13 +61,13 @@ jobs: key: v1-specs-repo-{{ .Branch }}-{{ .Revision }} - restore_cached_venv: venv_name: v1-pyspec - reqs_checksum: '{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "test_libs/pyspec/requirements-testing.txt" }}' + reqs_checksum: '{{ checksum "test_libs/pyspec/setup.py" }}' - run: name: Install pyspec requirements command: make install_test - save_cached_venv: venv_name: v1-pyspec - reqs_checksum: '{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "test_libs/pyspec/requirements-testing.txt" }}' + reqs_checksum: '{{ checksum "test_libs/pyspec/setup.py" }}' venv_path: ./test_libs/pyspec/venv test: docker: @@ -78,7 +78,7 @@ jobs: key: v1-specs-repo-{{ .Branch }}-{{ .Revision }} - restore_cached_venv: venv_name: v1-pyspec - reqs_checksum: '{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "test_libs/pyspec/requirements-testing.txt" }}' + reqs_checksum: '{{ checksum "test_libs/pyspec/setup.py" }}' - run: name: Run py-tests command: make citest diff --git a/Makefile b/Makefile index 73d8adea8..10550750a 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ gen_yaml_tests: $(PY_SPEC_ALL_TARGETS) $(YAML_TEST_TARGETS) # installs the packages to run pyspec tests install_test: - cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; pip3 install -r requirements-testing.txt; + cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; pip3 install -e .[dev]; test: $(PY_SPEC_ALL_TARGETS) cd $(PY_SPEC_DIR); . venv/bin/activate; python -m pytest . diff --git a/test_generators/README.md b/test_generators/README.md index 66534e5a8..94db105c0 100644 --- a/test_generators/README.md +++ b/test_generators/README.md @@ -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): ```bash -pip3 install -r requirements.txt +pip3 install -e .[pyspec] ``` And write your initial test generator, extending the base generator: diff --git a/test_libs/config_helpers/requirements.txt b/test_libs/config_helpers/requirements.txt deleted file mode 100644 index e441a474b..000000000 --- a/test_libs/config_helpers/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -ruamel.yaml==0.15.87 diff --git a/test_libs/config_helpers/setup.py b/test_libs/config_helpers/setup.py index 90ad94ee4..b69d19cdb 100644 --- a/test_libs/config_helpers/setup.py +++ b/test_libs/config_helpers/setup.py @@ -1,9 +1,18 @@ from distutils.core import setup + +deps = { + 'config_helpers': [ + "ruamel.yaml==0.15.87", + ], +} + +deps['dev'] = ( + deps['config_helpers'] +) + setup( name='config_helpers', packages=['preset_loader'], - install_requires=[ - "ruamel.yaml==0.15.87" - ] + install_requires=deps['config_helpers'] ) diff --git a/test_libs/gen_helpers/requirements.txt b/test_libs/gen_helpers/requirements.txt deleted file mode 100644 index 3d6a39458..000000000 --- a/test_libs/gen_helpers/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -ruamel.yaml==0.15.87 -eth-utils==1.4.1 diff --git a/test_libs/gen_helpers/setup.py b/test_libs/gen_helpers/setup.py index 5de27a6db..d4d331c06 100644 --- a/test_libs/gen_helpers/setup.py +++ b/test_libs/gen_helpers/setup.py @@ -1,10 +1,20 @@ from distutils.core import setup + +deps = { + 'gen_helpers': [ + "ruamel.yaml==0.15.87", + "eth-utils==1.4.1", + ], +} + +deps['dev'] = ( + deps['gen_helpers'] +) + + setup( name='gen_helpers', packages=['gen_base'], - install_requires=[ - "ruamel.yaml==0.15.87", - "eth-utils==1.4.1" - ] + install_requires=deps['gen_helpers'], ) diff --git a/test_libs/pyspec/README.md b/test_libs/pyspec/README.md index df1834210..ab2967024 100644 --- a/test_libs/pyspec/README.md +++ b/test_libs/pyspec/README.md @@ -38,7 +38,7 @@ Install dependencies: ```bash python3 -m venv venv . venv/bin/activate -pip3 install -r requirements-testing.txt +pip3 install -e .[dev] ``` 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. diff --git a/test_libs/pyspec/requirements-testing.txt b/test_libs/pyspec/requirements-testing.txt deleted file mode 100644 index 388a878a9..000000000 --- a/test_libs/pyspec/requirements-testing.txt +++ /dev/null @@ -1,3 +0,0 @@ --r requirements.txt -pytest>=3.6,<3.7 -../config_helpers diff --git a/test_libs/pyspec/requirements.txt b/test_libs/pyspec/requirements.txt deleted file mode 100644 index 78d41708d..000000000 --- a/test_libs/pyspec/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -eth-utils>=1.3.0,<2 -eth-typing>=2.1.0,<3.0.0 -pycryptodome==3.7.3 -py_ecc>=1.6.0 diff --git a/test_libs/pyspec/setup.py b/test_libs/pyspec/setup.py index 1a131a417..13ea4d6e5 100644 --- a/test_libs/pyspec/setup.py +++ b/test_libs/pyspec/setup.py @@ -1,13 +1,30 @@ from setuptools import setup, find_packages -setup( - name='pyspec', - packages=find_packages(), - tests_require=["pytest"], - install_requires=[ + + + +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(), + install_requires=install_requires, + extras_require=deps, )