Page MenuHomeSoftware Heritage

Make the dependency of 'pytest_plugin' on 'requests' optional.
AbandonedPublic

Authored by vlorentz on Dec 17 2020, 10:39 AM.

Details

Reviewers
None
Group Reviewers
Reviewers
Summary

Else, running 'pytest' always crashes if 'swh.core' is installed but 'requests' isn't.

Diff Detail

Event Timeline

Build is green

Patch application report for D4756 (id=16838)

Rebasing onto 777ea186fa...

Current branch diff-target is up to date.
Changes applied before test
commit 27707fa51c65c9390042b8c88e6ec1174cc40b33
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Dec 17 10:39:38 2020 +0100

    Make the dependency of 'pytest_plugin' on 'requests' optional.
    
    Else, running 'pytest' always crashes if 'swh.core' is installed but 'requests' isn't.

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/187/ for more details.

I'd prefer if we made this pytest plugin opt-in; AFAICT that means adding it in the swh.storage, swh.scheduler and swh.indexer conftest.py.

In the meantime, I think you should make swh.clearlydefined depend on swh.core[http] (which is a dependency it'll need at some point anyway, to interact with rpc services?)

Ah, I missed requests_mock_datadir... That means swh-lister, swh-deposit and swh-loader-core need it too... hmpf.