Skip to content

Commit 9537bd5

Browse files
committed
python312Packages.{proton-vpn-api-core,proton-vpn-network-manager}: Fix import tests
When pyxdg is available the dirs will use xdg vars https://www.github.com/ProtonVPN/python-proton-core/blob/e87d1e3b5fc70883adc02ef2e2d9b0eb360b83ba/proton/utils/environment.py#L56-L102
1 parent 99ceb33 commit 9537bd5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pkgs/development/python-modules/proton-vpn-api-core/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
pytest-asyncio,
1313
requests,
1414
sentry-sdk,
15+
pyxdg,
1516
distro,
1617
pytestCheckHook,
1718
pytest-cov-stub,
@@ -40,6 +41,7 @@ buildPythonPackage rec {
4041
pynacl
4142
proton-core
4243
sentry-sdk
44+
pyxdg
4345
];
4446

4547
pythonImportsCheck = [
@@ -59,9 +61,11 @@ buildPythonPackage rec {
5961
pytest-cov-stub
6062
];
6163

64+
# Needed for `pythonImportsCheck`, `preCheck` happens between `pythonImportsCheckPhase` and `pytestCheckPhase`.
6265
postInstall = ''
6366
# Needed for Permission denied: '/homeless-shelter'
6467
export HOME=$(mktemp -d)
68+
export XDG_RUNTIME_DIR=$(mktemp -d)
6569
'';
6670

6771
disabledTests = [

pkgs/development/python-modules/proton-vpn-network-manager/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
proton-vpn-local-agent,
1313
pycairo,
1414
pygobject3,
15+
pyxdg,
1516
pytest-asyncio,
1617
pytestCheckHook,
1718
pytest-cov-stub,
@@ -46,6 +47,7 @@ buildPythonPackage rec {
4647
proton-vpn-local-agent
4748
pycairo
4849
pygobject3
50+
pyxdg
4951
];
5052

5153
postPatch = ''
@@ -67,9 +69,11 @@ buildPythonPackage rec {
6769
pytest-asyncio
6870
];
6971

72+
# Needed for `pythonImportsCheck`, `preCheck` happens between `pythonImportsCheckPhase` and `pytestCheckPhase`.
7073
preCheck = ''
7174
# Needed for Permission denied: '/homeless-shelter'
7275
export HOME=$(mktemp -d)
76+
export XDG_RUNTIME_DIR=$(mktemp -d)
7377
'';
7478

7579
meta = {

0 commit comments

Comments
 (0)