From c236e92dbf00b5faed10b2b3096808bf52b327aa Mon Sep 17 00:00:00 2001 From: mgorsk1 Date: Tue, 14 Nov 2023 21:12:04 +0100 Subject: [PATCH 1/7] :bug: Fix CI runner --- .github/workflows/build.yaml | 2 +- .github/workflows/pull_request.yml | 2 +- .github/workflows/pypi_publish.yml | 2 +- .github/workflows/release.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3c222d9..6e8406c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,7 +6,7 @@ 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'] diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9ddd13b..392941c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,7 +8,7 @@ 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'] 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: From 53441a754e6439a665dff751d3f0afe8944e260a Mon Sep 17 00:00:00 2001 From: mgorsk1 Date: Tue, 14 Nov 2023 21:13:36 +0100 Subject: [PATCH 2/7] remove deprecated python --- .github/workflows/build.yaml | 2 +- .github/workflows/pull_request.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6e8406c..353cfd4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,7 +9,7 @@ jobs: 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 392941c..49d389f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -11,7 +11,7 @@ jobs: 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 From 29203332a3a9106558811e758ee58765b0f3b0f1 Mon Sep 17 00:00:00 2001 From: mgorsk1 Date: Tue, 14 Nov 2023 21:14:20 +0100 Subject: [PATCH 3/7] fix linting --- snooker/api/snooker_org.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snooker/api/snooker_org.py b/snooker/api/snooker_org.py index 74a5e74..fa08a90 100644 --- a/snooker/api/snooker_org.py +++ b/snooker/api/snooker_org.py @@ -212,7 +212,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} From 05fa85ee28118add6ab4e52f5d57e7258f820c5e Mon Sep 17 00:00:00 2001 From: mgorsk1 Date: Tue, 14 Nov 2023 21:16:57 +0100 Subject: [PATCH 4/7] fix typing --- snooker/api/snooker_org.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/snooker/api/snooker_org.py b/snooker/api/snooker_org.py index fa08a90..df12c55 100644 --- a/snooker/api/snooker_org.py +++ b/snooker/api/snooker_org.py @@ -1,4 +1,5 @@ -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 @@ -9,6 +10,9 @@ from snooker.models.snooker_org.seeding import Seeding +PlayerStatus = Literal['a', 'p'] + + class SnookerOrgApi(BaseApi): """ Class serving as interface for snooker.org API. @@ -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. From f802a87f3d286b20c65cbc48f1e1eb46d41ad358 Mon Sep 17 00:00:00 2001 From: mgorsk1 Date: Tue, 14 Nov 2023 21:19:43 +0100 Subject: [PATCH 5/7] add missing typing extensions --- requirements-dev.txt | 1 + 1 file changed, 1 insertion(+) 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 From 1acd527e16458889cef9cd6a643fb5fb4cb381cb Mon Sep 17 00:00:00 2001 From: mgorsk1 Date: Wed, 15 Nov 2023 08:46:30 +0100 Subject: [PATCH 6/7] fix isort --- snooker/api/snooker_org.py | 1 + 1 file changed, 1 insertion(+) diff --git a/snooker/api/snooker_org.py b/snooker/api/snooker_org.py index df12c55..d61f7d7 100644 --- a/snooker/api/snooker_org.py +++ b/snooker/api/snooker_org.py @@ -1,4 +1,5 @@ from typing import List, Optional + from typing_extensions import Literal from snooker.api.base import BaseApi From 8da243f96cb5deb698a5853e11a7c5c7cd6a9cd8 Mon Sep 17 00:00:00 2001 From: mgorsk1 Date: Wed, 15 Nov 2023 08:48:21 +0100 Subject: [PATCH 7/7] fix isort --- snooker/api/snooker_org.py | 1 - 1 file changed, 1 deletion(-) diff --git a/snooker/api/snooker_org.py b/snooker/api/snooker_org.py index d61f7d7..a8d7d93 100644 --- a/snooker/api/snooker_org.py +++ b/snooker/api/snooker_org.py @@ -10,7 +10,6 @@ from snooker.models.snooker_org.round import Round from snooker.models.snooker_org.seeding import Seeding - PlayerStatus = Literal['a', 'p']