fix: pinning setup tools to avoid pkg_resources removal issue#199
fix: pinning setup tools to avoid pkg_resources removal issue#199
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a critical issue where setuptools v82.0.0 removed the pkg_resources module, causing ModuleNotFoundError in dependencies like djchoices. The fix pins setuptools to versions below 82.0.0 across multiple Docker images to prevent build failures.
Changes:
- Added setuptools version constraint
"setuptools<82.0.0"before installing requirements in multiple Dockerfiles - Applied consistently across both production and development stages where applicable
- Includes explanatory comments for each pin
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| dockerfiles/xqueue.Dockerfile | Added setuptools pin in dev and production stages before requirements installation |
| dockerfiles/portal-designer.Dockerfile | Added setuptools pin in app and devstack stages before requirements installation |
| dockerfiles/edx-platform.Dockerfile | Added setuptools pin in builder-production and builder-development stages before requirements installation |
| dockerfiles/edx-notes-api.Dockerfile | Added setuptools pin before requirements installation |
| dockerfiles/edx-exams.Dockerfile | Added setuptools pin in app and devstack stages before requirements installation |
| dockerfiles/ecommerce.Dockerfile | Added setuptools pin in prod and dev stages before requirements installation |
| dockerfiles/course-discovery.Dockerfile | Added setuptools pin in prod and dev stages before requirements installation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
488daf3 to
e1a00a0
Compare
c110428 to
9250c17
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9250c17 to
6eb7c5b
Compare
There was a problem hiding this comment.
We should take this opportunity to clean up where venv and pip come from. In summary we SHOULD NOT install python packages globally without using apt-get, we SHOULD leverage the venv module actually bundled with the python version we're using from the deadsnakes PPA, and we SHOULD NOT install random binaries from the internet (via get-pip.py) if avoidable.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RUN apt-get update && apt-get -qy install --no-install-recommends \ | ||
| build-essential \ | ||
| language-pack-en \ | ||
| locales \ | ||
| pkg-config \ | ||
| libmysqlclient-dev \ | ||
| libssl-dev \ | ||
| git \ | ||
| wget \ | ||
| curl \ | ||
| libffi-dev \ | ||
| libsqlite3-dev \ | ||
| python3-pip \ | ||
| python${PYTHON_VERSION} \ | ||
| python${PYTHON_VERSION}-dev | ||
| python${PYTHON_VERSION}-dev \ | ||
| python${PYTHON_VERSION}-venv |
There was a problem hiding this comment.
The header comment still lists python3-pip as an installed package, but this Dockerfile no longer installs it (it now relies on the venv-provided pip). Please update the package list comment to match the actual installed packages so it doesn’t mislead future edits.
setuptools v82.0.0 removed
pkg_resources, causingModuleNotFoundErrorin dependencies likedjchoices. See recent docker build failures here. This PR pins the setup tools version in order to push out our enterprise Docker images.