Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ The `opensafely.jobrunner` package (and associated tests at tests/jobrunner)
are currently maintained by the RAP team, rather than REX. Some things, like
dependencies, affect the whole system, so may need some cross team reviews.

### Tracing

The opensafely run code is instrumented with opentelemetry, using the vendored
opentelemety-api package. By default, this does nothing, but its fairly easy to
enable it if needed for development or debugging.

1. Install the extra dependencies:
- if in a devenv, they should already be installed
- if opensafely was installed via pip, then `install opensafely[tracing]`
- if opensafely was installed via uv, then `uv tool install opensafely[tracing]`
2. Create an ingest key from the Development Environment in Honeycomb: https://ui.honeycomb.io/bennett-institute-for-applied-data-science/environments/development/api_keys
3. set `export OTEL_EXPORTER_OTLP_HEADERS="x-honeycomb-team=<your-api-key>"
4. Use `opensafely run` as normal.
5. The traces should appear in the `opensafely-run` dataset in the Development environment in Honeycomb.


## Tests

Expand Down
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export VIRTUAL_ENV := `echo ${VIRTUAL_ENV:-.venv}`
export BIN := VIRTUAL_ENV + if os_family() == "unix" { "/bin" } else { "/Scripts" }
export PIP := BIN + if os_family() == "unix" { "/python -m pip" } else { "/python.exe -m pip" }
# enforce our chosen pip compile flags
export COMPILE := BIN + "/pip-compile --allow-unsafe"
export COMPILE := BIN + "/pip-compile"


# list available commands
Expand Down Expand Up @@ -46,12 +46,12 @@ _compile src dst *args: virtualenv

# update *vendored* production dependencies. See DEVELOPERS.md.
requirements-prod *args:
just _compile requirements.prod.in requirements.prod.txt {{ args }}
just _compile requirements.prod.in requirements.prod.txt --no-allow-unsafe {{ args }}


# update requirements.dev.txt if requirements.dev.in has changed
requirements-dev *args: virtualenv
just _compile requirements.dev.in requirements.dev.txt {{ args }}
just _compile requirements.dev.in requirements.dev.txt --allow-unsafe {{ args }}


# ensure prod requirements installed and up to date
Expand Down
8 changes: 0 additions & 8 deletions opensafely/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
from datetime import datetime, timedelta
from pathlib import Path

# ensure pkg_resources can find the package metadata we have included, as the
# opentelemetry packages need it
import pkg_resources


opensafely_module_dir = Path(__file__).parent
pkg_resources.working_set.add_entry(f"{opensafely_module_dir}/_vendor")

from opensafely import ( # noqa: E402
check,
clean,
Expand Down
1 change: 0 additions & 1 deletion opensafely/_vendor/Deprecated-1.2.13.dist-info.pyi

This file was deleted.

1 change: 0 additions & 1 deletion opensafely/_vendor/Deprecated-1.2.13.dist-info/INSTALLER

This file was deleted.

21 changes: 0 additions & 21 deletions opensafely/_vendor/Deprecated-1.2.13.dist-info/LICENSE.rst

This file was deleted.

187 changes: 0 additions & 187 deletions opensafely/_vendor/Deprecated-1.2.13.dist-info/METADATA

This file was deleted.

10 changes: 0 additions & 10 deletions opensafely/_vendor/Deprecated-1.2.13.dist-info/RECORD

This file was deleted.

Empty file.
6 changes: 0 additions & 6 deletions opensafely/_vendor/Deprecated-1.2.13.dist-info/WHEEL

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion opensafely/_vendor/backoff-2.1.2.dist-info.pyi

This file was deleted.

1 change: 0 additions & 1 deletion opensafely/_vendor/backoff-2.1.2.dist-info/INSTALLER

This file was deleted.

21 changes: 0 additions & 21 deletions opensafely/_vendor/backoff-2.1.2.dist-info/LICENSE

This file was deleted.

Loading
Loading