diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bda0c64e..1a7cb24c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4d351df..3a758427 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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: | @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8daf95ec..01904c3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/pyproject.toml b/pyproject.toml index 475bcb02..95c2f408 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [tool.black] -target_version = ['py36'] +target_version = ['py37'] diff --git a/requirements.txt b/requirements.txt index 99c1b597..126ed7e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -PyYAML MechanicalSoup>=0.8.0 +PyYAML diff --git a/test/test_gpo_member_photos.py b/test/test_gpo_member_photos.py index eaf09f8a..a4e2eb07 100644 --- a/test/test_gpo_member_photos.py +++ b/test/test_gpo_member_photos.py @@ -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