Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Conversation

@ipv1337
Copy link

@ipv1337 ipv1337 commented Apr 16, 2025

This PR updates the CI workflow (.github/workflows/python-ci.yml) to use uv instead of pip for installing dependencies, as part of the migration plan.\n\nAlso updates the local coverage check script (scripts/run_coverage_local.sh) to use uv.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @ipv1337, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request focuses on migrating the project's dependency management from pip to uv. This change impacts the CI workflow, local coverage check script, pre-commit setup, and documentation. The primary goal is to leverage uv for faster and more efficient dependency resolution and installation.

Highlights

  • CI Workflow Update: The CI workflow configuration file (.github/workflows/python-ci.yml) is updated to use uv for installing dependencies instead of pip.
  • Local Coverage Script Update: The run_coverage_local.sh script is modified to use uv for installing the toml package, if it's not already available.
  • Documentation Updates: The README.md and docs/install.md files are updated to reflect the recommended usage of uv for installing the project and its dependencies, including instructions for installing from PyPI and from source.
  • Pre-commit Hook Setup: The setup_pre_commit.sh script is updated to use uv for installing and upgrading pre-commit.
  • Test Updates: The test file tests/models/test_gemini.py was updated to adjust assertions and mock objects to better reflect the expected behavior of the Gemini model during testing.

Changelog

Click here to see the changelog
  • README.md
    • Updated installation instructions to use uv instead of pip for installing the package from PyPI.
    • Updated installation instructions to use uv instead of pip for installing the package from source, including instructions for creating a virtual environment and installing development dependencies.
  • docs/install.md
    • Updated installation instructions to use uv instead of pip for installing the package from PyPI.
    • Updated installation instructions to use uv instead of pip for installing the package from source, including instructions for creating a virtual environment and installing development dependencies.
    • Corrected a typo in the configuration example, changing YOUR_GEMINI_API_KEY_HERE to YOUR_GEMINI_API_KEY.
  • scripts/run_coverage_local.sh
    • Modified the script to use uv instead of pip for installing the toml package if it's not already available.
    • No newline at end of file was added.
  • scripts/setup_pre_commit.sh
    • Updated the script to use uv instead of pip for installing and upgrading pre-commit.
  • tests/models/test_gemini.py
    • Modified the mock_console function to explicitly return the mock status object when __enter__ is called.
    • Added a multiline statement to improve readability.
    • Modified the mock_tool_helpers function to use multiline statements to improve readability.
    • Moved the mock configure definition to be before the mock model object.
    • Updated assertions in test_generate_tool_call to account for changes in agent loop behavior.
    • Updated assertions in test_generate_user_rejects_edit to account for changes in agent loop behavior.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


uv is swift,
Pip's pace, a slower drift,
Speeding Python's way.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the CI workflow and local coverage check script to use uv for dependency management. The changes are straightforward and well-documented. However, there are a few minor issues and areas for improvement.

Summary of Findings

  • Inconsistent use of uv prefix: The uv prefix is inconsistently applied in the README and docs/install.md files. Some pip commands have the uv prefix, while others do not. This inconsistency should be resolved for clarity and consistency.
  • Missing virtual environment activation in README: The README provides instructions for creating a virtual environment but doesn't explicitly show how to activate it. Adding this step would improve the clarity of the installation instructions.
  • Unnecessary comments in README and docs/install.md: Several commented-out lines exist in the README and docs/install.md files. These should be removed to improve readability. If these lines are intended for future use, they should be moved to a separate section or file.
  • PEP 8 Style Guide Adherence: While no explicit style guide was provided, the code implicitly follows PEP 8. However, some lines exceed the recommended line length. These should be refactored to improve readability and maintainability.

Merge Readiness

The pull request is mostly ready to be merged, but the minor issues identified above should be addressed to improve clarity, consistency, and readability. Please note that I am unable to approve the pull request; other reviewers must also review and approve this code before merging.

**Recommended (PyPI):**
```bash
pip install cli-code-agent
uv pip install cli-code-agent

Choose a reason for hiding this comment

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

medium

The uv prefix is used here, but not consistently throughout the README and docs/install.md files. Should all pip commands use the uv prefix, or should it be removed entirely?

Suggested change
uv pip install cli-code-agent
pip install cli-code-agent

Comment on lines +46 to +53
# Create a virtual environment (optional but recommended)
# uv venv
# source .venv/bin/activate

# Install in editable mode
uv pip install -e .
# For development including test dependencies, use:
# uv pip install -e '.[dev]'

Choose a reason for hiding this comment

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

medium

The README instructs users to create a virtual environment but omits the activation step. Adding this would improve clarity. Also, the commented-out lines should be removed for better readability.

Suggested change
# Create a virtual environment (optional but recommended)
# uv venv
# source .venv/bin/activate
# Install in editable mode
uv pip install -e .
# For development including test dependencies, use:
# uv pip install -e '.[dev]'
git clone https://github.com/BlueCentre/cli-code.git
cd cli-code
uv venv
source .venv/bin/activate
uv pip install -e .
# For development including test dependencies, use:
uv pip install -e '.[dev]'


```bash
pip install cli-code-agent
uv pip install cli-code-agent

Choose a reason for hiding this comment

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

medium

The uv prefix is used here, but not consistently throughout the README and docs/install.md files. Should all pip commands use the uv prefix, or should it be removed entirely?

Suggested change
uv pip install cli-code-agent
pip install cli-code-agent

Comment on lines +18 to +25
# Create a virtual environment (optional but recommended)
# uv venv
# source .venv/bin/activate

# Install in editable mode
uv pip install -e .
# For development including test dependencies, use:
# uv pip install -e '.[dev]'

Choose a reason for hiding this comment

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

medium

The commented-out lines should be removed for better readability.

Suggested change
# Create a virtual environment (optional but recommended)
# uv venv
# source .venv/bin/activate
# Install in editable mode
uv pip install -e .
# For development including test dependencies, use:
# uv pip install -e '.[dev]'
# Install in editable mode
uv pip install -e .
# For development including test dependencies, use:
uv pip install -e '.[dev]'

@github-actions
Copy link

Code Coverage Report

📊 Current Coverage: 92.50%

Detailed coverage analysis is available in SonarCloud

Coverage Change Details

This shows code coverage for changes in this PR. To improve coverage, consider adding tests for new or modified code.

1 similar comment
@github-actions
Copy link

Code Coverage Report

📊 Current Coverage: 92.50%

Detailed coverage analysis is available in SonarCloud

Coverage Change Details

This shows code coverage for changes in this PR. To improve coverage, consider adding tests for new or modified code.

@sonarqubecloud
Copy link

@ipv1337 ipv1337 merged commit 619b151 into main Apr 16, 2025
5 checks passed
@ipv1337 ipv1337 deleted the feature/uv-migration branch April 16, 2025 17:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants