Skip to content

Commit f03cff1

Browse files
committed
Don't add --ignore option implicitly
After local testing, it seems that it has no effect for out-of-tree builds. I remember it working in the past but maybe I missed something. Because I can't make it work (--ignore-glob also doesn't), I'm instead opting to print a helpful warning in case `src/` is passed with an out-of-tree build.
1 parent 7d0ee45 commit f03cff1

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

.spin/cmds.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,17 @@ def sdist(pyproject_build_args):
9494
def test(*, parent_callback, doctest=False, **kwargs):
9595
pytest_args = kwargs.get('pytest_args', ())
9696

97-
is_editable_install = _is_editable_install_of_same_source("scikit-image")
98-
99-
if not is_editable_install:
100-
# We want to support both editable and out-of-tree installations.
101-
# For out-of-tree installations, selecting `src/` as a test path fails.
102-
# Pytest doesn't expect the doctests' sources and installation to be
103-
# different. Avoid this - even if user specifies it by ignoring `src/`
104-
# explicitly if not using an editable install
105-
pytest_args = pytest_args + ('--ignore=./src/',)
97+
is_out_of_tree_build = not _is_editable_install_of_same_source("scikit-image")
98+
if is_out_of_tree_build and "src" in str(pytest_args):
99+
click.secho(
100+
"WARN: Found 'src' in test arguments and using out-of-tree build. "
101+
"For out-of-tree builds, selecting `src/` as a test path fails. "
102+
"Pytest doesn't expect test sources and installation to be different. "
103+
"Avoid passing `src/` or use an editable install (`spin install`) "
104+
"to avoid this.",
105+
fg="yellow",
106+
bold=True,
107+
)
106108

107109
if doctest:
108110
if '--doctest-plus' not in pytest_args:

0 commit comments

Comments
 (0)