1 Commits

Author SHA1 Message Date
ae9b547426 Update dependency black to v23.12.1
Some checks failed
Tests / test (3.11) (pull_request) Has been cancelled
Tests / test (3.8) (pull_request) Has been cancelled
Tests / test (3.9) (pull_request) Has been cancelled
Tests / test (3.10) (pull_request) Has been cancelled
2024-03-26 15:30:23 +02:00
15 changed files with 23 additions and 110 deletions

View File

@@ -11,7 +11,7 @@ on:
jobs: jobs:
test: test:
runs-on: ubuntu-latest-de runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest container: catthehacker/ubuntu:act-latest
strategy: strategy:
matrix: matrix:

1
.gitignore vendored
View File

@@ -154,7 +154,6 @@ cython_debug/
# Custom # Custom
.mise.toml
.vscode/ .vscode/
.venv_linux/ .venv_linux/
.venv_windows/ .venv_windows/

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

@@ -10,7 +10,7 @@ maintainers = [{ name = "Profitroll", email = "profitroll@end-play.xyz" }]
description = "Small module that makes your journey with RMV REST API somehow easier." description = "Small module that makes your journey with RMV REST API somehow easier."
readme = "README.md" readme = "README.md"
requires-python = ">=3.8" requires-python = ">=3.8"
license = { text = "MIT" } license = { text = "GPL3" }
classifiers = [ classifiers = [
"Development Status :: 3 - Alpha", "Development Status :: 3 - Alpha",
"Intended Audience :: Developers", "Intended Audience :: Developers",
@@ -21,7 +21,6 @@ classifiers = [
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities", "Topic :: Utilities",
] ]
@@ -39,14 +38,13 @@ dependencies = { file = "requirements/_.txt" }
[tool.setuptools.dynamic.optional-dependencies] [tool.setuptools.dynamic.optional-dependencies]
dev = { file = "requirements/dev.txt" } dev = { file = "requirements/dev.txt" }
dist = { file = "requirements/dist.txt" }
speed = { file = "requirements/speed.txt" } speed = { file = "requirements/speed.txt" }
[tool.setuptools.packages.find] [tool.setuptools.packages.find]
where = ["src"] where = ["src"]
[tool.black] [tool.black]
target-version = ['py38', 'py39', 'py310', 'py311', 'py312'] target-version = ['py38', 'py39', 'py310', 'py311']
line-length = 94 line-length = 94
[tool.isort] [tool.isort]

View File

@@ -1,3 +1,3 @@
requests~=2.32.3 requests~=2.31.0
xmltodict~=0.13.0 xmltodict~=0.13.0
isodate~=0.6.1 isodate~=0.6.1

View File

@@ -1,12 +1,12 @@
black~=24.8.0 black==23.12.1
isort==5.13.2 build==1.0.3
mypy~=1.11.2 isort==5.12.0
pylint==3.2.7 mypy==1.7.0
pytest-cov~=5.0.0 pylint==3.0.2
pytest~=8.3.2 pytest-asyncio==0.22.0
tox==4.18.1 pytest-cov==4.1.0
types-ujson~=5.10.0.20240515 pytest==7.4.4
tox==4.11.3
# Disabled async libraries for now twine==4.0.2
# types-aiofiles~=24.1.0.20240626 types-aiofiles==23.2.0.20240311
# pytest-asyncio~=0.24.0 types-ujson==5.8.0.1

View File

@@ -1,2 +0,0 @@
build==1.2.2
twine~=5.1.1

View File

@@ -1 +1 @@
ujson~=5.10.0 ujson~=5.8.0

View File

@@ -21,7 +21,7 @@ trip = client.trip_find(origin_id=origin.id, dest_id=destination.id)
""" """
__name__ = "pyrmv" __name__ = "pyrmv"
__version__ = "0.4.0" __version__ = "0.4.0-rc.2"
__license__ = "MIT License" __license__ = "MIT License"
__author__ = "Profitroll" __author__ = "Profitroll"

View File

@@ -3,7 +3,6 @@ from .gis import Gis
from .journey import Journey from .journey import Journey
from .leg import Leg from .leg import Leg
from .message import Channel, Message, Url from .message import Channel, Message, Url
from .platform_type import PlatformType
from .stop import Stop, StopTrip from .stop import Stop, StopTrip
from .ticket import Ticket from .ticket import Ticket
from .trip import Trip from .trip import Trip

View File

@@ -1,17 +0,0 @@
from typing import Any, Mapping, Union
from pyrmv.enums.platform_type_type import PlatformTypeType
class PlatformType:
"""Platform information."""
def __init__(self, data: Mapping[str, Any]):
self.type: PlatformTypeType = (
PlatformTypeType.U if "type" not in data else PlatformTypeType(data.get("type"))
)
self.text: Union[str, None] = data.get("text")
self.hidden: bool = bool(data.get("hidden"))
self.lon: float = data["lon"]
self.lat: float = data["lat"]
self.alt: int = data["alt"]

View File

@@ -4,7 +4,6 @@ from .board_type import BoardArrivalType, BoardDepartureType
from .filter_mode import FilterMode from .filter_mode import FilterMode
from .lang import Language from .lang import Language
from .location_type import LocationType from .location_type import LocationType
from .platform_type_type import PlatformTypeType
from .product import Product from .product import Product
from .rt_mode import RealTimeMode from .rt_mode import RealTimeMode
from .search_mode import SearchMode from .search_mode import SearchMode

View File

@@ -1,51 +0,0 @@
from enum import Enum, auto
class PlatformTypeType(Enum):
"""Enumeration used to declare types of platform type.
* U - Undefined
* PL - Platform/track at train station
* ST - Stop at bus or tram station
* GA - Terminal/Gate at airport
* PI - Pier if ship or ferry
* SL - Slot/parking space if bike or car
* FL - Floor in buildings or at footpath
* CI - Check-in/entrance
* CO - Check-out/exit
* X - No explicit type
* H - Hide platform information
"""
U = auto()
"Undefined"
PL = auto()
"Platform/track at train station"
ST = auto()
"Stop at bus or tram station"
GA = auto()
"Terminal/Gate at airport"
PI = auto()
"Pier if ship or ferry"
SL = auto()
"Slot/parking space if bike or car"
FL = auto()
"Floor in buildings or at footpath"
CI = auto()
"Check-in/entrance"
CO = auto()
"Check-out/exit"
X = auto()
"No explicit type"
H = auto()
"Hide platform information"

View File

@@ -20,12 +20,9 @@ def test_board_departure(api_client: Client, sample_stop_id: str):
def test_him_search(api_client: Client): def test_him_search(api_client: Client):
response = api_client.him_search(time_end=datetime.now() + timedelta(days=10)) assert isinstance(
api_client.him_search(time_end=datetime.now() + timedelta(days=10))[0], Message
if len(response) != 0: )
assert isinstance(response[0], Message)
else:
assert isinstance(response, list)
def test_journey_detail(api_client: Client, sample_journey_id: str): def test_journey_detail(api_client: Client, sample_journey_id: str):

View File

@@ -1,6 +1,6 @@
[tox] [tox]
minversion = 3.8.0 minversion = 3.8.0
envlist = py38, py39, py310, py311, py312 envlist = py38, py39, py310, py311
isolated_build = true isolated_build = true
[gh-actions] [gh-actions]
@@ -9,7 +9,6 @@ python =
3.9: py39 3.9: py39
3.10: py310 3.10: py310
3.11: py311 3.11: py311
3.12: py312
[testenv] [testenv]
setenv = setenv =
@@ -22,3 +21,4 @@ deps =
-r{toxinidir}/requirements/speed.txt -r{toxinidir}/requirements/speed.txt
commands = commands =
pytest --basetemp={envtmpdir} --cov=pyrmv --cov-report term-missing pytest --basetemp={envtmpdir} --cov=pyrmv --cov-report term-missing