Skip to content

Pin setuptools<82 on Python 3.9 to keep pkg_resources (#9829)#10045

Merged
asheshv merged 2 commits into
pgadmin-org:masterfrom
dpage:fix-9829-py39-setuptools
Jun 12, 2026
Merged

Pin setuptools<82 on Python 3.9 to keep pkg_resources (#9829)#10045
asheshv merged 2 commits into
pgadmin-org:masterfrom
dpage:fix-9829-py39-setuptools

Conversation

@dpage

@dpage dpage commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #9829.

A clean install on Python 3.9 failed with No module named 'pkg_resources'. setuptools==82.* no longer ships pkg_resources, which passlib (pulled in via Flask-Security-Too on Python 3.9) imports at runtime.

Python 3.9 is still a supported target — RHEL/Rocky/AlmaLinux 8 and 9 build the packaged venv with the system Python 3.9, and the codebase enforces 3.9 as the minimum (web/pgAdmin4.py).

Fix: version-split the setuptools pin (mirroring the existing Flask-Security-Too split) so Python 3.9 keeps a setuptools that still provides pkg_resources:

setuptools<82; python_version <= '3.9'
setuptools==82.*; python_version > '3.9'

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated v9.16 release notes with connection warning about password-exec vs passfile precedence and corrected PostgreSQL utilities versions to 18.4.
  • Bug Fixes
    • Expanded documentation of resolved issues.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ceff647a-4fab-4753-8b5f-1c0962f2b25e

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4b0a8 and 3d53856.

📒 Files selected for processing (2)
  • docs/en_US/release_notes_9_16.rst
  • requirements.txt

Walkthrough

pgAdmin v9.16 release notes are introduced, documenting server version support, a connection warning about password-exec vs passfile precedence, PostgreSQL utility versions (18.4), and bug fixes for Python 3.9 compatibility (Issue #9829) and SQL function body generation (Issue #10059). The setuptools dependency is conditionally constrained by Python version to resolve the Python 3.9 compatibility issue.

Changes

Release Notes and Dependency Updates

Layer / File(s) Summary
Release notes for v9.16
docs/en_US/release_notes_9_16.rst
Release notes page specifies supported PostgreSQL/EDB versions (13–18), sets bundled PostgreSQL utilities to version 18.4, adds a connection warning about password-exec vs passfile precedence, and documents two bug fixes: Issue #9829 (setuptools pinning for Python 3.9) and Issue #10059 (SQL function/procedure body wrapping).
Setuptools version constraint by Python version
requirements.txt
Setuptools requirement is changed from unconditional setuptools==82.* to conditional constraints: setuptools<82 for Python ≤ 3.9 and setuptools==82.* for Python > 3.9, resolving ModuleNotFoundError for pkg_resources in Python 3.9 environments.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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: pinning setuptools<82 on Python 3.9 to retain pkg_resources support, directly addressing the core issue.
Linked Issues check ✅ Passed The PR successfully implements the required fix by adding version-split setuptools constraints that ensure Python 3.9 receives a setuptools version providing pkg_resources, directly resolving issue #9829.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the stated objectives: setuptools version pinning for Python 3.9 compatibility, supporting documentation updates, and release notes reflecting the fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@dpage dpage force-pushed the fix-9829-py39-setuptools branch 2 times, most recently from 973e7cc to 6d04d40 Compare June 9, 2026 11:36
setuptools 82 stops shipping pkg_resources, which passlib (via
Flask-Security-Too on Python 3.9) imports, so a clean install on Python
3.9 failed with "No module named 'pkg_resources'". Python 3.9 is still a
supported target (RHEL/Rocky/AlmaLinux 8 and 9 build with system Python
3.9). Split the pin by Python version, mirroring the existing
Flask-Security-Too split.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dpage dpage force-pushed the fix-9829-py39-setuptools branch from 6d04d40 to dc11d11 Compare June 9, 2026 11:37
@asheshv asheshv requested a review from Copilot June 10, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Resolves install/runtime failures on Python 3.9 where pkg_resources is missing by splitting the setuptools requirement based on python_version, and documents the fix in the v9.16 release notes.

Changes:

  • Version-split setuptools so Python 3.9 avoids setuptools==82.* (which no longer provides pkg_resources).
  • Add a v9.16 release note entry referencing Issue #9829.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
requirements.txt Splits setuptools constraint by Python version to preserve pkg_resources on Python 3.9.
docs/en_US/release_notes_9_16.rst Documents the Python 3.9 installation fix for Issue #9829.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@asheshv asheshv 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.

Pin is correct — passlib 1.7.x still uses pkg_resources and we're locked to Flask-Security-Too 5.6 on Python 3.9.

Two small asks before merge:

  1. Tighten the lower bound: setuptools>=70,<82 (matches the convention used elsewhere in the file and prevents a fresh-venv resolver from picking up an ancient version).
  2. Add an inline comment or an issue reference noting the real fix path — FST ≥5.7 + libpass once Python 3.9 support is dropped — otherwise this pin will age silently.

@asheshv asheshv merged commit 6de0f37 into pgadmin-org:master Jun 12, 2026
32 of 34 checks passed
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.

Installation error with Python3.9

3 participants