Skip to content
Open
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
47 changes: 44 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
workflow_dispatch:

concurrency:
group: ${{ github.head_ref || github.ref_name }}
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
Expand All @@ -44,7 +44,48 @@ jobs:
flake8 .
pylint PlexAniSync.py TautulliSyncHelper.py ./plexanisync || pylint-exit --error-fail --warn-fail $?
- run: pytest


test-and-list-v2:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4.2.2

- name: Install uv
uses: astral-sh/setup-uv@v6.3.1
with:
version: 0.7.21

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}

# Note: pyright rules are linted on the pre-commit job.
- name: lint
run: uv run pylint PlexAniSync.py TautulliSyncHelper.py ./plexanisync || uv run pylint-exit --error-fail --warn-fail $?

- name: test
run: uv run pytest

pre-commit:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4.2.2

- name: Install uv
uses: astral-sh/setup-uv@v6.3.1
with:
version: 0.7.21

- name: Get current branch state to compare in pre-commit
run: git fetch origin ${{ github.base_ref }}

- name: Run pre-commit
run: uv run pre-commit run --from-ref origin/${{ github.base_ref }} --to-ref HEAD --show-diff-on-failure

build-docker-plexanisync:
needs: lint-and-test
uses: ./.github/workflows/build-docker-image.yml
Expand All @@ -54,7 +95,7 @@ jobs:
eventname: ${{ github.event_name }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
secrets: inherit

build-docker-tautulli:
needs: build-docker-plexanisync
uses: ./.github/workflows/build-docker-image.yml
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ failed_matches\.txt
logo\.psd
settings\.ini
update_anilist\.bat
update_anilist_test\.bat
update_anilist_test\.bat
.ruff_cache
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.12.1"
hooks:
- id: ruff-check
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude_types: [ts]
- id: end-of-file-fixer
exclude_types: [ts]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.33.1
hooks:
- id: check-renovate
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[project]
name = "PlexAniSync"
version = "v1.4.2"
description = "Sync Plex anime library to AniList"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.9"
dependencies = [
"attrs==25.3.0",
"certifi==2025.6.15",
"charset-normalizer==3.4.2",
"coloredlogs==15.0.1",
"distro==1.9.0",
"humanfriendly==10.0",
"idna==3.10",
"inflect==5.6.2",
"jsonschema==4.24.0",
"plexapi==4.17.0",
"pyreadline3==3.5.4",
"pyrsistent==0.20.0",
"regex==2024.11.6",
"requests==2.32.4",
"rpds-py==0.25.1",
"ruyaml==0.91.0",
"sgqlc==16.5",
"urllib3==2.5.0",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project.scripts]
plex_ani_sync = "PlexAniSync:start"

[tool.ruff]
line-length = 160

[tool.ruff.lint]
# Supported rules https://github.com/charliermarsh/ruff/#supported-rules
select = ["E", "F", "B", "W", "PL"]

ignore = [
"PLR2004", # Unused variable in f-string
"PLR5501",
"PLR0912", # Too many branches
"PLR0915", # Too many statements
"PLR0913", # Too many args to function
"PLW2901",
]

[dependency-groups]
dev = [
"pre-commit>=4.2.0",
"ruff>=0.12.4",
"pytest>=8.4.0",
"pylint>=3.3.7",
"pylint-exit>=1.2.0",
]
Loading