From 54f1e0e987af878609183240d290b1eec8322109 Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Sun, 7 Jun 2020 03:54:35 +0530 Subject: [PATCH 1/6] Use Python 3.8 instead of Python 3.6 in black pre-commit config Signed-off-by: Nabarun Pal --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2dd651ac..194db227 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,4 +36,4 @@ repos: rev: stable hooks: - id: black - language_version: python3.6 + language_version: python3.8 From 9c76c3c12ecd529d8ee8b167f2d103907609d2f7 Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Sun, 7 Jun 2020 04:37:52 +0530 Subject: [PATCH 2/6] Use Python 3.8 nox environment for lint checks Signed-off-by: Nabarun Pal --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 185e6654..18ca92d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ jobs: include: # Basic Checks - stage: primary - env: NOXSESSION=lint-3.5 + env: NOXSESSION=lint-3.8 - env: NOXSESSION=test-2.7 - env: NOXSESSION=test-3.5 - env: NOXSESSION=docs From 65f40f6f3d5651b4d074e08ce3c5911410fa4ddf Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Sun, 7 Jun 2020 04:38:41 +0530 Subject: [PATCH 3/6] Add Github Actions workflow for lint checks Signed-off-by: Nabarun Pal --- .github/workflows/lint.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..3ff257e1 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,34 @@ +name: Lint +on: + push: + branches-ignore: + - django-2.2 + pull_request: + branches-ignore: + - django-2.2 + +jobs: + lint: + runs-on: ubuntu-16.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install project dependencies + run: | + pip install --upgrade pip + pip install nox + pip install coveralls + - name: Check for linting issues + run: nox -s lint-3.8 From e1d7ae3a97868b6e3534e7f62c16d41271539f86 Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Sun, 7 Jun 2020 04:42:38 +0530 Subject: [PATCH 4/6] Add Github Actions workflow for running tests Signed-off-by: Nabarun Pal --- .github/workflows/test.yaml | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..879db402 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,54 @@ +name: Test +on: + push: + branches-ignore: + - django-2.2 + pull_request: + branches-ignore: + - django-2.2 + +jobs: + test: + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + runs-on: ubuntu-16.04 + env: + DJANGO_SETTINGS_MODULE: "settings.test_settings" + services: + postgres: + image: postgres:12.2 + ports: + - 5432:5432 + redis: + image: redis:6 + ports: + - 6379:6379 + steps: + - name: Checkout code + uses: actions/checkout@v2 + # Python 3.5 needs to be set up here since Django 1.9 does not run beyond that + - name: Setup Python 3.5 + uses: actions/setup-python@v1 + with: + python-version: 3.5 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install CI dependencies + run: | + pip install --upgrade pip + pip install celery==3.1.20 Django==1.9 # required for running celery + pip install nox + pip install codecov + - name: Run celery worker for tests + run: celery -A junction worker -l info --detach + - name: Run tests + run: nox -s test-${{ matrix.python-version }} + - name: Report coverage + uses: codecov/codecov-action@v1 From 637f19e54cda13fe7e991449f6dd0d7acdf1279c Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Sun, 7 Jun 2020 12:53:00 +0530 Subject: [PATCH 5/6] TBR: Comment coverage report -m Signed-off-by: Nabarun Pal --- noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index a10133a7..7629054c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,8 +20,8 @@ def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") - session.run("pytest", "--cov", "-v", "--tb=native") - session.run("coverage", "report", "-m") + session.run("pytest", "--cov", "--cov-report=xml", "-v", "--tb=native") + # session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) From 9af2371998e5d8583964a207dc3f2ddcf4dfe00a Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Sun, 7 Jun 2020 19:11:49 +0530 Subject: [PATCH 6/6] fixup! TBR: Comment coverage report -m Signed-off-by: Nabarun Pal --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 7629054c..3f4a06a3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -21,7 +21,7 @@ def test(session): session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "--cov-report=xml", "-v", "--tb=native") - # session.run("coverage", "report", "-m") + session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"])