python3Packages.emv: refactored code

switched to Codeberg
switched to finalAttrs
switched to pythonRelaxDeps and pythonRemoveDeps
This commit is contained in:
Letgamer
2026-04-12 16:08:39 +02:00
parent 5d428d54b5
commit 003406ee9c
+18 -16
View File
@@ -1,7 +1,7 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchFromCodeberg,
click,
pyscard,
pycountry,
@@ -10,27 +10,29 @@
setuptools,
}:
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "emv";
version = "1.0.14";
pyproject = true;
src = fetchFromGitHub {
src = fetchFromCodeberg {
owner = "russss";
repo = "python-emv";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-MnaeQZ0rA3i0CoUA6HgJQpwk5yo4rm9e+pc5XzRd1eg=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail '"enum-compat==0.0.3",' "" \
--replace-fail '"argparse==1.4.0",' "" \
--replace-fail "click==7.1.2" "click" \
--replace-fail "pyscard==2.0.0" "pyscard" \
--replace-fail "pycountry==20.7.3" "pycountry" \
--replace-fail "terminaltables==3.1.0" "terminaltables"
'';
pythonRelaxDeps = [
"click"
"pyscard"
"pycountry"
"terminaltables"
];
pythonRemoveDeps = [
"enum-compat"
"argparse"
];
build-system = [ setuptools ];
@@ -47,10 +49,10 @@ buildPythonPackage rec {
meta = {
description = "Implementation of the EMV chip-and-pin smartcard protocol";
homepage = "https://github.com/russss/python-emv";
changelog = "https://github.com/russss/python-emv/releases/tag/v${version}";
homepage = "https://codeberg.org/russss/python-emv/";
changelog = "https://codeberg.org/russss/python-emv/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ lukegb ];
mainProgram = "emvtool";
};
}
})