hatch-nodejs-version
This package provides two Hatch plugins:
- version source plugin that reads/writes the package version
from the
versionfield of the Node.jspackage.jsonfile. - metadata hook plugin that reads PEP 621 metadata from the
Node.js
package.jsonfile.
Table of Contents
Global dependency
Ensure hatch-nodejs-version is defined within the build-system.requires field in your pyproject.toml file.
[build-system]
requires = ["hatchling", "hatch-nodejs-version"]
build-backend = "hatchling.build"
Version source
The version source plugin name is nodejs.
-
pyproject.toml
[tool.hatch.version] source = "nodejs"
-
hatch.toml
[version] source = "nodejs"
Semver
The semver specification defines the following version sections:
majorminorpatchpre-releasebuild
Meanwhile, PEP 440 defines:
epochmajorminorpatchpre-releasepost-releasedev-release
In order to ensure contentful round-trip support, and ensure semantic consistency between Node.js and Python, this plugin only accepts the common version parts:
majorminorpatchpre-releasedev-release
e.g. 1.2.3-rc0.
Note that where normalisation occurs, the round-trip result will differ. This can be avoided by careful choice of the delimeters e.g. -..
Version source options
| Option | Type | Default | Description |
|---|---|---|---|
path |
str |
package.json |
Relative path to the package.json file. |
Metadata hook
The metadata hook plugin name is nodejs.
-
pyproject.toml
[tool.hatch.metadata.hooks.nodejs] -
hatch.toml
[metadata.hooks.nodejs]
Metadata hook options
| Option | Type | Default | Description |
|---|---|---|---|
path |
str |
"package.json" |
Relative path to the package.json file. |
fields |
list of str |
None |
Optional list of pyproject.toml fields to take from their counterparts in package.json. If missing, take all of the available fields. |
contributors-as-maintainers |
bool |
True |
Whether contributors in package.json should be considered maintainers (otherwise, treat them as authors). |
bugs-label |
str |
"Bug Tracker" |
The key in the URLs table of pyproject.toml that is populated by the bugs field in package.json |
homepage-label |
str |
"Homepage" |
The key in the URLs table of pyproject.toml that is populated by the homepage field in package.json |
repository-label |
str |
"Repository" |
The key in the URLs table of pyproject.toml that is populated by the repository field in package.json |
License
hatch-nodejs-version is distributed under the terms of the MIT license.
Metadata
Release files for hatch-nodejs-version 0.4.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_nodejs_version-0.4.0.tar.gz | 17.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hatch_nodejs_version-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.7 kB
Release files / hatch_nodejs_version-0.4.0.tar.gz
| Download URL | hatch_nodejs_version-0.4.0.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2428ea398dd053f019d2b7ac949dd6b690ca8e826b6d433ad13c5b6c475ae91b
|
|
BLAKE2b-256 checksum How to use checksums |
19c91823a9e45eadd487bece8f2b3b29311edd79ba900d874885b1e9f7973a50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / hatch_nodejs_version-0.4.0-py3-none-any.whl
| Download URL | hatch_nodejs_version-0.4.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
37ac31fce33ede0b47a59c4c8ffed232e11113bda9618a95bd07ec716260d5c7
|
|
BLAKE2b-256 checksum How to use checksums |
bea6bda41831a7999ad7e167cc0aeb9dd03b057cc68df08105ced569309f7f59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Security for hatch-nodejs-version 0.4.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.