Gerrrr opened a new pull request, #176:
URL: https://github.com/apache/otava/pull/176

   ## Why
   
   `pip install apache-otava` currently installs every database and 
notification client, even when the caller only needs the analysis library, 
bundled CLI, or built-in CSV, JSON, HistoStat, and Graphite sources.
   
   This is not hypothetical:
   
   - [Nyrkiö imports 
Otava](https://github.com/nyrkio/nyrkio/blob/ecc4b6f5f8c6369f900fafbbfc5533220888eefc/backend/core/core.py#L12-L18)
 and feeds it `Series` objects from its own storage; Otava is not connected to 
a database at all ([analysis 
endpoint](https://github.com/nyrkio/nyrkio/blob/ecc4b6f5f8c6369f900fafbbfc5533220888eefc/backend/api/changes.py#L4),
 
[discussion](https://github.com/apache/otava/issues/101#issuecomment-3589345129)).
   - Another [programmatic-use 
example](https://github.com/apache/otava/issues/101#issuecomment-3613628236) 
transforms data from MySQL/custom processing into `Series` before analysis.
   - A CSV-only user currently receives BigQuery, PostgreSQL, InfluxDB, 
Grafana, and Slack dependencies anyway.
   
   This PR makes the default installation useful on its own while letting users 
opt into only the external services they need.
   
   ## Measured impact
   
   Fresh measurements from the wheel built from this branch:
   
   | install / extra | covers | client dependency | installed size | cost over 
core |
   |---|---|---|---:|---:|
   | default | analysis, CLI, CSV, JSON, HistoStat, Graphite | — | 148.1 MB / 
19 pkgs | core |
   | `influxdb` | importer | `influxdb3-python` | 283.0 MB / 24 pkgs | +134.9 
MB / +5 pkgs |
   | `bigquery` | importer + `--update-bigquery` | `google-cloud-bigquery` | 
221.2 MB / 41 pkgs | +73.1 MB / +22 pkgs |
   | `slack` | `--notify-slack` | `slack-sdk` | 152.1 MB / 20 pkgs | +4.0 MB / 
+1 pkg |
   | `grafana` | `--update-grafana`, `remove-annotations` | `requests` | 151.7 
MB / 24 pkgs | +3.5 MB / +5 pkgs |
   | `postgres` | importer + `--update-postgres` | `pg8000` | 149.7 MB / 22 
pkgs | +1.5 MB / +3 pkgs |
   | `all` | every integration | all clients | 360.3 MB / 48 pkgs | +212.2 MB / 
+29 pkgs |
   
   The default installation avoids 212.2 MB (58.9%) and 29 packages (60.4%) 
compared with the full integration set.
   
   Measured on Python 3.14.7 on macOS arm64 using wheel-only installs with 
bytecode compilation and a fresh environment for each row. Installed size is 
the sum of file sizes under `site-packages`. Absolute results vary by platform, 
but these measurements closely match those reported in #175.
   
   ## Installation examples
   
   ```console
   # Analysis library, CLI, and built-in sources
   pip install apache-otava
   
   # One external service
   pip install 'apache-otava[bigquery]'
   
   # Combine only the services needed
   pip install 'apache-otava[bigquery,postgres]'
   
   # Existing all-integrations experience
   pip install 'apache-otava[all]'
   ```
   
   The production Docker image continues to include every integration by 
installing `[all]`.
   
   ## What changed
   
   - Move BigQuery, PostgreSQL, InfluxDB, Grafana, and Slack clients into named 
extras, plus an `all` extra.
   - Import optional clients only when their features are used.
   - Report actionable errors that name the missing extra and installation 
command.
   - Keep Slack optional even for code paths that do not send notifications.
   - Add a clean-wheel core installation smoke test to CI.
   - Install `[all]` in the production Docker image.
   - Update the README, installation guide, getting-started guide, and 
integration-specific documentation.
   
   ## Scope
   
   This deliberately contains only dependency extraction and its supporting 
tests/documentation. It does not move modules, redesign the public analysis 
model, introduce compatibility shims, or commit architecture specifications. 
Keeping those API discussions separate lets #55 and #175 land independently.
   
   ## Verification
   
   - `242 passed` across the complete test and performance suite, including 
Docker-backed Graphite, InfluxDB, and PostgreSQL end-to-end tests.
   - Lint and license checks pass through tox.
   - Clean default wheel: 19 packages and the core smoke test passes.
   - `[all]` wheel: 48 packages and all service client imports pass.
   - Production Docker image builds and `otava --help` runs successfully.
   
   Closes #55
   Closes #175
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to