hatch-npm-vendor
Hatchling build hook that downloads pinned npm packages (with Subresource Integrity
checks) into node_modules and includes them in wheels via force_include.
Usage
[build-system]
requires = ["hatchling>=1.27", "hatch-npm-vendor"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel.hooks.npm-vendor]
dependencies = ["hatch-npm-vendor"]
[[tool.hatch.build.targets.wheel.hooks.npm-vendor.packages]]
dest = "my_pkg/assets/node_modules/some-npm-package"
package = "some-npm-package"
version = "1.2.3"
integrity = "sha512-…"
# Additional packages (any destination you like):
[[tool.hatch.build.targets.wheel.hooks.npm-vendor.packages]]
dest = "my_pkg/assets/vendor/another-package"
package = "another-package"
version = "4.5.6"
integrity = "sha512-…"
| Option | Default | Description |
|---|---|---|
packages |
(required) | Array of tables, one per npm package (at least one). |
src |
"src" |
Project source root; each dest is relative to it. |
registry |
https://registry.npmjs.org |
npm registry base URL. |
Each packages entry (all fields required):
dest: directory, relative tosrc, that the package is extracted into (replaced on every build) and shipped at the same path in the wheel.package,version: the npm package to fetch.integrity: thesha512-…value from the registry (npm view <package>@<version> dist.integrity).
Set HATCH_NPM_VENDOR_SKIP=1 to skip vendoring (e.g. sdist-only workflows).
Development
prek install
uv sync
uv run pytest
uv build
Releasing
Commits follow Conventional Commits
(checked by the commitizen hook in prek.toml; run prek install once).
uv run cz bump # bump version, update CHANGELOG.md, commit and tag
git push --follow-tags # the v* tag triggers the Release workflow
The Release workflow publishes to PyPI and creates a GitHub Release whose body
is the matching CHANGELOG.md section.
Metadata
Release files for hatch-npm-vendor 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hatch_npm_vendor-0.1.0.tar.gz | 5.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hatch_npm_vendor-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.0 kB
Release files / hatch_npm_vendor-0.1.0.tar.gz
| Download URL | hatch_npm_vendor-0.1.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8529dca7a4cb72294dc6211d456eac29b7a5c89ebc3f0adeaea1850819458acc
|
|
BLAKE2b-256 checksum How to use checksums |
02ceb1f6d0effe72531d51d9a4b7418a7c84c60ab8d58c8e392c3e0542bc4445
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency logRelease files / hatch_npm_vendor-0.1.0-py3-none-any.whl
| Download URL | hatch_npm_vendor-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a99bfe6b873f16af64ce6c3ca63a6720d9a1a4622cb9f1eff1d119af2955b9d
|
|
BLAKE2b-256 checksum How to use checksums |
6eecaa0100df35747d5102cc7dbff12a609972734faf34b113b2e39f56719bec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency logSecurity for hatch-npm-vendor 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for hatch_npm_vendor-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.