[Django] #36794: Cache python dependencies on GitHub Actions

4 views
Skip to first unread message

Django

unread,
Dec 11, 2025, 2:54:21 PM (5 days ago) Dec 11
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Type:
| Cleanup/optimization
Status: new | Component: Core
| (Other)
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Good task for new-ish contributor:
Make a small survey of how other major python projects cache their
dependencies in their Github Actions workflows, and implement something
for Django.

Note there are several workflows that would make use of this.

Adam Johnson's blog:
https://adamj.eu/tech/2023/11/02/github-actions-faster-python-virtual-
environments/

This would shave about a minute off the test job.
--
Ticket URL: <https://code.djangoproject.com/ticket/36794>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 11, 2025, 3:03:01 PM (5 days ago) Dec 11
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nilesh
Type: | Pahari
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nilesh Pahari):

* owner: (none) => Nilesh Pahari
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36794#comment:1>

Django

unread,
Dec 12, 2025, 10:42:46 AM (4 days ago) Dec 12
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nilesh
Type: | Pahari
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Clifford Gama):

* stage: Unreviewed => Accepted

--
Ticket URL: <https://code.djangoproject.com/ticket/36794#comment:2>

Django

unread,
11:44 AM (6 hours ago) 11:44 AM
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nilesh
Type: | Pahari
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* cc: Pravin (added)
* has_patch: 0 => 1
* needs_better_patch: 0 => 1

Comment:

Nilesh, there's a contributor who is already submitting a pull request for
this, so just be aware, you may wish to restate your intentions or
collaborate with them. Pravin, please accommodate Nilesh if they would
prefer to keep working. Also, you have several other PRs open, not all of
which follow the contribution guidelines for commit & PR titles. It would
be better to focus on bringing those to completion first.

[https://github.com/django/django/pull/20414 PR] (draft)
--
Ticket URL: <https://code.djangoproject.com/ticket/36794#comment:3>

Django

unread,
11:56 AM (6 hours ago) 11:56 AM
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nilesh
Type: | Pahari
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Nilesh Pahari):

Replying to [comment:3 Jacob Walls]:
> Nilesh, there's a contributor who is already submitting a pull request
for this, so just be aware, you may wish to restate your intentions or
collaborate with them. Pravin, please accommodate Nilesh if they would
prefer to keep working. Also, you have several other PRs open, not all of
which follow the contribution guidelines for commit & PR titles. It would
be better to focus on bringing those to completion first.
>
> [https://github.com/django/django/pull/20414 PR] (draft)

Hi!
I wasn't able to find any other major project using the pattern mentioned
in the Adam Johnson's blog, so I just replicated the pattern (mentioned in
the blog) on all the workflows in order to cache the whole virtual
environment rather than just the python wheels. I have already made the
changes and will be raising a PR shortly. Also just to confirm, the note
about having several open PRs was directed at me?
--
Ticket URL: <https://code.djangoproject.com/ticket/36794#comment:4>

Django

unread,
12:32 PM (5 hours ago) 12:32 PM
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nilesh
Type: | Pahari
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

Nope, it was not. Sorry for the confusion!
--
Ticket URL: <https://code.djangoproject.com/ticket/36794#comment:5>

Django

unread,
12:43 PM (5 hours ago) 12:43 PM
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nilesh
Type: | Pahari
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0

Comment:

[https://github.com/django/django/pull/20415 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/36794#comment:6>

Django

unread,
1:04 PM (5 hours ago) 1:04 PM
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nilesh
Type: | Pahari
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36794#comment:7>

Django

unread,
3:23 PM (2 hours ago) 3:23 PM
to django-...@googlegroups.com
#36794: Cache python dependencies on GitHub Actions
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nilesh
Type: | Pahari
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Nilesh Pahari):

Workflows are now passing. I also made them more robust by adding a check
to only create the virtual environment when it doesn’t already exist.
--
Ticket URL: <https://code.djangoproject.com/ticket/36794#comment:8>
Reply all
Reply to author
Forward
0 new messages