2018-10-10 19:27:12 +01:00
|
|
|
{ pkgs
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-08-29 18:43:50 +01:00
|
|
|
, fetchpatch
|
2018-10-10 19:27:12 +01:00
|
|
|
, cryptography
|
|
|
|
, bcrypt
|
2019-12-20 17:00:37 +00:00
|
|
|
, invoke
|
2018-10-10 19:27:12 +01:00
|
|
|
, pynacl
|
|
|
|
, pyasn1
|
|
|
|
, pytest
|
|
|
|
, pytest-relaxed
|
|
|
|
, mock
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "paramiko";
|
2019-12-19 19:31:16 +00:00
|
|
|
version = "2.7.1";
|
2018-10-10 19:27:12 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-12-19 19:31:16 +00:00
|
|
|
sha256 = "920492895db8013f6cc0179293147f830b8c7b21fdfc839b6bad760c27459d9f";
|
2018-10-10 19:27:12 +01:00
|
|
|
};
|
|
|
|
|
2020-08-29 18:43:50 +01:00
|
|
|
patches = [
|
|
|
|
# fix RSA key loading with cryptography 3.1, remove >2.7.1
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/paramiko/paramiko/commit/81064206bf3cec2ca4372257ff138481e1227b91.patch";
|
|
|
|
sha256 = "01b87ffgyvd6rilp1w1kf7lk29z706ch39nwl21ifklqpjhmazww";
|
|
|
|
})
|
|
|
|
];
|
2019-12-20 17:00:37 +00:00
|
|
|
checkInputs = [ invoke pytest mock pytest-relaxed ];
|
2018-10-10 19:27:12 +01:00
|
|
|
propagatedBuildInputs = [ bcrypt cryptography pynacl pyasn1 ];
|
|
|
|
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
|
|
# 2 sftp tests fail (skip for now)
|
2019-12-20 17:00:37 +00:00
|
|
|
# test_config relies on artifacts to be to downloaded
|
2020-08-29 18:43:50 +01:00
|
|
|
# RSA tests don't have valid keys
|
2018-10-10 19:27:12 +01:00
|
|
|
checkPhase = ''
|
2019-12-20 17:00:37 +00:00
|
|
|
pytest tests \
|
|
|
|
--ignore=tests/test_sftp.py \
|
|
|
|
--ignore=tests/test_config.py
|
2018-10-10 19:27:12 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with pkgs.lib; {
|
|
|
|
homepage = "https://github.com/paramiko/paramiko/";
|
|
|
|
description = "Native Python SSHv2 protocol library";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
This is a library for making SSH2 connections (client or server).
|
|
|
|
Emphasis is on using SSH2 as an alternative to SSL for making secure
|
|
|
|
connections between python scripts. All major ciphers and hash methods
|
|
|
|
are supported. SFTP client and server mode are both supported too.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|