Merge pull request #211660 from dotlambda/johnnycanencrypt-0.12.0

python310Packages.johnnycanencrypt: 0.11.0 -> 0.12.0
This commit is contained in:
0x4A6F 2023-01-20 00:59:42 +01:00 committed by GitHub
commit be83a2edc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchPypi
, buildPythonPackage
, rustPlatform
, llvmPackages
@ -8,36 +8,31 @@
, pcsclite
, nettle
, httpx
, numpy
, pytestCheckHook
, pythonOlder
, vcrpy
, PCSC
, libiconv
}:
buildPythonPackage rec {
pname = "johnnycanencrypt";
version = "0.11.0";
disabled = pythonOlder "3.7";
version = "0.12.0";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "kushaldas";
repo = "johnnycanencrypt";
rev = "v${version}";
hash = "sha256-YhuYejxuKZEv1xQ1fQcXSkt9I80iJOJ6MecG622JJJo=";
src = fetchPypi {
inherit pname version;
hash = "sha256-aGhM/uyYE7l0h6L00qp+HRUVaj7s/tnHWIHJpLAkmR4=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit patches src;
inherit src;
name = "${pname}-${version}";
hash = "sha256-r2NU1e3yeZDLOBy9pndGYM3JoH6BBKQkXMLsJR6PTRs=";
hash = "sha256-fcwDxkUFtA6LS77xdLktNnZJXmyl/ZzArvIW69SPpmI=";
};
format = "pyproject";
# https://github.com/kushaldas/johnnycanencrypt/issues/125
patches = [ ./Cargo.lock.patch ];
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
propagatedBuildInputs = [
@ -61,31 +56,23 @@ buildPythonPackage rec {
libiconv
];
# Needed b/c need to check AFTER python wheel is installed (using Rust Build, not buildPythonPackage)
doCheck = false;
doInstallCheck = true;
installCheckInputs = [
checkInputs = [
pytestCheckHook
numpy
vcrpy
];
preCheck = ''
export TESTDIR=$(mktemp -d)
cp -r tests/ $TESTDIR
pushd $TESTDIR
'';
postCheck = ''
popd
# import from $out
rm -r johnnycanencrypt
'';
pythonImportsCheck = [ "johnnycanencrypt" ];
meta = with lib; {
homepage = "https://github.com/kushaldas/johnnycanencrypt";
changelog = "https://github.com/kushaldas/johnnycanencrypt/blob/v${version}/changelog.md";
description = "Python module for OpenPGP written in Rust";
license = licenses.gpl3Plus;
license = licenses.lgpl3Plus;
maintainers = with maintainers; [ _0x4A6F ];
};
}