Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace deprecated ci runner #11

Merged
merged 7 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading