Skip to content

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

Open
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix-9829-py39-setuptools
Open

Pin setuptools<82 on Python 3.9 to keep pkg_resources (#9829)#10045
dpage wants to merge 1 commit 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

    • Added release notes for version 9.16, including support for PostgreSQL and EDB Advanced Server versions 13–18 and PostgreSQL utilities version 18.2.
  • Chores

    • Updated setuptools dependency constraints for improved Python version compatibility.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@dpage, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 7 minutes and 17 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 96d5e7bd-a83b-4ee1-98a1-ee5bbbb56a9d

📥 Commits

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

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

Walkthrough

This PR adds release notes documentation for pgAdmin v9.16 and fixes a Python 3.9 compatibility issue by making the setuptools version constraint conditional based on the Python interpreter version during installation.

Changes

Documentation and Dependency Updates

Layer / File(s) Summary
Release notes for v9.16
docs/en_US/release_notes_9_16.rst, docs/en_US/release_notes.rst
New release notes page for v9.16 is created, documenting supported database versions (PostgreSQL and EDB Advanced Server 13–18), bundled utilities (PostgreSQL 18.2), and a bug-fix entry for Issue #9829. The Sphinx release notes index is updated to include the new page.
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 or lower, and setuptools==82.* for Python versions above 3.9, resolving pkg_resources ModuleNotFoundError in Python 3.9 environments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • pgadmin-org/pgadmin4#9647: Both PRs update Sphinx release notes content under docs/en_US/, adding and modifying release notes pages for specific versions.
🚥 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.

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

2 participants