4 Commits

Author SHA1 Message Date
5f30c68edb Update dependency tox to v4.20.0
Some checks failed
Tests / test (3.10) (pull_request) Successful in 1m44s
Tests / test (3.12) (pull_request) Successful in 1m14s
Tests / test (3.8) (pull_request) Successful in 55s
Tests / test (3.11) (pull_request) Failing after 50s
Tests / test (3.9) (pull_request) Failing after 55s
2024-09-19 06:56:49 +03:00
956c4c30ea Added handling for SVC_PARAM error
Some checks failed
Tests / test (3.10) (push) Successful in 1s
Tests / test (3.11) (push) Successful in 0s
Tests / test (3.12) (push) Failing after 7s
Tests / test (3.8) (push) Successful in -2s
Tests / test (3.9) (push) Successful in -4s
2024-09-15 00:55:16 +02:00
c70982755d Improved and cleaned up imports 2024-09-15 00:54:56 +02:00
483aae38b3 Added Python 3.12 to testing matrix
All checks were successful
Tests / test (3.10) (push) Successful in 23s
Tests / test (3.11) (push) Successful in 25s
Tests / test (3.12) (push) Successful in 1m4s
Tests / test (3.8) (push) Successful in 23s
Tests / test (3.9) (push) Successful in 21s
2024-09-08 01:58:25 +02:00
13 changed files with 34 additions and 39 deletions

View File

