2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, setuptools
|
|
|
|
, proton-core
|
|
|
|
, proton-vpn-killswitch
|
|
|
|
, proton-vpn-logger
|
|
|
|
, jinja2
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
buildPythonPackage rec {
|
2024-01-02 11:29:13 +00:00
|
|
|
pname = "proton-vpn-connection";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.11.3";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ProtonVPN";
|
|
|
|
repo = "python-proton-vpn-connection";
|
2024-02-29 20:09:43 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-RuLnc/olI8S09WFG126N2xZgW4gf+DDpRstcelqMhs4=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jinja2
|
|
|
|
proton-core
|
|
|
|
proton-vpn-killswitch
|
|
|
|
proton-vpn-logger
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
2024-02-29 20:09:43 +00:00
|
|
|
--replace-fail "--cov=proton.vpn.connection --cov-report html --cov-report term" ""
|
2024-01-02 11:29:13 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "proton.vpn.connection" ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Permission denied: '/run'
|
|
|
|
"test_ensure_configuration_file_is_deleted"
|
|
|
|
"test_ensure_generate_is_returning_expected_content"
|
|
|
|
"test_ensure_same_configuration_file_in_case_of_duplicate"
|
|
|
|
"test_ensure_configuration_file_is_created"
|
|
|
|
"test_wireguard_config_content_generation"
|
|
|
|
"test_wireguard_with_malformed_credentials"
|
|
|
|
"test_wireguard_with_non_certificate"
|
|
|
|
"test_wireguard_without_settings"
|
|
|
|
# Neiter udp or tcp are working
|
|
|
|
"test_ovpnconfig_with_settings"
|
|
|
|
"test_ovpnconfig_with_missing_settings_applies_expected_defaults"
|
|
|
|
"test_ovpnconfig_with_malformed_params"
|
|
|
|
"test_ovpnconfig_with_certificate_and_malformed_credentials"
|
|
|
|
"test_ovpnconfig_with_malformed_server"
|
|
|
|
"test_ovpnconfig_with_malformed_server_and_credentials"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Defines the interface that VPN connection backends should implement";
|
|
|
|
homepage = "https://github.com/ProtonVPN/python-proton-vpn-connection";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
|
|
|
};
|
|
|
|
}
|