Skip to content

fix: Python 3.11 compatibility — update deps and fix setup#258

Open
zyhui98 wants to merge 6 commits into
ptpb:masterfrom
zyhui98:fix/python311-compatibility
Open

fix: Python 3.11 compatibility — update deps and fix setup#258
zyhui98 wants to merge 6 commits into
ptpb:masterfrom
zyhui98:fix/python311-compatibility

Conversation

@zyhui98

@zyhui98 zyhui98 commented Jun 5, 2026

Copy link
Copy Markdown

Summary

This PR fixes 6 issues that prevent building the Docker image on Python 3.11. See #257 for detailed breakdown.

Changes

requirements.txt

  • Fix: Remove BOM (U+FEFF) character at file start
  • Upgrade: pymongo 3.7.24.6.3 (C extension incompatible with Python 3.11)
  • Upgrade: docutils 0.140.20.1 (removed 'rU' mode in Python 3.11)

setup.py

  • Fix: install_requires = list(f) includes raw \n in strings → [line.strip() for line in f if line.strip()]

Dockerfile

  • Pre-install setuptools-scm before pip install /build to avoid PEP 517 build isolation failures
  • Upgrade pip first for best resolver compatibility

Before (broken)

pymongo.errors.ServerSelectionTimeoutError: PY_SSIZE_T_CLEAN macro must be defined
ValueError: invalid mode: 'rU'
error in setup command: Expected package name at the start of dependency specifier

After (working)

docker-compose build && docker-compose up
→ pb running on :10002 ✅

zyhui98 added 6 commits June 5, 2026 18:51
- Fix BOM character in requirements.txt
- Fix setup.py to strip newlines from requirements
- Upgrade pymongo 3.7.2 → 4.6.3 (C extension compat with 3.11)
- Upgrade docutils 0.14 → 0.20.1 (removed 'rU' mode in 3.11)
- Pre-install setuptools-scm in Dockerfile to avoid PEP 517 build isolation issues
- Upgrade pip before installing to ensure latest resolver
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