Skip to content

Fix testing module dependency on httpx - #198

Merged
oliwenmandiamond merged 1 commit into
mainfrom
fix_dependency_on_httpx
Jul 28, 2026
Merged

Fix testing module dependency on httpx#198
oliwenmandiamond merged 1 commit into
mainfrom
fix_dependency_on_httpx

Conversation

@oliwenmandiamond

@oliwenmandiamond oliwenmandiamond commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

When trying to update dodal to latest release of daq-config-server, have ran into a dependency issue when trying to import from testing module

026-07-28 13:37:10.446 [error] ImportError while loading conftest '/workspaces/dodal/tests/conftest.py'.
tests/conftest.py:13: in <module>
    from daq_config_server.testing import MockServerResponse, PathToMockDataDict
/cache/venv-for/scratch/bluesky_development/dodal/lib/python3.11/site-packages/daq_config_server/testing/__init__.py:1: in <module>
    from ._utils import make_test_response
/cache/venv-for/scratch/bluesky_development/dodal/lib/python3.11/site-packages/daq_config_server/testing/_utils.py:3: in <module>
    from httpx import Response
E   ModuleNotFoundError: No module named 'httpx'

This is because we have a make_test_response function which is in testing module which has a dependency on httpx and isn't a hard dependency for daq-config-server. Rather than adding the dependency, I have moved the function to tests only as that is where it is ever used. I have also checked plan repositories and it isn't used there either so safe to remove from testing and define it only where it is used.

@Relm-Arrowny Relm-Arrowny left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFTM, no reason for it to be inside the module.

@oliwenmandiamond
oliwenmandiamond merged commit 77f18a4 into main Jul 28, 2026
15 checks passed
@oliwenmandiamond
oliwenmandiamond deleted the fix_dependency_on_httpx branch July 28, 2026 14:01
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 this pull request may close these issues.

2 participants