Skip to content

Commit

Permalink
[chore] Update dependencies, drop legacy Python support (#44)
Browse files Browse the repository at this point in the history
- Update dependencies
- Use Pydantic v2
- Drop Python 3.7 support
- Fix `docs` response JSON
- Fix model naming for Pydantic V2 compatibility (model can't have same name as field)
- Fix invalid types
  • Loading branch information
nwithan8 authored Mar 28, 2024
1 parent 900e937 commit c2d8f67
Show file tree
Hide file tree
Showing 68 changed files with 2,384 additions and 2,834 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PYTHON_BINARY := python3
VIRTUAL_ENV := venv
VIRTUAL_ENV := .venv
VIRTUAL_BIN := $(VIRTUAL_ENV)/bin
PROJECT_NAME := tautulli
TEST_DIR := tests
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
objectrest==2.0.*
pydantic==1.10.*
pytz==2022.1.*
python-dotenv==0.20.*
packaging==21.3.*
pydantic==2.6.*
pytz==2024.*
python-dotenv==1.0.*
packaging==24.*
typing-extensions
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[metadata]
description-file = README.md
description_file = README.md
1 change: 0 additions & 1 deletion tautulli/PYTHON_VERSIONS.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[
"3.7",
"3.8",
"3.9",
"3.10",
Expand Down
5 changes: 4 additions & 1 deletion tautulli/api/json_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,10 @@ def docs(self) -> dict:
:returns: Dict of data
:rtype: dict
"""
return self._get_json(command='docs')
json_data = self._get_json(command='docs')
if _success_result(json_data=json_data):
return _get_response_data(json_data=json_data)
return static.empty_dict

@property
def docs_md(self) -> str:
Expand Down
122 changes: 61 additions & 61 deletions tautulli/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
from tautulli.models.activity import Activity
from tautulli.models.docs import Docs
from tautulli.models.date_formats import DateFormats
from tautulli.models.library_names import LibraryName
from tautulli.models.newsletter import Newsletter
from tautulli.models.notifier_parameters import NotifierParameter
from tautulli.models.pms_update import PMSUpdate
from tautulli.models.server_identity import ServerIdentity
from tautulli.models.server_list import ServerListEntry
from tautulli.models.servers_info import ServersInfoEntry
from tautulli.models.server_info import ServerInfo
from tautulli.models.usernames import UserName
from tautulli.models.users import User
from tautulli.models.update_check import UpdateCheck
from tautulli.models.collections_table import CollectionsTable
from tautulli.models.export_fields import ExportFields
from tautulli.models.exports_table import ExportsTable
from tautulli.models.geo_ip_lookup import GeoIPLookup
from tautulli.models.history import History
from tautulli.models.home_stats import HomeStat
from tautulli.models.library import Library
from tautulli.models.libraries import LibrariesEntry
from tautulli.models.libraries_table import LibrariesTable
from tautulli.models.library_media_info import LibraryMediaInfo
from tautulli.models.library_user_stats import LibraryUserStats
from tautulli.models.library_watch_time_stats import LibraryWatchTimeStats
from tautulli.models.logs import LogEntry
from tautulli.models.item_user_stats import ItemUserStat
from tautulli.models.item_watch_time_stats import ItemWatchTimeStat
from tautulli.models.get_plays_or_stream_types_by import PlaysOrStreamTypesBy
from tautulli.models.metadata import Metadata
from tautulli.models.new_rating_keys import NewRatingKeys
from tautulli.models.newsletter_config import NewsletterConfig
from tautulli.models.newsletter_log import NewsletterLog
from tautulli.models.newsletter_notification import NewsletterNotification
from tautulli.models.notification import Notification
from tautulli.models.notification_log import NotificationLog
from tautulli.models.notifier_config import NotifierConfig
from tautulli.models.notifiers import Notifier
from tautulli.models.old_rating_keys import OldRatingKeys
from tautulli.models.playlists_table import PlaylistsTable
from tautulli.models.plex_log import PlexLog
from tautulli.models.recently_added import RecentlyAdded
from tautulli.models.server_id import ServerID
from tautulli.models.settings import Settings
from tautulli.models.stream_data import StreamData
from tautulli.models.synced_items import SyncedItems
from tautulli.models.user import User
from tautulli.models.user_ips import UserIPs
from tautulli.models.user_logins import UserLogins
from tautulli.models.user_player_stats import UserPlayerStats
from tautulli.models.user_watch_time_stats import UserWatchTimeStats
from tautulli.models.users_table import UsersTable
from tautulli.models.whois_lookup import WHOISLookup
from tautulli.models.registered_device import RegisteredDevice
from tautulli.models.search_results import SearchResults
from tautulli.models.activity import ActivityModel as Activity
from tautulli.models.docs import DocsModel as Docs
from tautulli.models.date_formats import DateFormatsModel as DateFormats
from tautulli.models.library_names import LibraryNameModel as LibraryName
from tautulli.models.newsletter import NewsletterModel as Newsletter
from tautulli.models.notifier_parameters import NotifierParameterModel as NotifierParameter
from tautulli.models.pms_update import PMSUpdateModel as PMSUpdate
from tautulli.models.server_identity import ServerIdentityModel as ServerIdentity
from tautulli.models.server_list import ServerListEntryModel as ServerListEntry
from tautulli.models.servers_info import ServersInfoEntryModel as ServersInfoEntry
from tautulli.models.server_info import ServerInfoModel as ServerInfo
from tautulli.models.usernames import UserNameModel as UserName
from tautulli.models.users import UserModel as Users
from tautulli.models.update_check import UpdateCheckModel as UpdateCheck
from tautulli.models.collections_table import CollectionsTableModel as CollectionsTable
from tautulli.models.export_fields import ExportFieldsModel as ExportFields
from tautulli.models.exports_table import ExportsTableModel as ExportsTable
from tautulli.models.geo_ip_lookup import GeoIPLookupModel as GeoIPLookup
from tautulli.models.history import HistoryModel as History
from tautulli.models.home_stats import HomeStatModel as HomeStat
from tautulli.models.library import LibraryModel as Library
from tautulli.models.libraries import LibrariesEntryModel as LibrariesEntry
from tautulli.models.libraries_table import LibrariesTableModel as LibrariesTable
from tautulli.models.library_media_info import LibraryMediaInfoModel as LibraryMediaInfo
from tautulli.models.library_user_stats import LibraryUserStatsModel as LibraryUserStats
from tautulli.models.library_watch_time_stats import LibraryWatchTimeStatsModel as LibraryWatchTimeStats
from tautulli.models.logs import LogEntryModel as LogEntry
from tautulli.models.item_user_stats import ItemUserStatModel as ItemUserStat
from tautulli.models.item_watch_time_stats import ItemWatchTimeStatModel as ItemWatchTimeStat
from tautulli.models.get_plays_or_stream_types_by import PlaysOrStreamTypesByModel as PlaysOrStreamTypesBy
from tautulli.models.metadata import MetadataModel as Metadata
from tautulli.models.new_rating_keys import NewRatingKeysModel as NewRatingKeys
from tautulli.models.newsletter_config import NewsletterConfigModel as NewsletterConfig
from tautulli.models.newsletter_log import NewsletterLogModel as NewsletterLog
from tautulli.models.newsletter_notification import NewsletterNotificationModel as NewsletterNotification
from tautulli.models.notification import NotificationModel as Notification
from tautulli.models.notification_log import NotificationLogModel as NotificationLog
from tautulli.models.notifier_config import NotifierConfigModel as NotifierConfig
from tautulli.models.notifiers import NotifierModel as Notifier
from tautulli.models.old_rating_keys import OldRatingKeysModel as OldRatingKeys
from tautulli.models.playlists_table import PlaylistsTableModel as PlaylistsTable
from tautulli.models.plex_log import PlexLogModel as PlexLog
from tautulli.models.recently_added import RecentlyAddedModel as RecentlyAdded
from tautulli.models.server_id import ServerIDModel as ServerID
from tautulli.models.settings import SettingsModel as Settings
from tautulli.models.stream_data import StreamDataModel as StreamData
from tautulli.models.synced_items import SyncedItemsModel as SyncedItems
from tautulli.models.user import UserModel as User
from tautulli.models.user_ips import UserIPsModel as UserIPs
from tautulli.models.user_logins import UserLoginsModel as UserLogins
from tautulli.models.user_player_stats import UserPlayerStatsModel as UserPlayerStats
from tautulli.models.user_watch_time_stats import UserWatchTimeStatsModel as UserWatchTimeStats
from tautulli.models.users_table import UsersTableModel as UsersTable
from tautulli.models.whois_lookup import WHOISLookupModel as WHOISLookup
from tautulli.models.registered_device import RegisteredDeviceModel as RegisteredDevice
from tautulli.models.search_results import SearchResultsModel as SearchResults
# TODO: Need to implement SQLResults
from tautulli.models.tautulli_info import TautulliInfo
from tautulli.models.status import Status
from tautulli.models.server_status import ServerStatus
from tautulli.models.children_metadata import ChildrenMetadata
from tautulli.models.get_plays_or_stream_types_by import PlaysOrStreamTypesBy
from tautulli.models.tautulli_info import TautulliInfoModel as TautulliInfo
from tautulli.models.status import StatusModel as Status
from tautulli.models.server_status import ServerStatusModel as ServerStatus
from tautulli.models.children_metadata import ChildrenMetadataModel as ChildrenMetadata
from tautulli.models.get_plays_or_stream_types_by import PlaysOrStreamTypesByModel as PlaysOrStreamTypesBy
Loading

0 comments on commit c2d8f67

Please sign in to comment.