Skip to content

fix: add explicit greenlet dependency for SQLAlchemy async support#27

Closed
szerintedmi wants to merge 1 commit intocodingworkflow:mainfrom
szerintedmi:fix/add-greenlet-dependency
Closed

fix: add explicit greenlet dependency for SQLAlchemy async support#27
szerintedmi wants to merge 1 commit intocodingworkflow:mainfrom
szerintedmi:fix/add-greenlet-dependency

Conversation

@szerintedmi
Copy link

@szerintedmi szerintedmi commented Feb 14, 2026

Summary

  • Add greenlet>=3.0.0 as an explicit dependency in pyproject.toml

Problem

SQLAlchemy's async features (used with aiosqlite) require greenlet at runtime, but it's not always installed as a transitive dependency. This caused make start to fail on macOS with a missing module error.

Test plan

  • make start runs without import errors on macOS

Summary by CodeRabbit

  • Chores
    • Updated runtime dependencies: added greenlet (>=3.0.0) to ensure compatibility with recent environments.

@qodo-free-for-open-source-projects

Review Summary by Qodo

Add explicit greenlet dependency for SQLAlchemy async

🐞 Bug fix ✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add explicit greenlet>=3.0.0 dependency for SQLAlchemy async support
• Resolves missing module errors on macOS when running make start
• Ensures greenlet is installed as direct dependency, not transitive
Diagram
flowchart LR
  A["SQLAlchemy async features"] -- "requires at runtime" --> B["greenlet"]
  C["pyproject.toml"] -- "adds explicit dependency" --> B
  B -- "fixes missing module error" --> D["make start succeeds"]
Loading

Grey Divider

File Changes

1. pyproject.toml Dependencies +1/-0

Add greenlet as explicit project dependency

• Added greenlet>=3.0.0 as explicit dependency in project dependencies list
• Positioned after sqlalchemy>=2.0.23 and before aiosqlite>=0.19.0
• Ensures greenlet is available at runtime for SQLAlchemy async operations

pyproject.toml


Grey Divider

Qodo Logo

@gemini-code-assist
Copy link

Summary of Changes

Hello @szerintedmi, 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 addresses a critical issue where SQLAlchemy's asynchronous capabilities, particularly when used with aiosqlite, failed due to a missing greenlet dependency. By explicitly adding greenlet to the project's dependencies, the change ensures that the application can reliably start and operate on systems like macOS, preventing runtime import errors.

Highlights

  • Dependency Management: Added greenlet>=3.0.0 as an explicit dependency in pyproject.toml to ensure SQLAlchemy's async features function correctly.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • pyproject.toml
    • Added greenlet>=3.0.0 to the project's core dependencies.
Activity
  • No review activity or comments have been recorded yet.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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.

@coderabbitai
Copy link

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

Added greenlet>=3.0.0 as a runtime dependency in project metadata files (pyproject.toml and setup.py). No code or control-flow changes.

Changes

Cohort / File(s) Summary
Dependency Addition
pyproject.toml, setup.py
Added greenlet>=3.0.0 to project dependencies (runtime/install_requires).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A tiny hop, a single line,
greenlet lands to thread and shine.
No code changed, just versions sing,
concurrency waits on nimble spring.
— from a rabbit, light and fine

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding an explicit greenlet dependency for SQLAlchemy async support, which matches the actual changeset that adds greenlet>=3.0.0 to both pyproject.toml and setup.py.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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 correctly addresses a runtime dependency issue by explicitly adding greenlet for SQLAlchemy's async support. The change is necessary and well-justified. I've included one suggestion to add a comment to pyproject.toml to improve long-term maintainability by making the reason for this dependency clear directly in the configuration.

"python-multipart>=0.0.6",
"pydantic-settings>=2.1.0",
"sqlalchemy>=2.0.23",
"greenlet>=3.0.0",

Choose a reason for hiding this comment

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

medium

For better long-term maintainability, it's good practice to add a comment explaining why this explicit dependency is needed. This helps future developers understand the context without having to dig through git history. greenlet is required for SQLAlchemy's async support but isn't always installed as a transitive dependency, which is not immediately obvious.

Suggested change
"greenlet>=3.0.0",
# Required for SQLAlchemy async support (e.g., with aiosqlite)
"greenlet>=3.0.0",

@qodo-free-for-open-source-projects

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. setup.py omits greenlet 🐞 Bug ⛯ Reliability
Description
greenlet is added only to pyproject.toml, but legacy/non-PEP517 installs that rely on setup.py
(including the Dockerfile fallback) will still not install it, so the runtime ModuleNotFoundError
may persist. This also increases the risk of inconsistent environments across dev/Docker/CI.
Code

pyproject.toml[37]

+    "greenlet>=3.0.0",
Evidence
The repo uses SQLAlchemy async engine/session code paths, which require greenlet at runtime. While
pyproject.toml now includes greenlet, setup.py’s install_requires does not, and several
documented install paths use pip install -e . and/or a Dockerfile fallback that can end up using
the setup.py dependency list—leading to environments where greenlet is still missing.

pyproject.toml[26-44]
setup.py[16-32]
docker/Dockerfile[31-36]
Makefile[30-37]
docs/DOCKER_OAUTH_SETUP.md[32-36]
claude_code_api/core/database.py[30-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`greenlet` was added to `pyproject.toml` only. Some install flows can still rely on `setup.py` (legacy editable installs or the Dockerfile fallback), so `greenlet` may still not be installed and the runtime failure can persist.

## Issue Context
- The codebase uses SQLAlchemy async (`create_async_engine`, `async_sessionmaker`) with `aiosqlite`.
- The repo contains both `pyproject.toml` (PEP 621 deps) and a separate `setup.py` `install_requires` list.
- The Dockerfile explicitly falls back to `pip install -e .` if the PEP517 editable install fails.

## Fix Focus Areas
- setup.py[16-33]
- docker/Dockerfile[31-36]
- pyproject.toml[26-44]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

SQLAlchemy's async features (used with aiosqlite) require greenlet at
runtime, but it's not always installed as a transitive dependency.
This caused make start to fail on macOS with a missing module error.

Added greenlet>=3.0.0 to both pyproject.toml and setup.py to ensure
consistent installs across PEP517 and legacy/Docker fallback paths.
@szerintedmi szerintedmi force-pushed the fix/add-greenlet-dependency branch from c3e8125 to f092e04 Compare February 14, 2026 13:35
@Mehdi-Bl
Copy link
Contributor

@szerintedmi thanks for feedback.
Will add another layer of end to end testings, on multiple os's to check this or any other missing issues.

@Mehdi-Bl
Copy link
Contributor

Closing as superseded by #32, which is merged and includes the dependency/install matrix validation and the greenlet runtime dependency fix on .

@Mehdi-Bl Mehdi-Bl closed this Feb 15, 2026
@Mehdi-Bl
Copy link
Contributor

@szerintedmi thank you and you are welcome if you have feedback. Hope to make this working and useful.
The discussion space is open for this.

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