Skip to content

Commit

Permalink
lint -> pre-commit. Remove requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Dec 4, 2019
1 parent 87884d1 commit 1292317
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Dependency & linter
name: Dependency & linting/pre-commit

on: [push]

jobs:
lint:

pre_commit:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
Expand All @@ -13,42 +13,53 @@ jobs:

steps:
- uses: actions/checkout@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Lint with flake8
pip install -U setuptools
pip install pre-commit
- name: Run pre-commit
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
# - name: Lint with flake8
# run: |
# pip install flake8
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

deps:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.7]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install latest versions of immediate dependencies
run: |
python -m pip install --upgrade pip
# first install fixed deps
pip install -r requirements.txt
# now try upgrading all of them and run the tests
pip install -e -U --upgrade-strategy eager .\[all\]
pip install -U setuptools
# Install all dependencies upgrading with eager strategy
pip install -U --upgrade-strategy eager -e .[all]
- name: Run tests on updated packages
run: |
py.test
pytest -rs --cov=./
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ python:
- "3.7"
- "3.8"
install:
- pip install -r requirements.txt
- pip install -e .[testing,django,elastic]
- docker pull quen2404/openapi-diff
script:
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

0 comments on commit 1292317

Please sign in to comment.