Hatch plugin for versioning from a package.json file
Project description
hatch-nodejs-version
This provides a version source plugin for Hatch that reads/writes the package version from the version field of the NodeJS package.json file.
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 round-trip support, and ensure semantic consistency between NodeJS and Python, this plugin only accepts the common version parts:
majorminorpatchpre-release
e.g. 1.2.3-rc0.
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 |
|---|---|---|---|
fields |
list of str |
None | Optional list of fields to take from the generated metadata object. |
License
hatch-nodejs-version is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hatch_nodejs_version-0.2.1.tar.gz.
File metadata
- Download URL: hatch_nodejs_version-0.2.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19f7486eef996e0541ff08cdfaa0fdb5a995d7f276ef11d86c9284755746bf8b
|
|
| MD5 |
b0ed415a91d7e5b335d60a2c82ad11a8
|
|
| BLAKE2b-256 |
5ef4402737ed7b1637b0ebb3fd4305b59fd4dedfed61597d1f4f5c7f90ce2347
|
File details
Details for the file hatch_nodejs_version-0.2.1-py3-none-any.whl.
File metadata
- Download URL: hatch_nodejs_version-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89852224b6d083bbfb40efcd55235763142042fd3ac1f03457b45b727c54865f
|
|
| MD5 |
b9313dbd955822d8175d41d59569249f
|
|
| BLAKE2b-256 |
b17e1bbb2eba33169797a8d7bb7d2ddeb151526369d8f9d61bf3ceb0e8d634b6
|