Skip to content

Conversation

aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented Jul 31, 2025

feat: replace pip with uv and add use_python parameter

Summary

This PR replaces all pip usage with uv for Python connector installations in PyAirbyte and adds a new optional use_python parameter that provides flexible Python interpreter selection.

Key Changes:

  • VenvExecutor: Modified to use uv venv and uv pip install instead of python -m venv and pip install
  • New use_python parameter: Added throughout the call chain from CLI → get_source/get_destination → get_connector_executor → VenvExecutor
  • CLI support: Added --use-python option to validate, benchmark, and sync commands
  • Parameter types:
    • True/None: Use current Python interpreter (backward compatible)
    • False: Prefer Docker execution
    • Path: Use specific interpreter path
    • str: Use uv-managed Python version (e.g., "3.11", "python3.12")

Review & Testing Checklist for Human

  • Test CLI parameter with different values: Verify --use-python works with "true", "false", interpreter paths, and version strings
  • Verify uv availability: Ensure uv is installed and accessible in target environments before merging
  • Test backward compatibility: Confirm existing workflows still work without the new parameter
  • Test error handling: Verify graceful failures when uv is not available or when invalid interpreter paths are provided
  • End-to-end testing: Install a real connector using the new parameter types to ensure the full pipeline works

Recommended test plan:

# Test different parameter values
pyab validate source-faker --use-python true
pyab validate source-faker --use-python false    
pyab validate source-faker --use-python /usr/bin/python3
pyab validate source-faker --use-python 3.11

# Test backward compatibility
pyab validate source-faker  # Should work without new parameter

Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    CLI["airbyte/cli.py<br/>validate/benchmark/sync"]:::major-edit
    ParsePython["_parse_use_python()<br/>helper function"]:::major-edit
    SourceUtil["airbyte/sources/util.py<br/>get_source()"]:::major-edit
    DestUtil["airbyte/destinations/util.py<br/>get_destination()"]:::major-edit
    ExecutorUtil["airbyte/_executors/util.py<br/>get_connector_executor()"]:::major-edit
    VenvExecutor["airbyte/_executors/python.py<br/>VenvExecutor class"]:::major-edit
    Examples["examples/*.py<br/>comment updates"]:::minor-edit
    Tests["tests/conftest.py<br/>uv usage"]:::minor-edit

    CLI --> ParsePython
    CLI --> SourceUtil
    CLI --> DestUtil
    SourceUtil --> ExecutorUtil
    DestUtil --> ExecutorUtil
    ExecutorUtil --> VenvExecutor
    
    VenvExecutor --> UV["uv venv + uv pip install<br/>commands"]:::context
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit
        L3[Context/No Edit]:::context
    end

    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#87CEEB
    classDef context fill:#FFFFFF
Loading

Notes

  • Environment dependency: This PR introduces a dependency on uv being available in the system PATH when using the new parameter types
  • Backward compatibility: Default behavior (use_python=None/True) maintains compatibility but now uses uv pip install instead of pip install
  • Parameter flow: The use_python parameter flows through the entire call chain: CLI → utility functions → executor factory → VenvExecutor
  • Testing limitation: While existing tests pass, the new parameter types haven't been comprehensively tested in all environments

Session details:

Summary by CodeRabbit

  • New Features

    • Added a CLI option to specify the Python interpreter for connector execution (--use-python), allowing flexible selection between the current interpreter, a specific path, a version string, or Docker.
    • Introduced support for the "uv" Python package manager as an alternative to pip for creating and installing virtual environments, controlled by a new environment variable.
    • Extended connector source and destination configuration to support Python interpreter selection and virtual environment creation options.
    • Added cross-version Python compatibility tests using Docker to verify connector execution across different Python versions.
  • Bug Fixes

    • Improved error handling and messaging for installation failures, covering both pip and uv scenarios.
  • Chores

    • Updated dependencies to include the "uv" package.
    • Enhanced test and validation scripts to support both pip and uv workflows.
    • Refined test fixtures for connector installation to cover both uv-enabled and uv-disabled modes.
    • Expanded README documentation with detailed connector installation methods and Python interpreter configuration guidance.

