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-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.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hatch_nodejs_version-0.3.2.tar.gz | 16.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hatch_nodejs_version-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.5 kB
Release files / hatch_nodejs_version-0.3.2.tar.gz
| Download URL | hatch_nodejs_version-0.3.2.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a7828d817b71e50bbbbb01c9bfc0b329657b7900c56846489b9c958de15b54c
|
|
BLAKE2b-256 checksum How to use checksums |
afb6c9406cfa9edf740c6b3de6173408a159228eac0cee80eead4a5b9cc88848
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / hatch_nodejs_version-0.3.2-py3-none-any.whl
| Download URL | hatch_nodejs_version-0.3.2-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d73e728f1a262d214afe9c0a40e161013ef0b7a6c78ff843293880f6a46ede79
|
|
BLAKE2b-256 checksum How to use checksums |
b7feb23e9bca77cafecd1a10450066a1a4ca329149ad36aa86cdf8e67c2d2fa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|