diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3c222d9..353cfd4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,10 +6,10 @@ on: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.6.x', '3.7.x', '3.8.x'] + python-version: ['3.7.x', '3.8.x'] steps: - name: Checkout uses: actions/checkout@v1 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9ddd13b..49d389f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,10 +8,10 @@ on: jobs: test-unit: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.6.x', '3.7.x', '3.8.x'] + python-version: ['3.7.x', '3.8.x'] steps: - name: Checkout uses: actions/checkout@v1 diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 7ca8f7d..f54149e 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -6,7 +6,7 @@ on: jobs: release: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/setup-python@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc1dfee..6864198 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: [workflow_dispatch] jobs: release: name: Create Release - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/setup-python@v2 with: diff --git a/requirements-dev.txt b/requirements-dev.txt index 15f173d..6c29ebf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,4 @@ isort mypy pytest pytest-cov +types-requests \ No newline at end of file diff --git a/snooker/api/snooker_org.py b/snooker/api/snooker_org.py index 74a5e74..a8d7d93 100644 --- a/snooker/api/snooker_org.py +++ b/snooker/api/snooker_org.py @@ -1,4 +1,6 @@ -from typing import List, Optional, Type, Literal # noqa +from typing import List, Optional + +from typing_extensions import Literal from snooker.api.base import BaseApi from snooker.models.snooker_org.event import Event @@ -8,6 +10,8 @@ from snooker.models.snooker_org.round import Round from snooker.models.snooker_org.seeding import Seeding +PlayerStatus = Literal['a', 'p'] + class SnookerOrgApi(BaseApi): """ @@ -121,7 +125,7 @@ def event_players(self, event_id: int) -> Optional[List[Player]]: return self._get_two_dimensional(params, model) - def players(self, status: Literal['a', 'p'], season: Optional[int]) -> Optional[List[Player]]: + def players(self, status: PlayerStatus, season: Optional[int]) -> Optional[List[Player]]: """ Retrieve list of all players in the tour in given season. @@ -212,7 +216,7 @@ def head_to_head(self, player_1_id: int, player_2_id: int, season: Optional[int] :param player_1_id: ID of a first player :param player_2_id: ID of a second player - :param season: Season for which data is collected. Use -1 for all seasons (current season if no season provided). + :param season: Season for which data is collected. Use -1 for all seasons (current if no season provided). :return: List of matches (if available) """ params = {'p1': player_1_id, 'p2': player_2_id, 's': season}