Important

Auto-merge enabled.

This PR is set to merge automatically when all requirements are met.

- Replace all pip install commands with uv pip install
- Replace python -m venv with uv venv when using uv
- Add use_python parameter to control Python interpreter selection:
  - True: use current Python interpreter
  - False: prefer Docker execution
  - Path: use specific interpreter path
  - str: use uv-managed Python version
- Update CLI to accept --use-python option
- Update all relevant function signatures to pass parameter through call chain
- Update example files to use uv instead of pip in comments

Co-Authored-By: AJ Steers <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings July 31, 2025 02:58
Copy link
Contributor

Original prompt from AJ Steers
@Devin - in PyAirbyte, replace 'pip' with 'uv' for all python connection installations. Also add an optional input arg called 'use_python' which can be "True" (use our own 'python' interpreter), "False" (don't use Python, use Docker instead, a Path (find an interpreter with that name or path), or a string (use a uv-installed and uv-managed version of Python - assuming that string matches something we can pass to uv for a uv-managed python interpreter.

Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor

coderabbitai bot commented Jul 31, 2025

📝 Walkthrough

Walkthrough

This change introduces support for selecting the Python interpreter and virtual environment management tool ("uv" or standard Python) throughout the Airbyte CLI, executor, and utility layers. It adds a use_python parameter to relevant functions and CLI commands, conditionally using "uv" or "pip" for environment creation and package installation, based on environment variables and user input.

Changes

Cohort / File(s) Change Summary
Executor and Environment Selection Logic
airbyte/_executors/python.py, airbyte/_executors/util.py, airbyte/constants.py
Adds a use_python parameter to the VenvExecutor and get_connector_executor for flexible interpreter selection. Implements conditional logic to use "uv" or "pip" for virtual environment creation and package installation, controlled by the new NO_UV constant which reads from an environment variable.
CLI and Command Propagation
airbyte/cli.py
Adds a --use-python CLI option to validate, benchmark, and sync commands. Introduces _parse_use_python helper and propagates the interpreter selection through job resolution and execution. Updates function signatures and command options accordingly.
Source and Destination Utilities
airbyte/sources/util.py, airbyte/destinations/util.py
Adds a use_python parameter to get_source and get_destination functions, updating docstrings and signatures, and passes this parameter to the executor logic. get_destination also adds an install_root parameter for environment location flexibility.
Validation and Testing
airbyte/validate.py, tests/conftest.py, tests/integration_tests/test_install.py
Updates validation and test fixture logic to use "uv" when enabled, falling back to standard Python tools otherwise. Adjusts test assertions to account for possible error messages from both "uv" and "pip". Refactors test fixture to parameterize runs with and without "uv".
Dependency Management
pyproject.toml
Adds the uv package as a dependency and to the deptry ignore list, noting it is used as a subprocess tool and not imported directly.
New Test Script for Cross-Version Sync
test_cross_version_sync.py
Adds a new test script to verify cross-version Python compatibility by running sync commands inside Docker containers with different base and target Python versions, capturing detailed results and writing a summary report.
Documentation
README.md
Adds a new "Connector Installation" section explaining installation methods, the new uv tool usage, environment variable control, and how to specify Python interpreter versions for connector installation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Util
    participant Executor
    participant OS

    User->>CLI: Run command with --use-python option
    CLI->>Util: get_source/get_destination(..., use_python)
    Util->>Executor: VenvExecutor(..., use_python)
    Executor->>OS: Create venv (uv or python -m venv)
    Executor->>OS: Install package (uv pip install or pip install)
    OS-->>Executor: Success/Failure
    Executor-->>Util: Executor ready or error
    Util-->>CLI: Source/Destination ready or error
    CLI-->>User: Output result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Suggested labels

enable-ai-review

Suggested reviewers

  • quintonwall
  • aaronsteers

Would you like me to also help coordinate review with PR #268 since both touch on virtual environment management? Wdyt?

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1753929814-replace-pip-with-uv

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1753929814-replace-pip-with-uv' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1753929814-replace-pip-with-uv'

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test-pr - Runs tests with the updated PyAirbyte

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces pip with uv for Python connector installations and introduces a new use_python parameter that provides flexible Python interpreter selection for PyAirbyte connectors.

  • Replaces all pip install commands with uv pip install throughout the codebase
  • Adds new use_python parameter with support for current interpreter, Docker preference, specific paths, or uv-managed versions
  • Updates CLI commands to accept --use-python option for validate, benchmark, and sync operations

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
airbyte/_executors/python.py Modified VenvExecutor to use uv commands and handle different use_python parameter types
airbyte/_executors/util.py Added use_python parameter to get_connector_executor factory function
airbyte/sources/util.py Added use_python parameter to get_source function with documentation
airbyte/destinations/util.py Added use_python parameter to get_destination function with documentation
airbyte/cli.py Added --use-python CLI option and _parse_use_python helper function
tests/conftest.py Updated test fixture to use uv commands instead of pip
examples/*.py Updated example comments to reference uv pip install instead of pip install

Copy link

github-actions bot commented Jul 31, 2025

PyTest Results (Fast Tests Only, No Creds)

301 tests  +45   301 ✅ +45   4m 14s ⏱️ +46s
  1 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit 4266c74. ± Comparison against base commit f9275ea.

This pull request removes 45 and adds 90 tests. Note that renamed tests count towards both.
tests.integration_tests.test_source_test_fixture ‑ test_airbyte_version
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset_filter
tests.integration_tests.test_source_test_fixture ‑ test_check
tests.integration_tests.test_source_test_fixture ‑ test_check_fail
tests.integration_tests.test_source_test_fixture ‑ test_check_fail_on_missing_config[check]
tests.integration_tests.test_source_test_fixture ‑ test_check_fail_on_missing_config[read]
tests.integration_tests.test_source_test_fixture ‑ test_check_fail_on_missing_config[read_stream]
tests.integration_tests.test_source_test_fixture ‑ test_dataset_list_and_len
tests.integration_tests.test_source_test_fixture ‑ test_docker_only_connector
…
tests.integration_tests.test_source_test_fixture ‑ test_airbyte_version[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_airbyte_version[uv_enabled]
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset[uv_enabled]
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset_filter[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset_filter[uv_enabled]
tests.integration_tests.test_source_test_fixture ‑ test_check[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_check[uv_enabled]
tests.integration_tests.test_source_test_fixture ‑ test_check_fail[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_check_fail[uv_enabled]
…

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 31, 2025

PyTest Results (Full)

364 tests  +46   350 ✅ +46   20m 11s ⏱️ + 3m 1s
  1 suites ± 0    14 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit 4266c74. ± Comparison against base commit f9275ea.

This pull request removes 46 and adds 92 tests. Note that renamed tests count towards both.
tests.integration_tests.test_source_test_fixture ‑ test_airbyte_version
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset_filter
tests.integration_tests.test_source_test_fixture ‑ test_check
tests.integration_tests.test_source_test_fixture ‑ test_check_fail
tests.integration_tests.test_source_test_fixture ‑ test_check_fail_on_missing_config[check]
tests.integration_tests.test_source_test_fixture ‑ test_check_fail_on_missing_config[read]
tests.integration_tests.test_source_test_fixture ‑ test_check_fail_on_missing_config[read_stream]
tests.integration_tests.test_source_test_fixture ‑ test_dataset_list_and_len
tests.integration_tests.test_source_test_fixture ‑ test_docker_only_connector
…
tests.integration_tests.test_source_test_fixture ‑ test_airbyte_version[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_airbyte_version[uv_enabled]
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset[uv_enabled]
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset_filter[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_cached_dataset_filter[uv_enabled]
tests.integration_tests.test_source_test_fixture ‑ test_check[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_check[uv_enabled]
tests.integration_tests.test_source_test_fixture ‑ test_check_fail[uv_disabled]
tests.integration_tests.test_source_test_fixture ‑ test_check_fail[uv_enabled]
…

♻️ This comment has been updated with latest results.

- Add AIRBYTE_NO_UV environment variable to control tool selection
- When AIRBYTE_NO_UV is set to '1', 'true', or 'yes', use pip instead of uv
- Default behavior remains using uv when environment variable is not set
- Preserves failure signals while providing users a safe escape hatch
- Update both VenvExecutor and test fixture to respect environment variable
- Fixes CI failures where uv executable is not available

Co-Authored-By: AJ Steers <[email protected]>
- Add uv-specific error patterns to test_install_failure_log_pypi
- Keep existing pip error patterns for backward compatibility
- Test now correctly detects installation failures from both tools

Co-Authored-By: AJ Steers <[email protected]>
@aaronsteers
Copy link
Contributor Author

I've observed this error and I believe it is unrelated to our changes:

E           AssertionError: Expected 'source-airtable' init success but got 'ValidationError'.

devin-ai-integration bot and others added 7 commits July 31, 2025 04:08
The test_nocode_connectors_setup and test_expected_hardcoded_failures tests
were causing unnecessary CI flakiness due to CDK version compatibility issues.
These tests were not providing reliable value and were eternally-flaky.

Removed:
- test_nocode_connectors_setup function
- test_expected_hardcoded_failures function
- Hardcoded failure lists (_LOWCODE_CONNECTORS_FAILING_VALIDATION, etc.)
- Associated imports and references

This cleanup makes the test suite more reliable by removing tests that
don't provide consistent value.

Co-Authored-By: AJ Steers <[email protected]>
- uv is used as subprocess tool, not imported directly
- fixes dependency analysis CI failure

Co-Authored-By: AJ Steers <[email protected]>
…wcode-test' into devin/1753929814-replace-pip-with-uv
- validate.py now uses uv by default but falls back to pip when AIRBYTE_NO_UV is set
- fixes CI failure in test_validation.py caused by venv structure mismatch
- maintains consistency with main uv implementation approach

Co-Authored-By: AJ Steers <[email protected]>
devin-ai-integration bot and others added 3 commits July 31, 2025 08:25
- Move _should_use_uv logic from multiple files to airbyte/constants.py
- Follow existing constants.py pattern with proper documentation
- Update all call sites to import and use AIRBYTE_USE_UV constant
- Maintain exact same behavior: uv used by default, disabled when AIRBYTE_NO_UV=1/true/yes
- Revert documentation changes in example files from 'uv pip install' back to 'pip install'

Co-Authored-By: AJ Steers <[email protected]>
- Fix syntax error in _parse_use_python function
- Change '"' to '\' for proper string literal escaping
- Addresses GitHub comment requesting Windows path separator support

Co-Authored-By: AJ Steers <[email protected]>
aaronsteers and others added 4 commits August 1, 2025 02:15
…h-uv' into devin/1753929814-replace-pip-with-uv
- Add parametrized fixture testing both uv-enabled and uv-disabled scenarios
- Use existing PyAirbyte installation methods via get_connector_executor
- Fix scope issues by changing to session-scoped fixture
- Remove monkeypatch dependency and use direct os.environ

Co-Authored-By: AJ Steers <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
tests/conftest.py (1)

10-10: Clean up unused imports flagged by the linter

The pipeline failures indicate that subprocess, get_bin_dir, and NO_UV are imported but not used in the current implementation. Should we remove these unused imports to keep the code clean? wdyt?

-import subprocess
-from airbyte._util.venv_util import get_bin_dir
-from airbyte.constants import NO_UV

Also applies to: 23-23, 27-27

🧹 Nitpick comments (2)
tests/conftest.py (2)

283-284: Consider adding docstring details about the parameterization

The fixture is now parameterized to test both uv modes, but the docstring could be more explicit about this behavior. Would you like to expand the docstring to mention that it runs twice with different uv configurations? wdyt?

 @pytest.fixture(scope="session", params=[True, False], ids=["uv_enabled", "uv_disabled"])
 def source_test_installation(request):
     """
     Prepare test environment. This will pre-install the test source from the fixtures array and set
     the environment variable to use the local json file as registry.
-    
-    Parametrized to test both uv-enabled and uv-disabled installation methods.
+    
+    This fixture is parametrized to run twice:
+    - uv_enabled: Uses uv for package installation (default behavior)
+    - uv_disabled: Sets AIRBYTE_NO_UV=1 to use traditional pip/venv methods
     """

302-308: Consider passing use_python parameter explicitly

The fixture creates the executor but doesn't explicitly pass the use_python parameter that was introduced in this PR. Since the fixture is testing both uv modes, should we pass use_python=None (or use_python=True) to be explicit about our intention? wdyt?

         executor = get_connector_executor(
             name="source-test",
             pip_url="./tests/integration_tests/fixtures/source-test",
             install_root=Path.cwd(),
             install_if_missing=True,
+            use_python=None,  # Use current Python interpreter
         )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 199985e and dcd682b.

📒 Files selected for processing (4)
  • airbyte/_executors/python.py (6 hunks)
  • airbyte/constants.py (1 hunks)
  • airbyte/validate.py (2 hunks)
  • tests/conftest.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • airbyte/constants.py
  • airbyte/validate.py
  • airbyte/_executors/python.py
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: yohannj
PR: airbytehq/PyAirbyte#716
File: airbyte/logs.py:384-402
Timestamp: 2025-07-11T19:53:44.427Z
Learning: In the PyAirbyte project, when reviewing PRs, maintain clear separation of concerns. Don't suggest changes that are outside the scope of the PR's main objective, even if they would improve consistency or fix other issues. This helps with reviewing changes and potential reverts.
Learnt from: aaronsteers
PR: airbytehq/PyAirbyte#417
File: airbyte/cli.py:503-504
Timestamp: 2024-10-10T16:17:57.989Z
Learning: In the PyAirbyte project, support for Python versions earlier than 3.10 is not necessary, as the project requires Python 3.10 or newer.
📚 Learning: when reviewing changes in test fixtures, especially renaming, consider that they might be due to fix...
Learnt from: aaronsteers
PR: airbytehq/PyAirbyte#347
File: tests/integration_tests/fixtures/registry.json:47-47
Timestamp: 2024-10-08T15:34:31.026Z
Learning: When reviewing changes in test fixtures, especially renaming, consider that they might be due to fixing copy-paste errors and may not impact core codepaths.

Applied to files:

  • tests/conftest.py
📚 Learning: test fixtures in the pyairbyte project do not need to align with real docker repositories....
Learnt from: aaronsteers
PR: airbytehq/PyAirbyte#347
File: tests/integration_tests/fixtures/registry.json:48-48
Timestamp: 2024-08-31T01:20:08.405Z
Learning: Test fixtures in the PyAirbyte project do not need to align with real Docker repositories.

Applied to files:

  • tests/conftest.py
📚 Learning: in `airbyte/sources/util.py`, the function `get_benchmark_source` is intended for benchmarking purpo...
Learnt from: aaronsteers
PR: airbytehq/PyAirbyte#411
File: airbyte/sources/util.py:121-123
Timestamp: 2024-10-06T17:35:27.056Z
Learning: In `airbyte/sources/util.py`, the function `get_benchmark_source` is intended for benchmarking purposes in the current iteration. Future plans may include adding more generic functions like `get_dummy_source` or `get_mock_source` with broader functionality.

Applied to files:

  • tests/conftest.py
🧬 Code Graph Analysis (1)
tests/conftest.py (1)
airbyte/_executors/util.py (1)
  • get_connector_executor (158-358)
🪛 GitHub Actions: Run Linters
tests/conftest.py

[error] 10-10: Ruff F401: subprocess imported but unused.


[error] 23-23: Ruff F401: airbyte._util.venv_util.get_bin_dir imported but unused.


[error] 27-27: Ruff F401: airbyte.constants.NO_UV imported but unused.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Pytest (Fast)
🔇 Additional comments (1)
tests/conftest.py (1)

296-314: LGTM on the refactored fixture logic!

The refactoring from manual subprocess calls to using get_connector_executor is a great improvement that aligns perfectly with the PR's objectives. The try-finally pattern for cleanup is also well implemented. This change makes the test infrastructure more maintainable and consistent with the new executor pattern.

@aaronsteers aaronsteers enabled auto-merge (squash) August 1, 2025 03:39
@aaronsteers
Copy link
Contributor Author

aaronsteers commented Aug 1, 2025

/fix-pr

Auto-Fix Job Info

This job attempts to auto-fix any linting or formating issues. If any fixes are made,
those changes will be automatically committed and pushed back to the PR.
(This job requires that the PR author has "Allow edits from maintainers" enabled.)

PR auto-fix job started... Check job output.

✅ Changes applied successfully.

octavia-squidington-iii and others added 6 commits August 1, 2025 03:43
- Add parametrized source_test_installation fixture to test both uv-enabled and uv-disabled installation methods
- Use existing PyAirbyte installation methods via get_connector_executor instead of direct subprocess calls
- Add cross-version Python test script using new sync command syntax with destination-dev-null:0.6.0
- Fixture tests pass successfully with 8 tests covering both installation paths

Co-Authored-By: AJ Steers <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (6)
test_cross_version_sync.py (3)

13-103: Function looks solid overall! A few suggestions to consider:

The Docker command construction and error handling look good. I noticed a couple of potential improvements - would you consider extracting the hardcoded timeout value (600) to a constant or parameter for better maintainability? Also, the bash script construction is quite readable, but you might want to consider using shlex.quote() around the target_python parameter for extra safety, even though it's controlled input. Wdyt?

+import shlex
+
+# At the top of the file
+DEFAULT_TIMEOUT = 600
+
 def run_cross_version_test(
-    base_python: str, target_python: str, test_name: str
+    base_python: str, target_python: str, test_name: str, timeout: int = DEFAULT_TIMEOUT
 ) -> dict[str, str | bool | float]:
     # ... existing code ...
-        echo "Running sync with --use-python {target_python}..."
+        echo "Running sync with --use-python {shlex.quote(target_python)}..."
         time poetry run pyab sync --source source-faker \\
             --Sconfig '{{"count": 100}}' \\
-            --use-python {target_python} \\
+            --use-python {shlex.quote(target_python)} \\
             --destination=airbyte/destination-dev-null:0.6.0

105-142: Nice orchestration of the test suite!

The test cases cover good cross-version scenarios and the result handling looks solid. One small suggestion - in the summary parsing (line 132), you're splitting on "to" which works but assumes the test_key format. Would you consider making this more robust by storing the original base/target values in the results dict instead of reconstructing them? Wdyt?

     for test_key, result in results.items():
-        base, target = test_key.split("_to_")
+        base = result["base_python"]
+        target = result["target_python"]
         status = "✓" if result["success"] else "✗"

1-12: Clean imports and file structure!

The imports are minimal and appropriate. The file has good documentation and structure. Would you consider using TypedDict for the return type of run_cross_version_test to make the expected keys more explicit? Something like defining a TestResult type? Wdyt?

+from typing import TypedDict
+
+class TestResult(TypedDict, total=False):
+    success: bool
+    duration: float
+    return_code: int
+    stdout: str
+    stderr: str
+    base_python: str
+    target_python: str
+    error: str
+
 def run_cross_version_test(
     base_python: str, target_python: str, test_name: str
-) -> dict[str, str | bool | float]:
+) -> TestResult:
README.md (3)

23-29: Clear documentation on declarative sources!

The explanation is helpful and accurate. Would you consider simplifying the wording in line 29? Instead of "due to the fact that all dependencies are locked", maybe just "because all dependencies are locked"? The static analysis tool flagged this as potentially wordy. Wdyt?

-In some cases, you may get better stability by using `docker_image=True` in `get_source()`/`get_destination()`, due to the fact that all dependencies are locked within the docker image.
+In some cases, you may get better stability by using `docker_image=True` in `get_source()`/`get_destination()`, because all dependencies are locked within the docker image.

31-36: Good explanation of Python installation!

Same suggestion as the previous section - would you consider simplifying "due to the fact that" to just "because" for better readability? Wdyt?

-In some cases, you may get better stability by using `docker_image=True` in `get_source()`/`get_destination()`, due to the fact that all dependencies are locked within the docker image.
+In some cases, you may get better stability by using `docker_image=True` in `get_source()`/`get_destination()`, because all dependencies are locked within the docker image.

43-57: Great example showing the use_python functionality!

The code example is helpful and the explanation is clear. There's a small typo in line 45 - would you fix "you with to use" to "you wish to use"? Wdyt?

-In both `get_source()` and `get_destination()`, you can provide a `use_python` input arg that is equal to the desired version of Python that you with to use for the given connector.
+In both `get_source()` and `get_destination()`, you can provide a `use_python` input arg that is equal to the desired version of Python that you wish to use for the given connector.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9ef671 and b86e753.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • test_cross_version_sync.py (1 hunks)
  • tests/conftest.py (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/conftest.py
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: yohannj
PR: airbytehq/PyAirbyte#716
File: airbyte/logs.py:384-402
Timestamp: 2025-07-11T19:53:44.427Z
Learning: In the PyAirbyte project, when reviewing PRs, maintain clear separation of concerns. Don't suggest changes that are outside the scope of the PR's main objective, even if they would improve consistency or fix other issues. This helps with reviewing changes and potential reverts.
Learnt from: aaronsteers
PR: airbytehq/PyAirbyte#417
File: airbyte/cli.py:503-504
Timestamp: 2024-10-10T16:17:57.989Z
Learning: In the PyAirbyte project, support for Python versions earlier than 3.10 is not necessary, as the project requires Python 3.10 or newer.
📚 Learning: in the pyairbyte project, support for python versions earlier than 3.10 is not necessary, as the pro...
Learnt from: aaronsteers
PR: airbytehq/PyAirbyte#417
File: airbyte/cli.py:503-504
Timestamp: 2024-10-10T16:17:57.989Z
Learning: In the PyAirbyte project, support for Python versions earlier than 3.10 is not necessary, as the project requires Python 3.10 or newer.

Applied to files:

  • test_cross_version_sync.py
🪛 LanguageTool
README.md

[style] ~29-~29: ‘due to the fact that’ might be wordy. Consider a shorter alternative.
Context: ... in get_source()/get_destination(), due to the fact that all dependencies are locked within the ...

(EN_WORDINESS_PREMIUM_DUE_TO_THE_FACT_THAT)


[style] ~35-~35: ‘due to the fact that’ might be wordy. Consider a shorter alternative.
Context: ... in get_source()/get_destination(), due to the fact that all dependencies are locked within the ...

(EN_WORDINESS_PREMIUM_DUE_TO_THE_FACT_THAT)


[grammar] ~45-~45: Ensure spelling is correct
Context: ... the desired version of Python that you with to use for the given connector. This ca...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
🔇 Additional comments (2)
README.md (2)

37-42: Excellent documentation of the new uv functionality!

This clearly explains the new default behavior and provides the fallback option. The version reference (0.29.0) and environment variable documentation align perfectly with the PR objectives.


58-61: Clear documentation of Docker installation options!

The explanation of both the boolean and specific image tag usage is helpful and aligns well with the flexible installation approach introduced in this PR.

@aaronsteers
Copy link
Contributor Author

aaronsteers commented Aug 1, 2025

/poetry-lock

poetry lock job started... Check job output.

poetry lock applied successfully.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
README.md (4)

25-27: Tighten grammar & clarity of the Declarative section?

A couple of small wording tweaks would make the sentences flow a bit better and fix a typo. Wdyt?

-For Declarative Sources defined in YAML, the installation process will is to simply download the yaml file from the `connectors.airbyte.com` public URLs, and to run them directly as YAML.
-Declarative sources have the fastest download times, due to the simplicity and each of install.
+For Declarative sources defined in YAML, the installation process is simply to download the YAML file from the `connectors.airbyte.com` public URLs and run it directly.
+Declarative sources download the fastest because each installation is lightweight.

29-35: Replace wordy “due to the fact that” with “because”?

To keep the prose concise (and avoid the LanguageTool flag), perhaps swap the phrase on both occurrences, e.g.:

-... `docker_image=True` in `get_source()`/`get_destination()`, due to the fact that all dependencies are locked within the docker image.
+... `docker_image=True` in `get_source()`/`get_destination()`, because all dependencies are locked within the Docker image.

Apply similarly in Line 35. Wdyt?


45-45: Fix “with” → “wish”?

Tiny typo in the use_python sentence:

-... the desired version of Python that you with to use ...
+... the desired version of Python that you wish to use ...

47-55: Align example version numbers for consistency?

The paragraph mentions 3.10.13 while the snippet uses 3.10.17. Would matching them avoid reader confusion? For example:

-... install a connector using Python 3.10.13 with the following code snippet:
+... install a connector using Python 3.10.17 with the following code snippet:

(or vice-versa). Wdyt?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b86e753 and 0686e7f.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • README.md (1 hunks)
  • pyproject.toml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: yohannj
PR: airbytehq/PyAirbyte#716
File: airbyte/logs.py:384-402
Timestamp: 2025-07-11T19:53:44.427Z
Learning: In the PyAirbyte project, when reviewing PRs, maintain clear separation of concerns. Don't suggest changes that are outside the scope of the PR's main objective, even if they would improve consistency or fix other issues. This helps with reviewing changes and potential reverts.
Learnt from: aaronsteers
PR: airbytehq/PyAirbyte#417
File: airbyte/cli.py:503-504
Timestamp: 2024-10-10T16:17:57.989Z
Learning: In the PyAirbyte project, support for Python versions earlier than 3.10 is not necessary, as the project requires Python 3.10 or newer.
🪛 LanguageTool
README.md

[style] ~29-~29: ‘due to the fact that’ might be wordy. Consider a shorter alternative.
Context: ... in get_source()/get_destination(), due to the fact that all dependencies are locked within the ...

(EN_WORDINESS_PREMIUM_DUE_TO_THE_FACT_THAT)


[style] ~35-~35: ‘due to the fact that’ might be wordy. Consider a shorter alternative.
Context: ... in get_source()/get_destination(), due to the fact that all dependencies are locked within the ...

(EN_WORDINESS_PREMIUM_DUE_TO_THE_FACT_THAT)


[grammar] ~45-~45: Ensure spelling is correct
Context: ... the desired version of Python that you with to use for the given connector. This ca...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Pytest (Fast)

@aaronsteers aaronsteers merged commit a2b051e into main Aug 1, 2025
21 checks passed
@aaronsteers aaronsteers deleted the devin/1753929814-replace-pip-with-uv branch August 1, 2025 05:38
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.

1 participant