Files
nixpkgs/pkgs/development/python-modules/proton-vpn-api-core/default.nix
T
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00

94 lines
2.0 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
cryptography,
setuptools,
jinja2,
proton-core,
pynacl,
aiohttp,
pyopenssl,
pytest-asyncio,
requests,
sentry-sdk,
pyxdg,
distro,
pytestCheckHook,
pytest-cov-stub,
}:
buildPythonPackage rec {
pname = "proton-vpn-api-core";
version = "0.42.3";
pyproject = true;
src = fetchFromGitHub {
owner = "ProtonVPN";
repo = "python-proton-vpn-api-core";
rev = "v${version}";
hash = "sha256-/GV5DFWc6RBWP723APNxn9FTxdePumYOtdwDQEg4ccA=";
};
build-system = [
setuptools
];
dependencies = [
cryptography
distro
jinja2
pynacl
proton-core
sentry-sdk
pyxdg
];
pythonImportsCheck = [
"proton.vpn.core"
"proton.vpn.connection"
"proton.vpn.killswitch.interface"
"proton.vpn.logging"
"proton.vpn.session"
];
nativeCheckInputs = [
aiohttp
pyopenssl
pytest-asyncio
requests
pytestCheckHook
pytest-cov-stub
];
# Needed for `pythonImportsCheck`, `preCheck` happens between `pythonImportsCheckPhase` and `pytestCheckPhase`.
postInstall = ''
# Needed for Permission denied: '/homeless-shelter'
export HOME=$(mktemp -d)
export XDG_RUNTIME_DIR=$(mktemp -d)
'';
disabledTests = [
# Permission denied: '/run'
"test_ensure_configuration_file_is_created"
"test_ovpnconfig_with_certificate"
"test_ovpnconfig_with_settings"
"test_wireguard_config_content_generation"
"test_wireguard_with_non_certificate"
"test_ensure_generate_is_returning_expected_content"
"test_ensure_same_configuration_file_in_case_of_duplicate"
"test_ensure_configuration_file_is_deleted"
];
meta = {
description = "Acts as a facade to the other Proton VPN components, exposing a uniform API to the available Proton VPN services";
homepage = "https://github.com/ProtonVPN/python-proton-vpn-api-core";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
sebtm
rapiteanu
];
};
}