python312Packages.aeidon: modernize (#338224)

This commit is contained in:
Kerstin 2024-08-30 12:18:54 +02:00 committed by GitHub
commit 72ae6d10a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,10 +1,8 @@
{ {
lib, lib,
buildPythonPackage, buildPythonPackage,
fetchPypi, fetchFromGitHub,
gettext, setuptools,
flake8,
isocodes,
pytestCheckHook, pytestCheckHook,
charset-normalizer, charset-normalizer,
}: }:
@ -12,35 +10,27 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "aeidon"; pname = "aeidon";
version = "1.15"; version = "1.15";
pyproject = true;
src = fetchPypi { src = fetchFromGitHub {
pname = "aeidon"; owner = "otsaloma";
inherit version; repo = "gaupol";
sha256 = "sha256-qGpGraRZFVaW1Jys24qvfPo5WDg7Q/fhvm44JH8ulVw="; rev = "refs/tags/${version}";
hash = "sha256-lhNyeieeiBBm3rNDEU0BuWKeM6XYlOtv1voW8tR8cUM=";
}; };
nativeBuildInputs = [ postPatch = ''
gettext mv setup.py setup_gaupol.py
flake8 substituteInPlace setup-aeidon.py \
]; --replace "from setup import" "from setup_gaupol import"
mv setup-aeidon.py setup.py
dependencies = [ isocodes ];
installPhase = ''
runHook preInstall
python setup.py --without-gaupol install --prefix=$out
runHook postInstall
''; '';
nativeCheckInputs = [ build-system = [ setuptools ];
pytestCheckHook
charset-normalizer
];
# Aeidon is looking in the wrong subdirectory for data dependencies = [ charset-normalizer ];
preCheck = ''
cp -r data aeidon/ nativeCheckInputs = [ pytestCheckHook ];
'';
pytestFlagsArray = [ "aeidon/test" ]; pytestFlagsArray = [ "aeidon/test" ];
@ -52,9 +42,10 @@ buildPythonPackage rec {
pythonImportsCheck = [ "aeidon" ]; pythonImportsCheck = [ "aeidon" ];
meta = with lib; { meta = with lib; {
changelog = "https://github.com/otsaloma/gaupol/releases/tag/${version}";
description = "Reading, writing and manipulationg text-based subtitle files"; description = "Reading, writing and manipulationg text-based subtitle files";
homepage = "https://github.com/otsaloma/gaupol"; homepage = "https://github.com/otsaloma/gaupol";
license = licenses.gpl3Only; license = licenses.gpl3Plus;
maintainers = with maintainers; [ erictapen ]; maintainers = with maintainers; [ erictapen ];
}; };