@@ -15,7 +15,7 @@ jobs:
container: catthehacker/ubuntu:act-latest container: catthehacker/ubuntu:act-latest
strategy: strategy:
matrix: matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@@ -3,15 +3,6 @@
"extends": [ "extends": [
"config:base" "config:base"
], ],
"baseBranches": [
"dev"
],
"pip_requirements": {
"fileMatch": [
"requirements/.*\\.txt$"
],
"enabled": true
},
"packageRules": [ "packageRules": [
{ {
"matchUpdateTypes": [ "matchUpdateTypes": [

View File

@@ -4,7 +4,7 @@ mypy~=1.11.2
pylint==3.2.7 pylint==3.2.7
pytest-cov~=5.0.0 pytest-cov~=5.0.0
pytest~=8.3.2 pytest~=8.3.2
tox==4.18.1 tox==4.20.0
types-ujson~=5.10.0.20240515 types-ujson~=5.10.0.20240515
# Disabled async libraries for now # Disabled async libraries for now

View File

@@ -1,10 +1,10 @@
from datetime import datetime from datetime import datetime
from typing import Any, List, Mapping, Union from typing import Any, List, Mapping, Union
from pyrmv.classes.journey import Journey from ..classes.journey import Journey
from pyrmv.classes.message import Message from ..classes.message import Message
from pyrmv.classes.stop import Stop from ..classes.stop import Stop
from pyrmv.utility import ref_upgrade from ..utility import ref_upgrade
class LineArrival: class LineArrival:

View File

@@ -1,7 +1,7 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta
from typing import List, OrderedDict, Union from typing import List, OrderedDict, Union
from pyrmv.classes import ( from ..classes import (
BoardArrival, BoardArrival,
BoardDeparture, BoardDeparture,
Journey, Journey,
@@ -10,7 +10,7 @@ from pyrmv.classes import (
StopTrip, StopTrip,
Trip, Trip,
) )
from pyrmv.enums import ( from ..enums import (
AffectedJourneyMode, AffectedJourneyMode,
AffectedJourneyStopMode, AffectedJourneyStopMode,
BoardArrivalType, BoardArrivalType,
@@ -22,15 +22,15 @@ from pyrmv.enums import (
SearchMode, SearchMode,
SelectionMode, SelectionMode,
) )
from pyrmv.raw import board_arrival as raw_board_arrival from ..raw import board_arrival as raw_board_arrival
from pyrmv.raw import board_departure as raw_board_departure from ..raw import board_departure as raw_board_departure
from pyrmv.raw import him_search as raw_him_search from ..raw import him_search as raw_him_search
from pyrmv.raw import journey_detail as raw_journey_detail from ..raw import journey_detail as raw_journey_detail
from pyrmv.raw import stop_by_coords as raw_stop_by_coords from ..raw import stop_by_coords as raw_stop_by_coords
from pyrmv.raw import stop_by_name as raw_stop_by_name from ..raw import stop_by_name as raw_stop_by_name
from pyrmv.raw import trip_find as raw_trip_find from ..raw import trip_find as raw_trip_find
from pyrmv.raw import trip_recon as raw_trip_recon from ..raw import trip_recon as raw_trip_recon
from pyrmv.utility import find_exception from ..utility import find_exception
try: try:
from typing import Literal from typing import Literal

View File

@@ -1,8 +1,8 @@
from typing import Any, List, Mapping, Union from typing import Any, List, Mapping, Union
from pyrmv.classes.message import Message from ..classes.message import Message
from pyrmv.classes.stop import Stop from ..classes.stop import Stop
from pyrmv.utility import ref_upgrade from ..utility import ref_upgrade
class Journey: class Journey:

View File

@@ -3,9 +3,9 @@ from typing import Any, List, Mapping, Union
from isodate import Duration, parse_duration from isodate import Duration, parse_duration
from pyrmv.classes.gis import Gis from ..classes.gis import Gis
from pyrmv.classes.message import Message from ..classes.message import Message
from pyrmv.classes.stop import StopTrip from ..classes.stop import StopTrip
class Leg: class Leg:

View File

@@ -3,7 +3,7 @@ from typing import Any, List, Mapping, Union
from isodate import Duration, parse_duration from isodate import Duration, parse_duration
from pyrmv.classes.stop import Stop from ..classes.stop import Stop
class Url: class Url:

View File

@@ -1,6 +1,6 @@
from typing import Any, Mapping, Union from typing import Any, Mapping, Union
from pyrmv.enums.platform_type_type import PlatformTypeType from ..enums.platform_type_type import PlatformTypeType
class PlatformType: class PlatformType:

View File

@@ -3,8 +3,8 @@ from typing import List, Union
from isodate import Duration, parse_duration from isodate import Duration, parse_duration
from pyrmv.classes.leg import Leg from ..classes.leg import Leg
from pyrmv.classes.stop import StopTrip from ..classes.stop import StopTrip
class Trip: class Trip:

View File

@@ -3,7 +3,7 @@
from enum import Enum from enum import Enum
from pyrmv.const import PRODUCTS from ..const import PRODUCTS
class AutoName(Enum): class AutoName(Enum):

View File

@@ -4,7 +4,7 @@ from typing import OrderedDict, Union
from requests import get from requests import get
from xmltodict import parse as xmlparse from xmltodict import parse as xmlparse
from pyrmv.utility import weekdays_bitmask from ..utility import weekdays_bitmask
try: try:
from typing import Literal from typing import Literal

View File

@@ -1,4 +1,4 @@
from pyrmv.errors import ( from ..errors import (
ApiAuthError, ApiAuthError,
ApiFormatError, ApiFormatError,
ApiParamError, ApiParamError,
@@ -26,6 +26,7 @@ from pyrmv.errors import (
SvcNoResultError, SvcNoResultError,
SvcProductError, SvcProductError,
SvcSearchError, SvcSearchError,
SvcParamError,
UnknownError, UnknownError,
) )
@@ -86,6 +87,9 @@ def find_exception(data: dict):
elif data["errorCode"] == "SVC_CTX": elif data["errorCode"] == "SVC_CTX":
raise SvcContextError() raise SvcContextError()
elif data["errorCode"] == "SVC_PARAM":
raise SvcParamError(errorCode=data["errorCode"], errorText=data["errorText"])
elif data["errorCode"] == "SVC_NO_RESULT": elif data["errorCode"] == "SVC_NO_RESULT":
raise SvcNoResultError() raise SvcNoResultError()