Skip to content

Commit

Permalink
Merge branch 'Taxel:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cjsage52 authored Oct 15, 2024
2 parents b7e9a25 + eb7a69d commit fe44cba
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
layout python python3.8
layout python python3.9

# Pipenv found itself running within a virtual environment,
# so it will automatically use that environment,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- "*.*.*"

env:
DEFAULT_PYTHON: 3.8
DEFAULT_PYTHON: 3.9

jobs:
pypi:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:

env:
DEFAULT_PYTHON: 3.8
DEFAULT_PYTHON: 3.9

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1.3-labs
ARG PYTHON_VERSION=3.12
FROM python:3.12-alpine3.19 AS base
ARG PYTHON_VERSION=3.13
FROM python:$PYTHON_VERSION-alpine3.19 AS base
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_ROOT_USER_ACTION=ignore
WORKDIR /app

Expand Down
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ verify_ssl = true
[dev-packages]

[packages]
apluggy = "==0.9.4"
apluggy = "==1.0.3"
attrs = "==24.2.0"
cattrs = {version="==24.1.2", python_version=">='3.7'"}
certifi = "==2024.8.30"
charset-normalizer = "==3.4.0"
click = "==8.1.7"
decorator = "==5.1.1"
deprecated = "==1.2.14"
humanize = "==4.10.0"
humanize = "==4.11.0"
idna = {version="==3.10", python_version=">='3.5'"}
inquirerpy = "==0.3.4"
markdown-it-py = {version="==3.0.0", python_version=">='3.7'"}
Expand Down
19 changes: 11 additions & 8 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ have a file containing those on your harddrive, you can not use this project.
- [Good practices](#good-practices)
- [Troubleshooting](#troubleshooting)

[python-versions-badge]: https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue
[python-versions-badge]: https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue

## Features

Expand All @@ -74,7 +74,7 @@ have a file containing those on your harddrive, you can not use this project.

## Pre-requisites

The script is known to work with Python 3.8-3.12 versions.
The script is known to work with Python 3.9-3.12 versions.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

__version__ = "0.31.0dev0"
__version__ = "0.32.0dev0"
10 changes: 3 additions & 7 deletions plextraktsync/commands/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from plextraktsync.factory import factory

if TYPE_CHECKING:
from typing import Any, Generator
from collections.abc import Generator
from typing import Any

from requests_cache import CachedRequest, CachedSession

Expand Down Expand Up @@ -42,12 +43,7 @@ def render_xml(data):
return None

root = ElementTree.fromstring(data)
import contextlib

with contextlib.suppress(AttributeError):
# requires python 3.9
# https://stackoverflow.com/a/39482716/2314626
ElementTree.indent(root)
ElementTree.indent(root)

return ElementTree.tostring(root, encoding="utf8").decode("utf8")

Expand Down
11 changes: 0 additions & 11 deletions plextraktsync/decorators/memoize.py

This file was deleted.

3 changes: 2 additions & 1 deletion plextraktsync/plan/Walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from plextraktsync.trakt.TraktItem import TraktItem

if TYPE_CHECKING:
from typing import Any, AsyncGenerator, AsyncIterable, Generator, Iterable
from collections.abc import AsyncGenerator, AsyncIterable, Generator, Iterable
from typing import Any

from plexapi.video import Episode

Expand Down
7 changes: 3 additions & 4 deletions plextraktsync/plex/PlexApi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from datetime import datetime
from functools import cached_property
from functools import cache, cached_property
from typing import TYPE_CHECKING

import plexapi
Expand All @@ -10,7 +10,6 @@
from plexapi.server import SystemAccount, SystemDevice

from plextraktsync.decorators.flatten import flatten_dict, flatten_list
from plextraktsync.decorators.memoize import memoize
from plextraktsync.decorators.retry import retry
from plextraktsync.factory import factory, logging
from plextraktsync.plex.PlexId import PlexId
Expand Down Expand Up @@ -162,11 +161,11 @@ def library_sections(self) -> dict[int, PlexLibrarySection]:

yield section.key, PlexLibrarySection(section, plex=self)

@memoize
@cache
def system_device(self, device_id: int) -> SystemDevice:
return self.server.systemDevice(device_id)

@memoize
@cache
def system_account(self, account_id: int) -> SystemAccount:
return self.server.systemAccount(account_id)

Expand Down
4 changes: 2 additions & 2 deletions plextraktsync/plex/PlexRatings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from __future__ import annotations

from functools import cache
from typing import TYPE_CHECKING

from plextraktsync.decorators.flatten import flatten_dict
from plextraktsync.decorators.memoize import memoize
from plextraktsync.util.Rating import Rating

if TYPE_CHECKING:
Expand Down Expand Up @@ -34,7 +34,7 @@ def get(self, m: PlexLibraryItem, show_id: int = None):
return ratings.get(m.item.ratingKey, None)

@staticmethod
@memoize
@cache
@flatten_dict
def ratings(section: PlexLibrarySection, media_type: str):
key = {
Expand Down
3 changes: 2 additions & 1 deletion plextraktsync/sync/ClearCollectedPlugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Iterable
from collections.abc import Iterable
from typing import TYPE_CHECKING

from plextraktsync.factory import logging
from plextraktsync.media.Media import Media
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/trakt/trakt_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import Iterable
from collections.abc import Iterable

from plextraktsync.trakt.types import TraktMedia

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ classifiers = [
# https://en.wikipedia.org/wiki/History_of_Python#Support
# https://endoflife.date/python
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.8"
requires-python = ">=3.9"

[tool.setuptools.dynamic]
version = {attr = "plextraktsync.__version__"}
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-i https://pypi.org/simple
apluggy==0.9.4
apluggy==1.0.3; python_version >= '3.9'
attrs==24.2.0; python_version >= '3.7'
cattrs==24.1.2; python_version >= '3.8'
certifi==2024.8.30; python_version >= '3.6'
charset-normalizer==3.4.0; python_full_version >= '3.7.0'
click==8.1.7
decorator==5.1.1
decorator==5.1.1; python_version >= '3.5'
deprecated==1.2.14
exceptiongroup==1.2.2; python_version >= '3.7'
humanize==4.10.0; python_version >= '3.8'
humanize==4.11.0; python_version >= '3.9'
idna==3.10; python_version >= '3.6'
inquirerpy==0.3.4
markdown-it-py==3.0.0; python_version >= '3.7' and python_version >= '3.8'
Expand All @@ -17,7 +17,7 @@ oauthlib==3.2.2
pfzy==0.3.4; python_version >= '3.7' and python_version < '4.0'
platformdirs==4.3.6; python_version >= '3.8'
plexapi==4.15.16; python_version >= '3.8'
pluggy==1.5.0
pluggy==1.5.0; python_version >= '3.8'
prompt-toolkit==3.0.48; python_full_version >= '3.7.0'
pygments==2.18.0; python_version >= '3.8'
python-dotenv==1.0.1
Expand Down

0 comments on commit fe44cba

Please sign in to comment.