Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions .github/workflows/generate-previews.yaml

This file was deleted.

10 changes: 4 additions & 6 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
env:
PY_VERSION: '3.10'
PY_VERSION: '3.11'
permissions: {}

jobs:
Expand All @@ -28,12 +28,10 @@ jobs:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: pdm-project/setup-pdm@v4.6
- uses: astral-sh/setup-uv@v10.2.0
with:
python-version: ${{ env.PY_VERSION }}
cache: true
cache-dependency-path: pylock.toml
- name: Install project
run: pdm install -G :all
run: uv sync --locked --dev --all-extras --managed-python
- name: Run prek
run: pdm run prek run -a
run: uv run prek run -a
12 changes: 5 additions & 7 deletions .github/workflows/publishing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
env:
PY_VERSION: '3.14'
PY_VERSION: '3.11'
permissions: {}

jobs:
Expand All @@ -30,15 +30,13 @@ jobs:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: pdm-project/setup-pdm@v4.6
- uses: astral-sh/setup-uv@v10.2.0
with:
python-version: ${{ env.PY_VERSION }}
cache: true
cache-dependency-path: pylock.toml
- name: Install project
run: pdm install --prod
run: uv sync --locked --no-dev
- name: Run build
run: pdm build
run: uv build
- uses: actions/upload-artifact@v7.0.1
with:
name: python-package-distributions
Expand All @@ -54,7 +52,7 @@ jobs:
with:
name: python-package-distributions
path: dist/
- uses: astral-sh/setup-uv@v10.1.0
- uses: astral-sh/setup-uv@v10.2.0
with:
python-version: ${{ env.PY_VERSION }}
- name: Validate dist
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,27 @@ jobs:
- macos-latest
- windows-latest
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
- '3.15'

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: pdm-project/setup-pdm@v4.6
- uses: astral-sh/setup-uv@v10.2.0
with:
python-version: ${{ matrix.python-version }}
cache: true
cache-dependency-path: pylock.toml
- name: Install project
run: pdm install -G tests
run: uv sync --locked --no-dev --all-extras --group tests --managed-python
- name: Run tests
env:
MEDIUX__BASE_URL: ${{ secrets.MEDIUX__BASE_URL }}
MEDIUX__TOKEN: ${{ secrets.MEDIUX__TOKEN }}
run: pdm run pytest
run: uv run --no-dev pytest

check:
if: always()
Expand Down
21 changes: 6 additions & 15 deletions .github/zizmor.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
rules:
unpinned-uses:
ignore:
- generate-previews.yaml
- linting.yaml
- testing.yaml
- publishing.yaml
anonymous-definition:
ignore:
- 'generate-previews.yaml:27'
- 'linting.yaml:22'
- 'publishing.yaml:24'
- 'publishing.yaml:47'
- 'publishing.yaml:63'
- 'publishing.yaml:45'
- 'publishing.yaml:61'
- 'testing.yaml:20'
- 'testing.yaml:55'
- 'testing.yaml:53'
undocumented-permissions:
ignore:
- 'generate-previews.yaml:29'
- 'publishing.yaml:72'
- 'publishing.yaml:70'
secrets-outside-env:
ignore:
- 'testing.yaml:51'
- 'testing.yaml:52'
artipacked:
ignore:
- 'generate-previews.yaml:33'
cache-poisoning:
ignore:
- 'publishing.yaml:57'
- 'testing.yaml:49'
- 'testing.yaml:50'
7 changes: 7 additions & 0 deletions docs/generate-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

COLUMNS=120 pdm run mediux-posters --generate-help-preview
COLUMNS=120 pdm run mediux-posters media --generate-help-preview
COLUMNS=120 pdm run mediux-posters set --generate-help-preview
COLUMNS=120 pdm run mediux-posters settings --generate-help-preview
COLUMNS=120 pdm run mediux-posters sync --generate-help-preview
2 changes: 1 addition & 1 deletion mediux_posters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"setup_logging",
]
__project__ = "mediux-posters"
__version__ = "2026.1.1"
__version__ = "2026.2.0"

