pysportbot 0.0.9__tar.gz → 0.0.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {pysportbot-0.0.9 → pysportbot-0.0.10}/PKG-INFO +2 -3
  2. {pysportbot-0.0.9 → pysportbot-0.0.10}/pyproject.toml +10 -8
  3. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/__init__.py +1 -2
  4. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/service/__main__.py +2 -2
  5. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/service/booking.py +2 -2
  6. pysportbot-0.0.10/pysportbot/service/config_loader.py +7 -0
  7. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/service/config_validator.py +3 -3
  8. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/service/service.py +2 -2
  9. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/utils/logger.py +2 -2
  10. pysportbot-0.0.9/pysportbot/service/config_loader.py +0 -7
  11. {pysportbot-0.0.9 → pysportbot-0.0.10}/LICENSE +0 -0
  12. {pysportbot-0.0.9 → pysportbot-0.0.10}/README.md +0 -0
  13. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/activities.py +0 -0
  14. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/authenticator.py +0 -0
  15. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/bookings.py +0 -0
  16. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/centres.py +0 -0
  17. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/endpoints.py +0 -0
  18. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/service/__init__.py +0 -0
  19. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/service/scheduling.py +0 -0
  20. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/service/threading.py +0 -0
  21. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/session.py +0 -0
  22. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/utils/__init__.py +0 -0
  23. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/utils/errors.py +0 -0
  24. {pysportbot-0.0.9 → pysportbot-0.0.10}/pysportbot/utils/time.py +0 -0
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pysportbot
3
- Version: 0.0.9
3
+ Version: 0.0.10
4
4
  Summary: A python-based bot for automatic resasports slot booking
5
5
  Author: Joshua Falco Beirer
6
6
  Author-email: jbeirer@cern.ch
7
- Requires-Python: >=3.9,<3.14
7
+ Requires-Python: >=3.10,<3.14
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.9
10
9
  Classifier: Programming Language :: Python :: 3.10
11
10
  Classifier: Programming Language :: Python :: 3.11
12
11
  Classifier: Programming Language :: Python :: 3.12
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pysportbot"
3
- version = "v0.0.9"
3
+ version = "v0.0.10"
4
4
  description = "A python-based bot for automatic resasports slot booking"
