Skip to main content

Hatch plugin for versioning from a package.json file

Project description

hatch-nodejs-version

PyPI - Version PyPI - Python Version Hatch project


This package provides two Hatch plugins:

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 Node.js 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
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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hatch_nodejs_version-0.3.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

hatch_nodejs_version-0.3.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file hatch_nodejs_version-0.3.0.tar.gz.

File metadata

  • Download URL: hatch_nodejs_version-0.3.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for hatch_nodejs_version-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7e08bd67fcd3dbfb97caf8f629a2173e4b117475ee51966f05a2169aaad06097
MD5 644c2aea7558de91bbd66217fec6a1b9
BLAKE2b-256 452e760f3d5caa5394d5023ffa36271e97841fd5fa63a2c9557b53856fc045aa

See more details on using hashes here.

Provenance

File details

Details for the file hatch_nodejs_version-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hatch_nodejs_version-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fe8a1570caf6047060c1575fe3b1e1dec9c95fd891579c8360433ebeede672a
MD5 d42bd1e7c463e53075430c44d1241cd7
BLAKE2b-256 38446b9a31c34821c8a495c0dd6650caf9425083502671f564e0f7b1a1c4733e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page