Skip to content

Fix fingerprint stacking on incremental builds (#11)#12

Merged
sn merged 1 commit into
mainfrom
11-fingerprint-stacking-incremental-builds-produce-duplicate-hashed-filenames
Apr 16, 2026
Merged

Fix fingerprint stacking on incremental builds (#11)#12
sn merged 1 commit into
mainfrom
11-fingerprint-stacking-incremental-builds-produce-duplicate-hashed-filenames

Conversation

@sn
Copy link
Copy Markdown
Contributor

@sn sn commented Apr 16, 2026

This pull request improves the asset fingerprinting logic in the bundler to prevent files from being re-fingerprinted across multiple builds, addressing an issue where hashes could be stacked on filenames. It also adds new tests to ensure this behavior and moves the html5lib dependency from the development group to required dependencies.

Asset fingerprinting improvements:

  • Updated the Bundler.fingerprint_assets method to skip files that are already fingerprinted (i.e., filenames ending with an 8-character hex hash), preventing double hashing on incremental builds. [1] [2]
  • Added a regular expression _FINGERPRINT_RE to reliably detect already fingerprinted files by their naming pattern.

Testing enhancements:

  • Added two new tests in tests/test_bundler.py to verify that already fingerprinted files are skipped and that incremental builds do not stack hashes or create duplicate fingerprinted files.

Dependency management:

  • Moved html5lib from the dev optional dependencies to the main dependencies in pyproject.toml, making it a required package for the project.
  • Bumped the project version from 1.0.12 to 1.0.13 in pyproject.toml.

@sn sn self-assigned this Apr 16, 2026
@sn sn linked an issue Apr 16, 2026 that may be closed by this pull request
@sn sn merged commit d8e91fa into main Apr 16, 2026
6 checks passed
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.

Fingerprint stacking: incremental builds produce duplicate hashed filenames

1 participant