5
5
  authors = [
6
6
  { name = "Joshua Falco Beirer", email = "jbeirer@cern.ch" }
@@ -14,7 +14,7 @@ packages = [
14
14
  dynamic = ["requires-python", "dependencies"]
15
15
 
16
16
  [tool.poetry.dependencies]
17
- python = ">=3.9,<3.14"
17
+ python = ">=3.10,<3.14"
18
18
  requests = "^2.32.3"
19
19
  beautifulsoup4 = "^4.12.3"
20
20
  pandas = "^2.2.3"
@@ -23,8 +23,8 @@ pytz = "^2024.2"
23
23
  [tool.poetry.group.dev.dependencies]
24
24
  pytest = "^8.3.4"
25
25
  pytest-cov = "^6.0.0"
26
- deptry = "^0.21.2"
27
- mypy = "^1.14.0"
26
+ deptry = "^0.22.0"
27
+ mypy = "^1.14.1"
28
28
  pre-commit = "^4.0.1"
29
29
  tox = "^4.23.2"
30
30
  ipykernel = "^6.29.5"
@@ -37,12 +37,12 @@ mkdocs-material = "^9.5.49"
37
37
  mkdocstrings = {extras = ["python"], version = "^0.27.0"}
38
38
 
39
39
  [build-system]
40
- requires = ["poetry-core>=1.9.1"]
40
+ requires = ["poetry-core>=2.0.1"]
41
41
  build-backend = "poetry.core.masonry.api"
42
42
 
43
43
  [tool.black]
44
44
  line-length = 120
45
- target-version = ['py37']
45
+ target-version = ['py313']
46
46
  preview = true
47
47
 
48
48
  [tool.mypy]
@@ -65,7 +65,7 @@ filterwarnings = [
65
65
  ]
66
66
 
67
67
  [tool.ruff]
68
- target-version = "py37"
68
+ target-version = "py313"
69
69
  line-length = 120
70
70
  fix = true
71
71
  lint.select = [
@@ -108,7 +108,9 @@ lint.ignore = [
108
108
  # Comparison to true should be 'if cond is true:'
109
109
  "E712",
110
110
  # Long exception message
111
- "TRY003"
111
+ "TRY003",
112
+ # Module shadows a Python standard-library module
113
+ "A005"
112
114
  ]
113
115
 
114
116
  [tool.coverage.report]
@@ -1,7 +1,6 @@
1
1
  # pysportbot/sportbot.py
2
2
 
3
3
  import logging
4
- from typing import Optional
5
4
 
6
5
  from pandas import DataFrame
7
6
 
@@ -25,7 +24,7 @@ class SportBot:
25
24
  self._logger.info(f"Time zone: {time_zone}")
26
25
  self._centres = Centres(print_centres)
27
26
  self._session: Session = Session()
28
- self._auth: Optional[Authenticator] = None
27
+ self._auth: Authenticator | None = None
29
28
  self._activities: Activities = Activities(self._session)
30
29
  self._bookings: Bookings = Bookings(self._session)
31
30
  self._df_activities: DataFrame | None = None
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
3
  import argparse
4
- from typing import Any, Dict
4
+ from typing import Any
5
5
 
6
6
  from .config_loader import load_config
7
7
  from .service import run_service
@@ -23,7 +23,7 @@ def main() -> None:
23
23
  )
24
24
  args = parser.parse_args()
25
25
 
26
- config: Dict[str, Any] = load_config(args.config)
26
+ config: dict[str, Any] = load_config(args.config)
27
27
  run_service(
28
28
  config,
29
29
  booking_delay=args.booking_delay,
@@ -1,7 +1,7 @@
1
1
  import time
2
2
  from concurrent.futures import ThreadPoolExecutor, as_completed
3
3
  from datetime import datetime
4
- from typing import Any, Dict
4
+ from typing import Any
5
5
 
6
6
  import pytz
7
7
 
@@ -95,7 +95,7 @@ def attempt_booking(
95
95
 
96
96
  def schedule_bookings(
97
97
  bot: SportBot,
98
- config: Dict[str, Any],
98
+ config: dict[str, Any],
99
99
  booking_delay: int,
100
100
  retry_attempts: int,
101
101
  retry_delay: int,
@@ -0,0 +1,7 @@
1
+ import json
2
+ from typing import Any, cast
3
+
4
+
5
+ def load_config(config_path: str) -> dict[str, Any]:
6
+ with open(config_path) as f:
7
+ return cast(dict[str, Any], json.load(f))
@@ -1,5 +1,5 @@
1
1
  from datetime import datetime
2
- from typing import Any, Dict
2
+ from typing import Any
3
3
 
4
4
  from pysportbot import SportBot
5
5
  from pysportbot.utils.errors import ErrorMessages
@@ -10,7 +10,7 @@ logger = get_logger(__name__)
10
10
  DAY_MAP = {"monday": 0, "tuesday": 1, "wednesday": 2, "thursday": 3, "friday": 4, "saturday": 5, "sunday": 6}
11
11
 
12
12
 
13
- def validate_config(config: Dict[str, Any]) -> None:
13
+ def validate_config(config: dict[str, Any]) -> None:
14
14
  """
15
15
  Validate the overall configuration structure and values.
16
16
 
@@ -48,7 +48,7 @@ def validate_config(config: Dict[str, Any]) -> None:
48
48
  raise ValueError(ErrorMessages.invalid_class_definition())
49
49
 
50
50
 
51
- def validate_activities(bot: SportBot, config: Dict[str, Any]) -> None:
51
+ def validate_activities(bot: SportBot, config: dict[str, Any]) -> None:
52
52
  """
53
53
  Validate that all activities specified in the configuration exist.
54
54
 
@@ -1,4 +1,4 @@
1
- from typing import Any, Dict
1
+ from typing import Any
2
2
 
3
3
  from pysportbot import SportBot
4
4
  from pysportbot.service.booking import schedule_bookings
@@ -8,7 +8,7 @@ from pysportbot.utils.logger import get_logger
8
8
 
9
9
 
10
10
  def run_service(
11
- config: Dict[str, Any],
11
+ config: dict[str, Any],
12
12
  booking_delay: int,
13
13
  retry_attempts: int,
14
14
  retry_delay: int,
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
  import threading
3
3
  from datetime import datetime
4
- from typing import ClassVar, Optional
4
+ from typing import ClassVar
5
5
 
6
6
  import pytz
7
7
 
@@ -52,7 +52,7 @@ class ColorFormatter(logging.Formatter):
52
52
  self.include_threads = include_threads
53
53
  self.thread_colors: dict[str, str] = {} # Initialize empty dictionary
54
54
 
55
- def formatTime(self, record: logging.LogRecord, datefmt: Optional[str] = None) -> str:
55
+ def formatTime(self, record: logging.LogRecord, datefmt: str | None = None) -> str:
56
56
  """
57
57
  Override to format the time in the desired timezone.
58
58
  """
@@ -1,7 +0,0 @@
1
- import json
2
- from typing import Any, Dict, cast
3
-
4
-
5
- def load_config(config_path: str) -> Dict[str, Any]:
6
- with open(config_path) as f:
7
- return cast(Dict[str, Any], json.load(f))
File without changes
File without changes