From 883555beb39f5904e49cc733258adcdd6f0945ff Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Tue, 26 Jun 2018 23:10:29 -0700 Subject: [PATCH 01/11] Remove version specifications from Pipfile --- Pipfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index 2456ad45b..640f278ee 100644 --- a/Pipfile +++ b/Pipfile @@ -25,19 +25,18 @@ requests = "*" hendrix = "==3.0.0" constantSorrow = {git = "https://github.com/nucypher/constantSorrow.git", ref = "nucypher-depend"} bytestringSplitter = {git = "https://github.com/nucypher/byteStringSplitter.git", ref = "nucypher-depend"} -appdirs = "*" -web3 = "==4.3.0" +web3 = "*" [dev-packages] -pytest = "*" mypy = "*" +pytest = "*" pytest-mypy = "*" +pytest-cov = "*" codecov = "*" coverage = "*" -pytest-cov = "*" py-solc = "*" -py-evm = "==0.2.0a18" -eth-tester = "==0.1.0b26" +py-evm = "*" +eth-tester = "*" py-geth = "*" [pipenv] From e49c59407c5e4390a2c559880391066a2e5407e4 Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Wed, 27 Jun 2018 12:30:01 -0700 Subject: [PATCH 02/11] Remove travis yml --- .travis.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0c08086b1..000000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: python -cache: pip -python: -- '3.5' -- '3.6' -- '3.7' -install: -- pip install pipenv --upgrade -- pipenv install --dev --three -before_script: -- wget https://github.com/ethereum/solidity/releases/download/v0.4.24/solc-static-linux -O "${VIRTUAL_ENV}/bin/solc" -- chmod +x "${VIRTUAL_ENV}/bin/solc" -script: -- pipenv run -- pytest --runslow --cov=nucypher -v tests -- codecov -matrix: - allow_failures: - - python: '3.7' \ No newline at end of file From ef69c6249a298579d4d92e9918a6c999b8d9cdfa Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Wed, 27 Jun 2018 12:30:35 -0700 Subject: [PATCH 03/11] Remove geth fixtures... for now. --- tests/eth_fixtures.py | 84 +------------------------------------------ 1 file changed, 1 insertion(+), 83 deletions(-) diff --git a/tests/eth_fixtures.py b/tests/eth_fixtures.py index cd31a9db8..4f1a14a70 100644 --- a/tests/eth_fixtures.py +++ b/tests/eth_fixtures.py @@ -1,17 +1,11 @@ import contextlib import os -import signal -import subprocess -import tempfile import pytest -import shutil -import time from constant_sorrow import constants from eth_tester import EthereumTester -from geth import LoggingMixin, DevGethProcess from os.path import abspath, dirname -from web3 import EthereumTesterProvider, IPCProvider +from web3 import EthereumTesterProvider from nucypher.blockchain.eth.chains import TesterBlockchain from nucypher.blockchain.eth.deployers import PolicyManagerDeployer, NucypherTokenDeployer, MinerEscrowDeployer @@ -26,82 +20,6 @@ constants.NUMBER_OF_TEST_ETH_ACCOUNTS(10) -# -# Provider Fixtures -# - - -@pytest.fixture(scope='session') -def manual_geth_ipc_provider(): - """ - Provider backend - https:// github.com/ethereum/eth-tester - """ - ipc_provider = IPCProvider(ipc_path='/tmp/geth.ipc') - yield ipc_provider - - -@pytest.fixture(scope='session') -def auto_geth_dev_ipc_provider(): - """ - Provider backend - https:// github.com/ethereum/eth-tester - """ - # TODO: logging - geth_cmd = ["geth --dev"] # WARNING: changing this may have undesireable effects. - geth_process = subprocess.Popen(geth_cmd, stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) - - time.sleep(10) #TODO: better wait with file socket - - ipc_provider = IPCProvider(ipc_path=os.path.join('/tmp/geth.ipc')) - - yield ipc_provider - os.killpg(os.getpgid(geth_process.pid), signal.SIGTERM) - - -@pytest.fixture(scope='session') -def auto_geth_ipc_provider(): - """ - Provider backend - https: // github.com / ethereum / eth - tester # available-backends - """ - - # - # spin-up geth - # - - class IPCDevGethProcess(LoggingMixin, DevGethProcess): - data_dir = tempfile.mkdtemp() - chain_name = 'tester' - ipc_path = os.path.join(data_dir, chain_name, 'geth.ipc') - - def __init__(self, *args, **kwargs): - super().__init__(chain_name=self.chain_name, - base_dir=self.data_dir, - *args, **kwargs) - - geth = IPCDevGethProcess() - geth.start() - - geth.wait_for_ipc(timeout=30) - geth.wait_for_dag(timeout=600) # 10 min - assert geth.is_dag_generated - assert geth.is_running - assert geth.is_alive - - ipc_provider = IPCProvider(ipc_path=geth.ipc_path) - yield ipc_provider - - # - # Teardown - # - geth.stop() - assert geth.is_stopped - assert not geth.is_alive - shutil.rmtree(geth.data_dir) - - - # # Blockchain # From 8b1897b157b2b2e0a101b7e1c9a685904e5c50cc Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Wed, 27 Jun 2018 12:32:36 -0700 Subject: [PATCH 04/11] Include solc install script in pipenv run commands; Remove geth deps --- Pipfile | 33 +++++++++++++++++---------------- install_solc.sh | 11 +++++++++++ setup.sh | 16 ---------------- 3 files changed, 28 insertions(+), 32 deletions(-) create mode 100755 install_solc.sh delete mode 100755 setup.sh diff --git a/Pipfile b/Pipfile index 640f278ee..8cb2feda4 100644 --- a/Pipfile +++ b/Pipfile @@ -3,41 +3,42 @@ url = "https://pypi.python.org/simple" verify_ssl = true name = "pypi" - [packages] -# Wheels for cryptography until the next release. + +# Wheels for cryptography until the next release cryptography35_linux = { path='./wheelhouse/cryptography-2.3.dev1-cp35-cp35m-linux_x86_64.whl', markers="python_version >= '3.5' and python_version < '3.6' and platform_system == 'Linux'"} cryptography36_linux = { path='./wheelhouse/cryptography-2.3.dev1-cp36-cp36m-linux_x86_64.whl', markers="python_version >= '3.6' and python_version < '3.7' and platform_system == 'Linux'"} cryptography36_darwin = { path='./wheelhouse/cryptography-2.3.dev1-cp36-cp36m-macosx_10_13_x86_64.whl', markers="python_version >= '3.6' and python_version < '3.7' and platform_system == 'Darwin'"} - -rpcudp = {git = "https://github.com/nucypher/rpcudp", ref = "nucypher-depend"} -kademlia = {git = "https://github.com/nucypher/kademlia", ref = "nucypher-depend"} -PyNaCl = "*" -"pysha3" = "*" -bidict = "*" -py_ecc = "*" -SQLAlchemy = "*" -apistar = "*" -maya = "*" -pyumbral = {git = "https://github.com/nucypher/pyumbral.git", ref = "nucypher-depend"} requests = "*" +maya = "*" hendrix = "==3.0.0" constantSorrow = {git = "https://github.com/nucypher/constantSorrow.git", ref = "nucypher-depend"} bytestringSplitter = {git = "https://github.com/nucypher/byteStringSplitter.git", ref = "nucypher-depend"} +SQLAlchemy = "*" +apistar = "*" +rpcudp = {git = "https://github.com/nucypher/rpcudp", ref = "nucypher-depend"} +kademlia = {git = "https://github.com/nucypher/kademlia", ref = "nucypher-depend"} +PyNaCl = "*" +pysha3 = "*" +py_ecc = "*" +pyumbral = {git = "https://github.com/nucypher/pyumbral.git", ref = "nucypher-depend"} web3 = "*" [dev-packages] -mypy = "*" pytest = "*" +mypy = "*" pytest-mypy = "*" -pytest-cov = "*" codecov = "*" coverage = "*" +pytest-cov = "*" py-solc = "*" py-evm = "*" eth-tester = "*" -py-geth = "*" [pipenv] allow_prereleases = true + + +[scripts] +install_solc = "./install_solc.sh" diff --git a/install_solc.sh b/install_solc.sh new file mode 100755 index 000000000..092c45d2e --- /dev/null +++ b/install_solc.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + + +SOLC_VER="0.4.24" +SOL_BIN_PATH="$(pipenv --venv)/bin/solc" + +echo "Downloading solidity compiler binary to: ${SOL_BIN_PATH}" +wget "https://github.com/ethereum/solidity/releases/download/v${SOLC_VER}/solc-static-linux" -O ${SOL_BIN_PATH} +echo "Setting executable permission on ${SOL_BIN_PATH}" +chmod +x ${SOL_BIN_PATH} +echo "Successfully Installed solc ${SOLC_VER}" diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 46c2dc43b..000000000 --- a/setup.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -PYTHON="python3.6" -SOLC_VER="0.4.24" - -python3 -m pipenv > /dev/null -if [[ $? != 0 ]] -then - echo "Installing pipenv in user directory..." - pip3 install --user pipenv -fi - -python3 -m pipenv install --python $PYTHON --dev -wget "https://github.com/ethereum/solidity/releases/download/v${SOLC_VER}/solc-static-linux" -O "$(pipenv --venv)/bin/solc" -chmod +x "$(pipenv --venv)/bin/solc" -pipenv run pip3 install -e . From e532c573cc6315d47f1e9e8bafcfa848d883d194 Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Wed, 27 Jun 2018 12:39:53 -0700 Subject: [PATCH 05/11] circleci: use custom solc binary install command --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 98fb0816e..baae48af0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,11 +40,7 @@ bundle_dependencies: &bundle_dependencies pipenv install --three --dev --skip-lock - run: name: Install Solidity compiler - command: | - wget "https://github.com/ethereum/solidity/releases/download/${SOLC_VER}/solc-static-linux" -O "$(pipenv --venv)/bin/solc" - chmod +x "$(pipenv --venv)/bin/solc" - environment: - SOLC_VER: "v0.4.24" + command: pipenv run install_solc - save_cache: paths: - "~/.local/share/virtualenvs/" From 99b47a5c3c060375a11ffbe1d473564516ce8dcf Mon Sep 17 00:00:00 2001 From: Kieran R Prasch Date: Wed, 27 Jun 2018 15:27:32 -0700 Subject: [PATCH 06/11] Consolidate scripts, insert pre-commit hook installation command --- Pipfile | 8 ++++---- install_solc.sh => scripts/install_solc.sh | 0 scripts/validate_config.sh | 11 +++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) rename install_solc.sh => scripts/install_solc.sh (100%) create mode 100644 scripts/validate_config.sh diff --git a/Pipfile b/Pipfile index 8cb2feda4..47e5da17a 100644 --- a/Pipfile +++ b/Pipfile @@ -15,11 +15,11 @@ maya = "*" hendrix = "==3.0.0" constantSorrow = {git = "https://github.com/nucypher/constantSorrow.git", ref = "nucypher-depend"} bytestringSplitter = {git = "https://github.com/nucypher/byteStringSplitter.git", ref = "nucypher-depend"} -SQLAlchemy = "*" +sqlalchemy = "*" apistar = "*" rpcudp = {git = "https://github.com/nucypher/rpcudp", ref = "nucypher-depend"} kademlia = {git = "https://github.com/nucypher/kademlia", ref = "nucypher-depend"} -PyNaCl = "*" +pynacl = "*" pysha3 = "*" py_ecc = "*" pyumbral = {git = "https://github.com/nucypher/pyumbral.git", ref = "nucypher-depend"} @@ -39,6 +39,6 @@ eth-tester = "*" [pipenv] allow_prereleases = true - [scripts] -install_solc = "./install_solc.sh" +install_solc = "scripts/install_solc.sh" +install_circle_commit_hook = "cp -i scripts/validate_config.sh .git/hooks/pre-commit" diff --git a/install_solc.sh b/scripts/install_solc.sh similarity index 100% rename from install_solc.sh rename to scripts/install_solc.sh diff --git a/scripts/validate_config.sh b/scripts/validate_config.sh new file mode 100644 index 000000000..e35a946b9 --- /dev/null +++ b/scripts/validate_config.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# The following line is needed by the CircleCI Local Build Tool (due to Docker interactivity) +exec < /dev/tty + +# If validation fails, tell Git to stop and provide error message. Otherwise, continue. +if ! eMSG=$(circleci config validate -c .circleci/config.yml); then + echo "CircleCI Configuration Failed Validation." + echo $eMSG + exit 1 +fi From 141fef44fc01bbf589d1fb924620e3d97223473c Mon Sep 17 00:00:00 2001 From: Kieran R Prasch Date: Wed, 27 Jun 2018 15:28:40 -0700 Subject: [PATCH 07/11] Simplify repeated config logic; rename / reorg jobs. --- .circleci/config.yml | 175 +++++++++++++++++++------------------------ 1 file changed, 78 insertions(+), 97 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index baae48af0..531b7b61a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,12 +5,9 @@ workflows: test: jobs: - bundle_dependencies-36 - - contract_unit: + - eth_contract_unit: requires: - bundle_dependencies-36 - - intercontract_integration: - requires: - - contract_unit - crypto_unit: requires: - bundle_dependencies-36 @@ -20,7 +17,7 @@ workflows: - keystore_unit: requires: - bundle_dependencies-36 - - blockchain_client_unit: + - blockchain_interface_unit: requires: - bundle_dependencies-36 - character: @@ -28,36 +25,48 @@ workflows: - crypto_unit - network_unit - keystore_unit + - intercontract_integration: + requires: + - eth_contract_unit -bundle_dependencies: &bundle_dependencies - steps: - - checkout - - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} - - run: - name: Install Python dependencies with Pipenv - command: | - pipenv install --three --dev --skip-lock - - run: - name: Install Solidity compiler - command: pipenv run install_solc - - save_cache: - paths: - - "~/.local/share/virtualenvs/" - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} +python_36_base: &python_36_base + working_directory: ~/nucypher-depends + environment: + PIPENV_VENV_IN_PROJECT: "True" + docker: + - image: circleci/python:3.6 jobs: bundle_dependencies-36: - <<: *bundle_dependencies - working_directory: ~/nucypher-depends - docker: - - image: circleci/python:3.6 + <<: *python_36_base + steps: + - checkout + - run: + name: Install Python Dependencies with Pipenv + command: | + export PIPENV_VENV_IN_PROJECT=True + pipenv install --three --dev --pre --skip-lock + - run: + name: Install Solidity Compiler + command: pipenv run install_solc + - save_cache: + paths: + - "./.venv" + key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} - contract_unit: + blockchain_interface_unit: + <<: *python_36_base + steps: + - checkout + - restore_cache: + key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + - run: + name: Blockchain Interface Tests + command: pipenv run pytest --cov=nucypher/blockchain/eth -v --runslow tests/blockchain/eth/interfaces tests/blockchain/eth/entities + + eth_contract_unit: + <<: *python_36_base parallelism: 4 - working_directory: ~/nucypher-depends - docker: - - image: circleci/python:3.6 steps: - checkout - restore_cache: @@ -69,11 +78,48 @@ jobs: - store_test_results: path: ./reports/pytest/ + crypto_unit: + <<: *python_36_base + steps: + - checkout + - restore_cache: + key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + - run: + name: Crypto Character Tests + command: pipenv run pytest --cov=nucypher/crypto -v --runslow tests/crypto + + network_unit: + <<: *python_36_base + steps: + - checkout + - restore_cache: + key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + - run: + name: Network Tests + command: pipenv run pytest --cov=nucypher/network -v --runslow tests/network + + keystore_unit: + <<: *python_36_base + steps: + - checkout + - restore_cache: + key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + - run: + name: Keystore Tests + command: pipenv run pytest --cov=nucypher/keystore -v --runslow tests/keystore + + character: + <<: *python_36_base + steps: + - checkout + - restore_cache: + key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + - run: + name: Character Tests + command: pipenv run pytest --cov=nucypher/characters -v --runslow tests/characters intercontract_integration: - working_directory: ~/nucypher-depends - docker: - - image: circleci/python:3.6 + <<: *python_36_base steps: - checkout - restore_cache: @@ -82,68 +128,3 @@ jobs: name: Ethereum Inter-Contract Integration Test command: | pipenv run pytest -v --runslow tests/blockchain/eth/contracts/integration - - crypto_unit: - working_directory: ~/nucypher-depends - docker: - - image: circleci/python:3.6 - steps: - - checkout - - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} - - run: - name: Crypto Character Tests - command: | - pipenv run pytest --cov=nucypher/crypto -v --runslow tests/crypto - - network_unit: - working_directory: ~/nucypher-depends - docker: - - image: circleci/python:3.6 - steps: - - checkout - - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} - - run: - name: Network Tests - command: | - pipenv run pytest --cov=nucypher/network -v --runslow tests/network - - keystore_unit: - working_directory: ~/nucypher-depends - docker: - - image: circleci/python:3.6 - steps: - - checkout - - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} - - run: - name: Keystore Tests - command: | - pipenv run pytest --cov=nucypher/keystore -v --runslow tests/keystore - - character: - working_directory: ~/nucypher-depends - docker: - - image: circleci/python:3.6 - steps: - - checkout - - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} - - run: - name: Character Tests - command: | - pipenv run pytest --cov=nucypher/characters -v --runslow tests/characters - - blockchain_client_unit: - working_directory: ~/nucypher-depends - docker: - - image: circleci/python:3.6 - steps: - - checkout - - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} - - run: - name: Blockchain Client Tests - command: | - pipenv run pytest --cov=nucypher/blockchain/eth -v --runslow tests/blockchain/eth/interfaces tests/blockchain/eth/entities From 4bccd6589b3bd4caeb6dd8bf2f1b5c107ddec992 Mon Sep 17 00:00:00 2001 From: Kieran R Prasch Date: Wed, 27 Jun 2018 15:33:15 -0700 Subject: [PATCH 08/11] remove pipenv hook installation --- Pipfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Pipfile b/Pipfile index 47e5da17a..eaf3a06e5 100644 --- a/Pipfile +++ b/Pipfile @@ -41,4 +41,3 @@ allow_prereleases = true [scripts] install_solc = "scripts/install_solc.sh" -install_circle_commit_hook = "cp -i scripts/validate_config.sh .git/hooks/pre-commit" From ba631e68064920912c96da5699f55aba0730d495 Mon Sep 17 00:00:00 2001 From: Kieran R Prasch Date: Wed, 27 Jun 2018 16:03:59 -0700 Subject: [PATCH 09/11] Add mypy build to circleci; Use workflow ID number as dep cache key --- .circleci/config.yml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 531b7b61a..f6e9d6ba3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,9 @@ workflows: test: jobs: - bundle_dependencies-36 + - mypy_type_check: + requires: + - bundle_dependencies-36 - eth_contract_unit: requires: - bundle_dependencies-36 @@ -31,8 +34,6 @@ workflows: python_36_base: &python_36_base working_directory: ~/nucypher-depends - environment: - PIPENV_VENV_IN_PROJECT: "True" docker: - image: circleci/python:3.6 @@ -44,22 +45,21 @@ jobs: - run: name: Install Python Dependencies with Pipenv command: | - export PIPENV_VENV_IN_PROJECT=True pipenv install --three --dev --pre --skip-lock - run: name: Install Solidity Compiler command: pipenv run install_solc - save_cache: paths: - - "./.venv" - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + - "~/.local/share/virtualenvs/" + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} blockchain_interface_unit: <<: *python_36_base steps: - checkout - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} - run: name: Blockchain Interface Tests command: pipenv run pytest --cov=nucypher/blockchain/eth -v --runslow tests/blockchain/eth/interfaces tests/blockchain/eth/entities @@ -70,7 +70,7 @@ jobs: steps: - checkout - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} - run: name: Ethereum Contract Unit Tests command: | @@ -83,7 +83,7 @@ jobs: steps: - checkout - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} - run: name: Crypto Character Tests command: pipenv run pytest --cov=nucypher/crypto -v --runslow tests/crypto @@ -93,7 +93,7 @@ jobs: steps: - checkout - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} - run: name: Network Tests command: pipenv run pytest --cov=nucypher/network -v --runslow tests/network @@ -103,7 +103,7 @@ jobs: steps: - checkout - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} - run: name: Keystore Tests command: pipenv run pytest --cov=nucypher/keystore -v --runslow tests/keystore @@ -113,7 +113,7 @@ jobs: steps: - checkout - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} - run: name: Character Tests command: pipenv run pytest --cov=nucypher/characters -v --runslow tests/characters @@ -123,8 +123,20 @@ jobs: steps: - checkout - restore_cache: - key: v2-deps-{{ .Branch }}-{{ checksum "Pipfile" }} + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} - run: name: Ethereum Inter-Contract Integration Test command: | pipenv run pytest -v --runslow tests/blockchain/eth/contracts/integration + + mypy_type_check: + <<: *python_36_base + steps: + - checkout + - restore_cache: + key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} + - run: + name: Run Mypy Static Type Checks + command: pipenv run mypy --xslt-html-report ./mypy_report ./nucypher + - store_artifacts: + path: ./mypy_report From df6edd47c596acd93d932dc3f383723d3f8d522a Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Wed, 27 Jun 2018 23:07:09 -0700 Subject: [PATCH 10/11] Add output to precommit hook + better name --- scripts/{validate_config.sh => validate_circleci_config.sh} | 2 ++ 1 file changed, 2 insertions(+) rename scripts/{validate_config.sh => validate_circleci_config.sh} (82%) diff --git a/scripts/validate_config.sh b/scripts/validate_circleci_config.sh similarity index 82% rename from scripts/validate_config.sh rename to scripts/validate_circleci_config.sh index e35a946b9..ad14c4648 100644 --- a/scripts/validate_config.sh +++ b/scripts/validate_circleci_config.sh @@ -3,9 +3,11 @@ # The following line is needed by the CircleCI Local Build Tool (due to Docker interactivity) exec < /dev/tty +echo "Validating CircleCI YML Config..." # If validation fails, tell Git to stop and provide error message. Otherwise, continue. if ! eMSG=$(circleci config validate -c .circleci/config.yml); then echo "CircleCI Configuration Failed Validation." echo $eMSG exit 1 fi +echo "CircleCI config is valid." From ec9704a0814248a1f78cb3c1a50726978e3f21e3 Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Thu, 28 Jun 2018 16:49:31 -0700 Subject: [PATCH 11/11] Add mypy.ini configuration --- .circleci/config.yml | 2 +- mypy.ini | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f6e9d6ba3..f761244e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,6 +137,6 @@ jobs: key: v1-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }} - run: name: Run Mypy Static Type Checks - command: pipenv run mypy --xslt-html-report ./mypy_report ./nucypher + command: pipenv run mypy --xslt-html-report ./mypy_report ./nucypher --config-file=mypy.ini - store_artifacts: path: ./mypy_report diff --git a/mypy.ini b/mypy.ini index f7f2bd728..a4a5d89d5 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,2 +1,7 @@ [mypy] -ignore_missing_imports=True \ No newline at end of file +python_version=3.6 +verbosity=0 +[mypy-nucypher.*] +disallow_untyped_defs=True +check_untyped_defs=False +disallow_untyped_calls=True \ No newline at end of file