Skip to content

Commit

Permalink
migrate to python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslan-korneev committed Sep 15, 2023
1 parent e43fd84 commit d111526
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Expand Up @@ -5,8 +5,9 @@
version: 2

sphinx:
configuration: docs/source/conf.py
configuration: docs/source/conf.py

python:
install:
version: "3.8"
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion docs/requirements.txt
@@ -1,4 +1,4 @@
sphinx==7.2.5
Sphinx==7.1.2
pydata-sphinx-theme==0.13.3
sphinxcontrib-youtube==1.2.0
sphinxcontrib-images==0.9.4
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -15,8 +15,8 @@ packages = [
]

[tool.poetry.dependencies]
python = "^3.11"
sphinx = "^7.2.5"
python = "^3.8"
sphinx = "^7.1.2"
sphinxcontrib-youtube = "^1.2.0"
sphinxcontrib-images = "^0.9.4"
pydata-sphinx-theme = "^0.13.3"
Expand Down
26 changes: 13 additions & 13 deletions src/const.py
@@ -1,25 +1,25 @@
from enum import StrEnum
from typing import TypedDict
from enum import Enum
from typing import Dict, List, Optional, TypedDict


JSON_DATA_DIR = "docs/source/json-data"
MEETUPS_DIR = "docs/source/meetups"
SPEAKERS_DIR = "docs/source/speakers"


class JSONType(StrEnum):
class JSONType(str, Enum):
MEETUPS = "meetups"
SPEAKERS = "speakers"


class SpeakerData(TypedDict):
id: int
name: str
linkedin: str | None
github: str | None
description: str | None
contact_info: dict[str, str]
photo: str | None
linkedin: Optional[str]
github: Optional[str]
description: Optional[str]
contact_info: Dict[str, str]
photo: Optional[str]


class LocationData(TypedDict):
Expand All @@ -35,8 +35,8 @@ class TalkReferenceData(TypedDict):
class TalkData(TypedDict):
title: str
abstract: str
speakers: list[int]
references: list[TalkReferenceData]
speakers: List[int]
references: List[TalkReferenceData]


class LightningTalkData(TypedDict):
Expand All @@ -49,9 +49,9 @@ class MeetupData(TypedDict):
title: str
location: LocationData
start: str
talks: list[TalkData]
youtube: str | None
lightning_talks: list[LightningTalkData]
talks: List[TalkData]
youtube: Optional[str]
lightning_talks: List[LightningTalkData]


RSTContent = str
7 changes: 4 additions & 3 deletions src/loading.py
@@ -1,9 +1,10 @@
import json
from typing import List

from src.const import JSON_DATA_DIR, JSONType, MeetupData, SpeakerData


def get_json_objects(type_: JSONType, *ids) -> list:
def get_json_objects(type_: JSONType, *ids) -> List:
with open(f"{JSON_DATA_DIR}/{type_}.json", "r") as file:
data = json.load(file)

Expand All @@ -13,9 +14,9 @@ def get_json_objects(type_: JSONType, *ids) -> list:
return [instance for instance in data if instance["id"] in ids]


def get_meetups(*ids) -> list[MeetupData]:
def get_meetups(*ids) -> List[MeetupData]:
return get_json_objects(JSONType.MEETUPS, *ids)


def get_speakers(*ids) -> list[SpeakerData]:
def get_speakers(*ids) -> List[SpeakerData]:
return get_json_objects(JSONType.SPEAKERS, *ids)

0 comments on commit d111526

Please sign in to comment.