Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest now unintentional runtime dependency #698

Closed
mih opened this issue May 21, 2024 · 1 comment · Fixed by #701
Closed

pytest now unintentional runtime dependency #698

mih opened this issue May 21, 2024 · 1 comment · Fixed by #701

Comments

@mih
Copy link
Member

mih commented May 21, 2024

Look here: https://ci.debian.net/packages/d/datalad-next/testing/amd64/46884776/#S4

A plain import now requires pytest. This is due to the datalad-core patch fixing up some tests that was introduced with #669

This needs to be undone.

Ping @christian-monch for awareness.

@mih mih changed the title pytest nonw unintentional runtime dependency pytest now unintentional runtime dependency May 21, 2024
@aqw
Copy link

aqw commented May 21, 2024

It might be possible to guard the import of the patch to detect if pytest is running:

import os
if os.environ.get("PYTEST_VERSION") is not None:
    import pytest

Or alternatively sys._called_from_test.

mih added a commit to mih/datalad-next that referenced this issue May 21, 2024
Since 1.4.0 a plain `datalad_next` import required `pytest`.
This was due to the datalad-core patch `fix_ria_ora_tests` add in datalad#669,
and was discovered by Debian's CI

Closes: datalad#698
Refs: datalad#669, https://ci.debian.net/packages/d/datalad-next/testing/amd64/46884776/
mih added a commit to mih/datalad-next that referenced this issue May 21, 2024
Since 1.4.0 a plain `datalad_next` import required `pytest`.
This was due to the datalad-core patch `fix_ria_ora_tests` add in datalad#669,
and was discovered by Debian's CI

Thanks to @aqw for the recommendation.

Closes: datalad#698
Refs: datalad#669, https://ci.debian.net/packages/d/datalad-next/testing/amd64/46884776/
mih added a commit to mih/datalad-next that referenced this issue May 21, 2024
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 datalad#669,
and was discovered by Debian's CI

Thanks to @aqw for the recommendation.

Closes: datalad#698
Refs: datalad#669, https://ci.debian.net/packages/d/datalad-next/testing/amd64/46884776/
mih added a commit to mih/datalad-next that referenced this issue May 21, 2024
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 datalad#669,
and was discovered by Debian's CI

Thanks to @aqw for the recommendation.

Closes: datalad#698
Refs: datalad#669, https://ci.debian.net/packages/d/datalad-next/testing/amd64/46884776/
@mih mih closed this as completed in #701 May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants