From 8f42d2676f0435ad2d3dbf4477d132e73860c813 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 16 May 2025 02:47:03 +0100 Subject: [PATCH] upsies: init at 2025.04.21 --- pkgs/by-name/up/upsies/package.nix | 101 +++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 pkgs/by-name/up/upsies/package.nix diff --git a/pkgs/by-name/up/upsies/package.nix b/pkgs/by-name/up/upsies/package.nix new file mode 100644 index 000000000000..14345ea5a0da --- /dev/null +++ b/pkgs/by-name/up/upsies/package.nix @@ -0,0 +1,101 @@ +{ + lib, + fetchFromGitea, + fetchpatch, + ffmpeg-headless, + mediainfo, + oxipng, + python3Packages, +}: +let + # Taken from `docker/alpine/Dockerfile` + runtimeDeps = [ + ffmpeg-headless + mediainfo + oxipng + ]; +in +python3Packages.buildPythonApplication rec { + pname = "upsies"; + version = "2025.04.21"; + pyproject = true; + + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "plotski"; + repo = "upsies"; + tag = "v${version}"; + hash = "sha256-gjv0HOFV1VdfhVejGbV2+bMxP9BPfB3/3p6nOAYMS34="; + }; + + patches = [ + (fetchpatch { + name = "use-pytest-timeout.patch"; + url = "https://codeberg.org/plotski/upsies/commit/db6b564f8575c913a6fbabb61d5326a073c9b52c.patch"; + hash = "sha256-UeUrZ6ogUSS0FvyNQwwwp8q+FArEK61o+Y2Uh7mrPtw="; + revert = true; + }) + ]; + + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = with python3Packages; [ + aiobtclientapi + async-lru + beautifulsoup4 + countryguess + guessit + httpx + langcodes + natsort + packaging + prompt-toolkit + pydantic + pyimgbox + pyparsebluray + pyxdg + term-image + torf + unidecode + ]; + + nativeCheckInputs = + with python3Packages; + [ + pytest-asyncio + pytest-mock + pytest-timeout + pytest-httpserver + pytestCheckHook + trustme + ] + ++ runtimeDeps; + + disabledTestPaths = [ + # DNS resolution errors in the sandbox on some of the tests + "tests/utils_test/http_test/http_test.py" + "tests/utils_test/http_test/http_tls_test.py" + ]; + + preCheck = '' + # `utils.is_running_in_development_environment` expects it in tests + export VIRTUAL_ENV=1 + ''; + + makeWrapperArgs = [ + "--suffix" + "PATH" + ":" + (lib.makeBinPath runtimeDeps) + ]; + + meta = with lib; { + description = "a toolkit for collecting, generating, normalizing and sharing video metadata"; + homepage = "https://upsies.readthedocs.io/"; + license = with licenses; [ gpl3Plus ]; + mainProgram = "upsies"; + maintainers = with maintainers; [ ambroisie ]; + }; +}