import logging
import os
Expand Down
10 changes: 5 additions & 5 deletions mediux_posters/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import logging
from collections.abc import Generator
from dataclasses import dataclass
from datetime import datetime, timezone
from enum import Enum
from datetime import UTC, datetime
from enum import StrEnum
from pathlib import Path
from platform import python_version
from typing import Final, Protocol, TypeVar
Expand Down Expand Up @@ -57,7 +57,7 @@
}


class ServiceOption(str, Enum):
class ServiceOption(StrEnum):
PLEX = Plex.__name__
JELLYFIN = Jellyfin.__name__

Expand All @@ -77,7 +77,7 @@ class ProcessContext:
store_cover: bool = True


class Action(str, Enum):
class Action(StrEnum):
SKIP = "Skip"
DOWNLOAD = "Download"
UPLOAD = "Upload"
Expand Down Expand Up @@ -302,7 +302,7 @@ def upload_image(
ctx.service.cache.update_service(
key=cache_key,
service=type(ctx.service).__name__, # ty: ignore[invalid-argument-type]
timestamp=datetime.now(tz=timezone.utc),
timestamp=datetime.now(tz=UTC),
)
setattr(obj, uploaded_attr, True)

Expand Down
4 changes: 2 additions & 2 deletions mediux_posters/mediux/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]

from datetime import date, datetime
from enum import Enum
from enum import StrEnum
from typing import Annotated

from pydantic import AliasPath, BeforeValidator, Field, TypeAdapter, ValidationError
Expand All @@ -29,7 +29,7 @@ def int_or_str(val: int | str | None) -> int | str | None:
class MediuxModel(BaseModel, extra="ignore"): ...


class FileType(str, Enum):
class FileType(StrEnum):
ALBUM = "album"
BACKDROP = "backdrop"
LOGO = "logo"
Expand Down
4 changes: 2 additions & 2 deletions mediux_posters/services/plex/schemas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__all__ = ["Collection", "Episode", "Library", "Movie", "Season", "Show"]

from enum import Enum
from enum import StrEnum
from typing import Any

from pydantic import Field, model_validator
Expand All @@ -19,7 +19,7 @@
class PlexModel(BaseModel, alias_generator=to_camel, extra="ignore"): ...


class MediaType(str, Enum):
class MediaType(StrEnum):
ARTIST = "artist"
MOVIE = "movie"
PHOTO = "photo"
Expand Down
13 changes: 2 additions & 11 deletions mediux_posters/settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
__all__ = ["Settings"]

import tomllib as tomlreader
from pathlib import Path
from typing import Annotated, Any, ClassVar
from typing import Annotated, Any, ClassVar, Self

import tomli_w as tomlwriter
from pydantic import BeforeValidator, Field
Expand All @@ -11,16 +12,6 @@
from mediux_posters.console import CONSOLE
from mediux_posters.utils import BaseModel, blank_is_none, flatten_dict

try:
from typing import Self # Python >= 3.11 # ty: ignore[unresolved-import]
except ImportError:
from typing_extensions import Self # Python < 3.11

try:
import tomllib as tomlreader # Python >= 3.11 # ty: ignore[unresolved-import]
except ModuleNotFoundError:
import tomli as tomlreader # Python < 3.11


class SettingsModel(BaseModel, extra="ignore"): ...

Expand Down
4 changes: 2 additions & 2 deletions mediux_posters/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import re
import unicodedata
from enum import Enum
from enum import StrEnum
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -31,7 +31,7 @@ def display(self) -> None:
CONSOLE.print(Panel.fit("\n".join(content_vals), title=type(self).__name__))


class MediaType(str, Enum):
class MediaType(StrEnum):
SHOW = "show"
COLLECTION = "collection"
MOVIE = "movie"
Expand Down
Loading
Loading