Skip to content

Conversation

Tomas2D
Copy link
Contributor

@Tomas2D Tomas2D commented Sep 11, 2025

Ref: #52

Ref: #52
Signed-off-by: Tomas Dvorak <[email protected]>
@Tomas2D Tomas2D requested a review from a team as a code owner September 11, 2025 15:59
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.

Summary of Changes

Hello @Tomas2D, 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!

This pull request transitions the project's Python dependency management and build processes from Poetry to uv. This change is intended to enhance the efficiency of dependency installation and project execution by leveraging uv's speed, with corresponding updates to documentation and configuration files to reflect the new tooling.

Highlights

  • Package Manager Migration: The project has migrated its Python package management from Poetry to uv, a fast Python package installer and resolver, aiming for improved performance and streamlined workflows.
  • Build System Update: The pyproject.toml configuration has been updated to use hatchling as the build backend, aligning with uv's ecosystem and standard Python packaging practices.
  • Documentation Alignment: Both README.md and DEVELOP.md have been revised to reflect the new uv-based commands and setup instructions, ensuring consistency and ease of use for developers.
  • Python Version Specification: A new .python-version file has been added to explicitly declare Python 3.11 as the required version for the project.
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

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.

Signed-off-by: Tomas Dvorak <[email protected]>

# Conflicts:
#	poetry.lock
#	pyproject.toml
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 migrates the project's dependency management and build system from Poetry to uv and hatch. The changes primarily involve updating pyproject.toml to the standard format, replacing poetry commands with uv commands in the documentation (README.md, DEVELOP.md), and adding a .python-version file. My review focuses on the documentation changes to ensure clarity and reproducibility. I've suggested pinning the Docker image version in README.md for better reproducibility and pointed out a potentially unintentional removal of the (Optional) keyword in an instruction.

Ref: #52
Signed-off-by: Tomas Dvorak <[email protected]>
Comment on lines +11 to +39
timeout-minutes: 10
name: Lint & Build & Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "poetry"

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Set up Python
run: uv python install

- name: Install dependencies
run: poetry install --no-interaction
run: uv sync --all-extras --locked --dev

- name: Code Lint
run: poetry run poe lint
run: uv run poe lint

- name: Type check task with mypy
run: poetry run poe type-check -- -- --show-error-context --pretty
run: uv run poe type-check -- --show-error-context --pretty

- name: Code Format
run: poetry run poe format
run: uv run poe format

- name: Build
run: poetry build
run: uv build

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 18 hours ago

The best practice for GitHub Actions workflows is to explicitly specify the permissions key at either the workflow (root) level or at the job level. For this workflow, adding permissions: { contents: read } at the top level will ensure that all jobs default to the minimal required permissions, adhering to the principle of least privilege.

To fix the issue, add the following block on a new line after the workflow name declaration (after line 1 and before on: at line 3):

permissions:
  contents: read

No changes are required elsewhere, as the workflow otherwise appears standard.


Suggested changeset 1
.github/workflows/main.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,4 +1,6 @@
 name: Lint, Build
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: Lint, Build
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@Tomas2D Tomas2D merged commit 648b9be into main Sep 11, 2025
5 checks passed
uses: astral-sh/setup-uv@v6

- name: Set up Python
run: uv python install

Choose a reason for hiding this comment

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

This should not be necessary AFAIK, uv sync downloads the correct Python when creating venv

@@ -35,9 +35,9 @@ With the githooks installed the following will run automatically on a commit:
* [mypy](https://github.com/python/mypy) is used to check for type errors
* a simple format check is applied to the commit message to verify for use of [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)

Additional tools are integrated into poetry via the [poetry plugin](https://poethepoet.natn.io/poetry_plugin.html)
Additional tools are provided via [Poe the Poet](https://github.com/nat-n/poethepoet) tasks and can be run with uv.

Choose a reason for hiding this comment

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

It's also possible to ditch Poe and use project scripts:

https://github.com/i-am-bee/beeai-platform/blob/a5911f59be15fc9685144ac791575aaebc0687b7/apps/beeai-cli/pyproject.toml#L39-L41

...just mind the caveat that if the project is a library, these scripts get installed alongside it. So it's only usable for apps.

(Or we could unify and use Mise, but I'm probably overthinking this.)


Tools can also be run directly via the command line (run within `poetry shell` or prefix with `poetry run`):
Tools can be run directly via the command line (activate the venv or prefix commands with `uv run`):

* `poe lint` - lints and formats your code

Choose a reason for hiding this comment

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

I think you should write these as prefixed (uv run poe lint etc.) so people skimming this could just copy the command

Comment on lines -119 to +122
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling>=1.18"]
build-backend = "hatchling.build"

Choose a reason for hiding this comment

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

@@ -24,13 +24,13 @@ This starter template helps you **quickly** get started with the [BeeAI framewor
## 📋 Requirements

- **Python Version 3.11+**

Choose a reason for hiding this comment

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

Technically you don't need this anymore, uv will download correct Python if not present when creating the venv


You have two options:

**Option 1:** Interactive mode
```sh
python beeai_framework_starter/agent.py
uv run python beeai_framework_starter/agent.py

Choose a reason for hiding this comment

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

Suggested change
uv run python beeai_framework_starter/agent.py
uv run beeai_framework_starter/agent.py

```

**Option 2:** Define your prompt up front
```sh
python beeai_framework_starter/agent.py <<< "I am going out tomorrow morning to walk around Boston. What should I plan to wear?"
uv run python beeai_framework_starter/agent.py <<< "I am going out tomorrow morning to walk around Boston. What should I plan to wear?"

Choose a reason for hiding this comment

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

Suggested change
uv run python beeai_framework_starter/agent.py <<< "I am going out tomorrow morning to walk around Boston. What should I plan to wear?"
uv run beeai_framework_starter/agent.py <<< "I am going out tomorrow morning to walk around Boston. What should I plan to wear?"

```sh
python beeai_framework_starter/agent_code_interpreter.py <<< "Calculate 534*342?"
uv run python beeai_framework_starter/agent_code_interpreter.py <<< "Calculate 534*342?"

Choose a reason for hiding this comment

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

Suggested change
uv run python beeai_framework_starter/agent_code_interpreter.py <<< "Calculate 534*342?"
uv run beeai_framework_starter/agent_code_interpreter.py <<< "Calculate 534*342?"

```sh
python beeai_framework_starter/agent_code_interpreter.py <<< "Generate a riddle"
uv run python beeai_framework_starter/agent_code_interpreter.py <<< "Generate a riddle"

Choose a reason for hiding this comment

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

Suggested change
uv run python beeai_framework_starter/agent_code_interpreter.py <<< "Generate a riddle"
uv run beeai_framework_starter/agent_code_interpreter.py <<< "Generate a riddle"

```sh
python beeai_framework_starter/agent_workflow.py
uv run python beeai_framework_starter/agent_workflow.py

Choose a reason for hiding this comment

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

Suggested change
uv run python beeai_framework_starter/agent_workflow.py
uv run beeai_framework_starter/agent_workflow.py

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.

2 participants