Make pytest-celery package install configurable in worker Dockerfile#475
Merged
auvipy merged 2 commits intocelery:mainfrom Mar 2, 2026
Merged
Conversation
0353e52 to
130da97
Compare
Added PYTEST_CELERY_PKG build arg to the worker Dockerfile, defaulting to 'pytest-celery' (PyPI). This allows CI and users to override the install source, e.g. to install from a specific branch: PYTEST_CELERY_PKG='pytest-celery@git+https://github.com/celery/pytest-celery.git@my-branch' - Added PYTEST_CELERY_PKG ARG to Dockerfile (default: pytest-celery) - Added DEFAULT_WORKER_PYTEST_CELERY_PKG constant - Added pytest_celery_pkg() classmethod to CeleryWorkerContainer - Added default_worker_pytest_celery_pkg fixture - Wired into buildargs() and celery_base_worker_image build fixture
130da97 to
f8e8218
Compare
There was a problem hiding this comment.
Pull request overview
Adds a configurable PYTEST_CELERY_PKG build argument so the built-in worker image can install pytest-celery from PyPI by default or from an alternate source (e.g., a git ref) in CI/custom setups.
Changes:
- Introduces
DEFAULT_WORKER_PYTEST_CELERY_PKGand threads it throughCeleryWorkerContainer.buildargs(). - Adds a session fixture
default_worker_pytest_celery_pkgand wires it into the worker image build args. - Updates CI workflows to set
PYTEST_CELERY_PKGto installpytest-celeryfrom the current repo.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/vendors/test_worker/test_worker.py | Updates buildargs unit test to include PYTEST_CELERY_PKG. |
| src/pytest_celery/vendors/worker/fixtures.py | Adds default_worker_pytest_celery_pkg fixture and passes it into celery_base_worker_image build args. |
| src/pytest_celery/vendors/worker/defaults.py | Adds DEFAULT_WORKER_PYTEST_CELERY_PKG defaulting from PYTEST_CELERY_PKG env var. |
| src/pytest_celery/vendors/worker/container.py | Adds pytest_celery_pkg() and includes it in buildargs(). |
| src/pytest_celery/vendors/worker/Dockerfile | Adds ARG PYTEST_CELERY_PKG and installs it via pip during image build. |
| src/pytest_celery/init.py | Exposes the new fixture when the worker vendor is installed. |
| .github/workflows/python-package.yml | Sets PYTEST_CELERY_PKG for CI runs. |
| .github/workflows/examples.yml | Sets PYTEST_CELERY_PKG for examples CI runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #475 +/- ##
==========================================
- Coverage 23.80% 23.71% -0.09%
==========================================
Files 41 41
Lines 1294 1303 +9
Branches 78 78
==========================================
+ Hits 308 309 +1
- Misses 959 967 +8
Partials 27 27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Quote ${PYTEST_CELERY_PKG} in Dockerfile to prevent shell word-splitting
- Use commit SHA instead of branch name in CI workflows for deterministic builds
auvipy
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added PYTEST_CELERY_PKG build arg to the worker Dockerfile, defaulting to 'pytest-celery' (PyPI). This allows CI and users to override the install source, e.g. to install from a specific branch:
PYTEST_CELERY_PKG='pytest-celery@git+https://github.com/celery/pytest-celery.git@my-branch'