Skip to content

Commit

Permalink
🔧 Check type hinting for all Python versions. Disable pylint check of…
Browse files Browse the repository at this point in the history
… Collection[int] as this is broken (pylint-dev/pylint#2377).
  • Loading branch information
jemrobinson committed Aug 18, 2022
1 parent f6146fc commit bd1bbe6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/check-code-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,23 @@ jobs:
- name: Check style with pylint
run: poetry run pylint shui --disable=C0301

check-type-hinting:
name: Test type hinting
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Check type safety with mypy
run: poetry run mypy shui
1 change: 1 addition & 0 deletions shui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Base include for shui (Spark-Hadoop Unix Installer)"""
import pkg_resources

__version__ = pkg_resources.get_distribution("shui").version
4 changes: 2 additions & 2 deletions shui/functions/response.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""Request with built-in retry"""
from typing import Collection
from requests import Response, Session
from requests.adapters import HTTPAdapter
from typing import Collection
from urllib3.util.retry import Retry


def get_with_retry(
url: str,
retries: int = 3,
backoff_factor: float = 0.3,
status_forcelist: Collection[int] = (500, 502, 504),
status_forcelist: Collection[int] = (500, 502, 504), # pylint: disable=unsubscriptable-object
) -> Response:
"""Sends a GET request with retry options"""
session = Session()
Expand Down

0 comments on commit bd1bbe6

Please sign in to comment.