meltano icon indicating copy to clipboard operation
meltano copied to clipboard

fix(deps): Make `aiodocker` an optional dependency

Open edgarrmondragon opened this issue 1 year ago • 2 comments

Description

Related Issues

  • Closes #8713

edgarrmondragon avatar Apr 08 '25 03:04 edgarrmondragon

Deploy Preview for meltano canceled.

Name Link
Latest commit f7e8c03be5e1572c602c59501a0e9fae1a84df22
Latest deploy log https://app.netlify.com/projects/meltano/deploys/68a9cd8e379d2b000818e4cf

netlify[bot] avatar Apr 08 '25 03:04 netlify[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 95.32%. Comparing base (5adaf9f) to head (f7e8c03). :warning: Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9202   +/-   ##
=======================================
  Coverage   95.32%   95.32%           
=======================================
  Files         257      257           
  Lines       21073    21074    +1     
  Branches     1285     1285           
=======================================
+ Hits        20087    20088    +1     
  Misses        786      786           
  Partials      200      200           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Apr 08 '25 04:04 codecov[bot]

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR refactors the Docker integration to make the 'aiodocker' package an optional 'containers' extra by moving it out of core dependencies, adding a guarded import with a descriptive error, and updating test and type-check configurations.

Class diagram for updated container_service.py dependency handling

classDiagram
    class ContainerService {
        +run_container()
    }
    ContainerService : <<uses>> aiodocker (optional)
    note for ContainerService "aiodocker is now imported inside run_container() with ImportError handling"

File-Level Changes

Change Details Files
Guarded import for aiodocker with user-friendly error
  • Wrap import aiodocker in try/except
  • Raise ImportError with install suggestion when missing
src/meltano/core/container/container_service.py
Moved aiodocker from core to optional 'containers' extra
  • Removed aiodocker from main dependencies
  • Added a new 'containers' extras group including aiodocker
pyproject.toml
Include 'containers' extra in test and type-check sessions
  • Added 'containers' to pytest extras list
  • Added '--extra=containers' in mypy invocation
noxfile.py
Updated lock file to reflect dependency changes
  • Regenerated uv.lock after dependency modifications
uv.lock

Assessment against linked issues

Issue Objective Addressed Explanation
#8713 Remove aiodocker from the default/core dependencies so it is not installed by default.
#8713 Make aiodocker available as an optional dependency via an extra (e.g., meltano[containers]).
#8713 Update code to handle missing aiodocker dependency gracefully, providing a clear error message and instructions for installation.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Aug 23 '25 14:08 sourcery-ai[bot]