Split functionality into modules by dependencies
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- backend, developer-experience
Research direction
Start by reading pyproject.toml and inspecting the current observability_utils package for imports used by the FastAPI and STOMP integrations. Trace the existing tracing entry points and dependency declarations before deciding how the modules should be separated. Done means each integration is importable only with its corresponding optional dependency group, without imposing the other integration's dependency.
Written by the indexing model from the issue text.
Description
As a user I would like to use this library in a FastAPI project without also having a transient dependency on stomp-py (and vice versa)
Possible Solution
Split project into modules by import dependency e.g.:
srcfastapitracing.py
stomptracing.py
And then add dependency groups to pyproject.toml e.g.
dependencies = [
"typing_extensions<4.6",
"opentelemetry-distro",
"opentelemetry-exporter-otlp",
"stomp.py",
] # Add project dependencies here, e.g. ["click", "numpy"]
dynamic = ["version"]
license.file = "LICENSE"
readme = "README.md"
requires-python = ">=3.10"
[project.optional-dependencies]
dev = [
"copier",
"pipdeptree",
"pre-commit",
"pyright",
"pytest",
"pytest-cov",
"ruff",
"tox-direct",
"types-mock",
]
fastapi = ["fastapi[all]<0.99", "opentelemetry-instrumentation-fastapi"]
stomp = ["stomp-py"]
Acceptance Criteria
- Importing from
observability_utils.fastapionly works if I have runpip install observability_utils[fastapi] - Importing from
observability_utils.stomponly works if I have runpip install observability_utils[stomp]
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DiamondLightSource/observability-utils
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Support Python3.12 Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in DiamondLightSource/observability-utils
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100