Skip to main content

hatch-nodejs-version

PyPI - Version PyPI - Python Version Hatch project


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:

  • major
  • minor
  • patch
  • pre-release
  • build

Meanwhile, PEP 440 defines:

  • epoch
  • major
  • minor
  • patch
  • pre-release
  • post-release
  • dev-release

In order to ensure round-trip support, and ensure semantic consistency between NodeJS and Python, this plugin only accepts the common version parts:

  • major
  • minor
  • patch
  • pre-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.

Metadata

Release files for hatch-nodejs-version 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hatch-nodejs-version 0.2.1
File Size Uploaded
hatch_nodejs_version-0.2.1.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hatch-nodejs-version 0.2.1
File Interpreter ABI Platform
hatch_nodejs_version-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.2 kB

Release files / hatch_nodejs_version-0.2.1.tar.gz

Download URL hatch_nodejs_version-0.2.1.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
19f7486eef996e0541ff08cdfaa0fdb5a995d7f276ef11d86c9284755746bf8b
BLAKE2b-256 checksum
How to use checksums
5ef4402737ed7b1637b0ebb3fd4305b59fd4dedfed61597d1f4f5c7f90ce2347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / hatch_nodejs_version-0.2.1-py3-none-any.whl

Download URL hatch_nodejs_version-0.2.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89852224b6d083bbfb40efcd55235763142042fd3ac1f03457b45b727c54865f
BLAKE2b-256 checksum
How to use checksums
b17e1bbb2eba33169797a8d7bb7d2ddeb151526369d8f9d61bf3ceb0e8d634b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page