From 700b0fb4094652810aa3468b80bbd3530e3eaff8 Mon Sep 17 00:00:00 2001 From: James Jia Date: Tue, 15 Aug 2023 23:41:52 -0700 Subject: [PATCH] Add lint + test workflow for v4-client-py (#2) * Add lint + test workflow for v4-client-py --- .github/workflows/py-lint-test.yml | 53 ++++++++++++++++++++++++++++++ v4-client-py/README.md | 2 +- v4-client-py/requirements-test.txt | 4 +-- v4-client-py/requirements.txt | 2 +- 4 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/py-lint-test.yml diff --git a/.github/workflows/py-lint-test.yml b/.github/workflows/py-lint-test.yml new file mode 100644 index 00000000..f52e98f0 --- /dev/null +++ b/.github/workflows/py-lint-test.yml @@ -0,0 +1,53 @@ +name: "[v4-client-py] Lint, Test" + +on: # yamllint disable-line rule:truthy + pull_request: + paths: + - 'v4-client-py/**' + push: + paths: + - 'v4-client-py/**' + branches: + - main + - "release/*" + +jobs: + lint: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./v4-client-py + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install Dependencies + run: pip install -r requirements-lint.txt + + - name: Lint + run: flake8 + + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./v4-client-py + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install Dependencies + run: sudo pip install -r requirements-test.txt + + - name: Run pytest + run: pytest diff --git a/v4-client-py/README.md b/v4-client-py/README.md index 879e9339..d9ab7fd1 100644 --- a/v4-client-py/README.md +++ b/v4-client-py/README.md @@ -92,5 +92,5 @@ examples/faucet_endpoint.py Wait for a few seconds for the faucet transaction to commit, then run ``` -pytest -v -c pytest_integration.ini +pytest -v -c pytest_integration.ini ``` diff --git a/v4-client-py/requirements-test.txt b/v4-client-py/requirements-test.txt index 0ad21dc5..f23c399f 100644 --- a/v4-client-py/requirements-test.txt +++ b/v4-client-py/requirements-test.txt @@ -2,10 +2,10 @@ Cython>=0.29.0 aiohttp>=3.8.1 bech32>=1.2.0 bip_utils>=1.6.0 -brownie>=1.14.6 +brownie>=0.5.0 cytoolz>=0.12.1 dateparser>=1.0.0 -#dydxpy>=0.24.0 +dydxpy>=0.3.1 ecdsa>=0.16.0 eth_keys>=0.4.0 eth-account>=0.9.0 diff --git a/v4-client-py/requirements.txt b/v4-client-py/requirements.txt index db00159b..e7c96bc3 100644 --- a/v4-client-py/requirements.txt +++ b/v4-client-py/requirements.txt @@ -5,7 +5,7 @@ bip_utils>=2.7.0 brownie>=0.5.0 cytoolz>=0.12.1 dateparser>=1.0.0 -#dydxpy>=0.24.0 +dydxpy>=0.3.1 ecdsa>=0.18.0 eth_keys>=0.4.0 eth-account>=0.9.0