Skip to content

Commit

Permalink
fix(dependencies): limit test patch import to test runs
Browse files Browse the repository at this point in the history
Since 1.4.0 a plain `datalad_next` import required `pytest`.
This was due to the datalad-core patch `fix_ria_ora_tests` added in #669,
and was discovered by Debian's CI

Thanks to @aqw for the recommendation.

Closes: #698
Refs: #669, https://ci.debian.net/packages/d/datalad-next/testing/amd64/46884776/
  • Loading branch information
mih committed May 21, 2024
1 parent 1d26a74 commit 905b99b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion datalad_next/patches/patch_ria_ora.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class :class:`SSHRemoteIO`.
2. Improve ORA/RIA-related code so that it also works on Windows.
"""
from os import environ

from . import (
add_method_url2transport_path,
Expand All @@ -15,7 +16,15 @@ class :class:`SSHRemoteIO`.
# The following patches add Windows-support to ORA/RIA code
ria_utils,
replace_ora_remote,
fix_ria_ora_tests,
)

# we only want to import the patches for the tests when actually running
# under pytest. this prevents inflating the runtime dependency with
# test-only dependencies -- which would be needed for the necessary imports
if environ.get("PYTEST_VERSION"):
from . import fix_ria_ora_tests

from . import (
# `replace_create_sibling_ria` be imported after `replace_sshremoteio`
# and `ria_utils`.
replace_create_sibling_ria,
Expand Down

0 comments on commit 905b99b

Please sign in to comment.