Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DebugConfiguredStorage with URLMixin in staticfiles panel #2097

Merged
merged 26 commits into from
Mar 5, 2025

Conversation

dr-rompecabezas
Copy link
Member

@dr-rompecabezas dr-rompecabezas commented Mar 5, 2025

Description

This PR supersedes #2069

Fixes #2068

From @matthiask : This change might address an issue where reinstantiating the staticfiles class inside our staticfiles panel would lose some attributes of the storage instance.

Tests added by @dr-rompecabezas

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

Sorry, something went wrong.

matthiask and others added 2 commits February 6, 2025 08:45

Verified

This commit was signed with the committer’s verified signature.
matthiask Matthias Kestenholz
…asses
- Test storage state preservation to ensure URLMixin doesn't affect
  storage attributes
- Test context variable lifecycle for static file tracking
- Test multiple initialization safety to prevent URLMixin stacking
@dr-rompecabezas dr-rompecabezas changed the title Replace DebugStaticFilesStorage with URLMixin in staticfiles panel Replace DebugConfiguredStorage with URLMixin in staticfiles panel Mar 5, 2025
Copy link
Member

@matthiask matthiask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

Now we just need a note in docs/changes.rst and a ready-to-review PR (no need to mark it as a draft anymore!) and it's good to go.

pre-commit-ci bot and others added 21 commits March 5, 2025 10:38
updates:
- [github.com/adamchainz/django-upgrade: 1.22.2 → 1.23.1](adamchainz/django-upgrade@1.22.2...1.23.1)
- [github.com/pre-commit/mirrors-eslint: v9.19.0 → v9.20.0](pre-commit/mirrors-eslint@v9.19.0...v9.20.0)
- [github.com/astral-sh/ruff-pre-commit: v0.9.4 → v0.9.6](astral-sh/ruff-pre-commit@v0.9.4...v0.9.6)

Signed-off-by: Matthias Kestenholz <mk@feinheit.ch>
…2078)

* Update package metadata to include well-known labels
The issue has been reported upstream, for now we just want passing tests.

Refs django-commons#2082.
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/mirrors-eslint: v9.20.0 → v9.21.0](pre-commit/mirrors-eslint@v9.20.0...v9.21.0)
- [github.com/astral-sh/ruff-pre-commit: v0.9.6 → v0.9.7](astral-sh/ruff-pre-commit@v0.9.6...v0.9.7)

* Update the ESLint dependency

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthias Kestenholz <mk@feinheit.ch>
This adds a new section to the documentation, "Resources", which
provides a curated list of tutorials and talks.

- Favor conference site links and DjangoTV over YouTube
- Make the invitation to contribute more inviting
- Remove the criteria for inclusion and contributing sections
…mmons#2066)

This checks if the SHOW_TOOLBAR_CALLBACK is a coroutine
if we're in async mode and the reverse if it's not. It
will automatically wrap the function with sync_to_async
or async_to_sync when necessary.

* ASGI check approach with added test and docs
* async compatible require_toolbar and tests
* add docs for async require_toolbar

---------

Co-authored-by: Aman Pandey <aman2001mi@gmail.com>
biome is faster and nicer to configure with pre-commit.

Closes django-commons#2065.
The way how they do not override the value of 'this' makes implementing handlers and callbacks so nuch nicer.
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.7 → v0.9.9](astral-sh/ruff-pre-commit@v0.9.7...v0.9.9)
- [github.com/tox-dev/pyproject-fmt: v2.5.0 → v2.5.1](tox-dev/pyproject-fmt@v2.5.0...v2.5.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@matthiask matthiask marked this pull request as ready for review March 5, 2025 15:45

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
pre-commit-ci bot and others added 2 commits March 5, 2025 15:46
for more information, see https://pre-commit.ci

Verified

This commit was signed with the committer’s verified signature.
matthiask Matthias Kestenholz
@matthiask matthiask merged commit e885fe9 into django-commons:main Mar 5, 2025
25 checks passed
@dr-rompecabezas dr-rompecabezas deleted the add-tests-for-2068 branch March 5, 2025 16:00
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.

Version 5.0 breaks collectstatic when using some storage backends
6 participants