From f3da62c50a73b94169f69fd6e358baf60461a838 Mon Sep 17 00:00:00 2001 From: Eran Davidovich Date: Mon, 22 Nov 2021 10:02:08 +0200 Subject: [PATCH 1/5] Add pytest Github Action --- .github/workflows/docker-image.yml | 4 ---- .github/workflows/pytest.yml | 34 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index ce10297..f558498 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,10 +7,6 @@ on: tags: - "v*" - pull_request: - branches: - - "main" - jobs: docker: runs-on: ubuntu-latest diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..b61906c --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,34 @@ +name: pytest + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9"] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Lint with flake8 + run: | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Test with pytest + run: | + pytest From ff8d5585464ff3524a28d656d8655a7273f72768 Mon Sep 17 00:00:00 2001 From: Eran Davidovich Date: Mon, 22 Nov 2021 10:10:16 +0200 Subject: [PATCH 2/5] add pytest badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3e6f869..17b42bf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Pyth Client in Python ===================== +[![pytest](https://github.com/pyth-network/pyth-client-py/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/pyth-network/pyth-client-py/actions/workflows/pytest.yml) + A Python library to retrieve data from Pyth account structures off the Solana blockchain. **NOTE**: This library requires Python 3.7 or greater due to `from __future__ import annotations`. From 93d43f9295c9acec1d4e1b7d6e0fe7e6c6fd66bf Mon Sep 17 00:00:00 2001 From: Eran Davidovich Date: Mon, 22 Nov 2021 10:26:25 +0200 Subject: [PATCH 3/5] good bot dependabot! aiohttp>=3.7.4 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1b7c1ce..ac1d02e 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -requirements = ['aiodns', 'aiohttp', 'backoff', 'base58', 'loguru'] +requirements = ['aiodns', 'aiohttp>=3.7.4', 'backoff', 'base58', 'loguru'] setup( name='pythclient', From 94f5c41d1beedd20b4c9de42d4a03d1bb694a7a0 Mon Sep 17 00:00:00 2001 From: Eran Davidovich Date: Mon, 22 Nov 2021 10:39:42 +0200 Subject: [PATCH 4/5] remove requirements file, relying on setup.py --- .github/workflows/pytest.yml | 6 ------ requirements.txt | 15 --------------- 2 files changed, 21 deletions(-) delete mode 100644 requirements.txt diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b61906c..2bda159 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -18,12 +18,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 run: | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 25094b3..0000000 --- a/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -aiodns==3.0.0 -aiohttp==3.7.4.post0 -async-timeout==3.0.1 -attrs==21.2.0 -backoff==1.10.0 -base58==2.1.0 -cffi==1.14.5 -chardet==4.0.0 -idna==3.2 -loguru==0.5.3 -multidict==5.1.0 -pycares==4.0.0 -pycparser==2.20 -typing-extensions==3.10.0.0 -yarl==1.6.3 From aa522ec7962141adf30fa6a4541269aa4bcac5c2 Mon Sep 17 00:00:00 2001 From: Eran Davidovich Date: Mon, 29 Nov 2021 18:56:36 +0200 Subject: [PATCH 5/5] missing flake8 dependency --- .github/workflows/pytest.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2bda159..194c2a1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -18,6 +18,11 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + - name: Lint with flake8 run: | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics