Skip to content

Commit

Permalink
fix: replace deprecated ci runner (#11)
Browse files Browse the repository at this point in the history
* 🐛 Fix CI runner

* remove deprecated python

* fix linting

* fix typing

* add missing typing extensions

* fix isort

* fix isort
  • Loading branch information
mgorsk1 authored Nov 15, 2023
1 parent 3ae3b70 commit ef8a15d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
release:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ isort
mypy
pytest
pytest-cov
types-requests
10 changes: 7 additions & 3 deletions snooker/api/snooker_org.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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):
"""
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit ef8a15d

Please sign in to comment.