Skip to content

Commit

Permalink
Merge pull request #213 from hugovk/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Feb 19, 2022
2 parents ba7776f + 1aeb2f7 commit 4e3dde2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 36 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Lint

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-20.04
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
- uses: pre-commit/action@v2.0.3
29 changes: 12 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Test

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand All @@ -20,19 +20,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ matrix.python-version }}-
cache: pip

- name: Install dependencies
run: |
Expand All @@ -49,6 +37,13 @@ jobs:
coverage report
- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
with:
name: Python ${{ matrix.python-version }}

success:
needs: test
runs-on: ubuntu-latest
steps:
- name: Success
run: echo Test successful
22 changes: 12 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.11.0
rev: v2.31.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.1.0
hooks:
- id: black
args: ["--target-version", "py36"]
args: [--target-version=py37]

- repo: https://github.com/PyCQA/isort
rev: 5.8.0
rev: 5.10.1
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
rev: v2.5.1
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tool.black]
target_version = ['py36']
target_version = ['py37']
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PyYAML
MechanicalSoup>=0.8.0
PyYAML
6 changes: 3 additions & 3 deletions test/test_gpo_member_photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@

class TestSequenceFunctions(unittest.TestCase):
def test_save_metadata(self):
""" Test file is saved """
"""Test file is saved"""
bioguide_id = "A000000"
gpo_member_photos.save_metadata(bioguide_id)
self.assertTrue(os.path.exists("congress/metadata/A000000.yaml"))

def test_resize_photos(self):
""" Test callable """
"""Test callable"""
gpo_member_photos.resize_photos()

def test_pause(self):
""" Test pause delays """
"""Test pause delays"""
# Arrange
last_request_time = None
delay = 1
Expand Down

0 comments on commit 4e3dde2

Please sign in to comment.