nixpkgs/pkgs/by-name/tv/tvnamer/package.nix
Martin Weinelt ae4a1a485a
treewide: add explicit format attribute for Python packages
If a Python package does not come with either `format` or `pyproject` we
consider it a setuptools build, that calls `setup.py` directly, which is
deprecated.

This change, as a first step, migrates a large chunk of these packages to
set setuptools as their explicit format

This is so we can unify the problem space for the next step of the
migration.
2025-07-02 05:56:47 +02:00

57 lines
1.3 KiB
Nix

{
lib,
python3,
fetchPypi,
}:
let
python' = python3.override {
self = python';
packageOverrides = final: prev: {
# tvdb_api v3.1.0 has a hard requirement on requests-cache < 0.6
requests-cache = prev.requests-cache.overridePythonAttrs (oldAttrs: rec {
version = "0.5.2";
src = fetchPypi {
inherit (oldAttrs) pname;
inherit version;
sha256 = "sha256-gTAjJpaGBF+OAeIonMHn6a5asi3dHihJqQk6s6tycOs=";
};
nativeBuildInputs = with final; [
setuptools
];
# too many changes have been made to requests-cache based on version 0.6 so
# simply disable tests
doCheck = false;
});
};
};
pypkgs = python'.pkgs;
in
pypkgs.buildPythonApplication rec {
pname = "tvnamer";
version = "3.0.4";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "dc2ea8188df6ac56439343630466b874c57756dd0b2538dd8e7905048f425f04";
};
propagatedBuildInputs = with pypkgs; [ tvdb-api ];
# no tests from pypi
doCheck = false;
meta = with lib; {
description = "Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api";
homepage = "https://github.com/dbr/tvnamer";
license = licenses.unlicense;
maintainers = with maintainers; [ peterhoeg ];
mainProgram = "tvnamer";
};
}