Skip to content

🐛 [bug fix] Replace psycopg2 with psycopg for Python 3.14 compatibility - #225

Draft
JenR8ed wants to merge 2 commits into
mainfrom
fix-psycopg2-vercel-6982451464418265191
Draft

🐛 [bug fix] Replace psycopg2 with psycopg for Python 3.14 compatibility#225
JenR8ed wants to merge 2 commits into
mainfrom
fix-psycopg2-vercel-6982451464418265191

Conversation

@JenR8ed

@JenR8ed JenR8ed commented Jul 11, 2026

Copy link
Copy Markdown
Owner

The build is failing on Vercel because psycopg2-binary==2.9.9 does not have pre-compiled binary "wheels" available for CPython 3.14.3. This causes the build to fall back to a source compilation which fails due to the missing pg_config executable on Vercel's serverless environment.

To fix this, I have:

  1. Replaced psycopg2-binary==2.9.9 with the modern psycopg>=3.1.18 (v3) in requirements.txt.
  2. Updated the database connection imports and calls in seed_db.py from psycopg2 to psycopg.
  3. Updated the mock references in tests/test_seed_db_security.py to target psycopg instead of psycopg2.

I verified that the test suite passes successfully.


PR created automatically by Jules for task 6982451464418265191 started by @JenR8ed

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
notion-unified-webhook Ignored Ignored Jul 11, 2026 12:21pm

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

Copy link
Copy Markdown
Contributor

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 PostgreSQL adapter in requirements.txt from psycopg2-binary to psycopg (v3). The reviewer notes that the pure Python psycopg package requires a system-installed libpq library, which can lead to runtime import errors in serverless environments like Vercel. They recommend using psycopg[binary] instead to bundle the pre-compiled binaries.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread requirements.txt
Pillow>=10.0.0
python-telegram-bot==21.0.1
psycopg2-binary==2.9.9
psycopg>=3.1.18

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

In Psycopg 3, the base psycopg package is a pure Python implementation that requires a system-installed libpq library to function. On serverless environments like Vercel, libpq is typically not pre-installed, which will cause runtime import errors (e.g., ImportError: no pq wrapper available).

To ensure the library works out-of-the-box without requiring system-level dependencies or compilation, you should use the [binary] extra, which installs the pre-compiled psycopg-binary package alongside it.

psycopg[binary]>=3.1.18

…zation

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
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