Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hatch-nodejs-version

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hatch-nodejs-version

Hatch plugin for versioning from a package.json file

  • 0.3.2
  • PyPI
  • Socket score

Maintainers
3

hatch-nodejs-version

PyPI - Version PyPI - Python Version Hatch project


This package provides two Hatch plugins:

  • version source plugin that reads/writes the package version from the version field of the Node.js package.json file.
  • metadata hook plugin that reads PEP 621 metadata from the Node.js 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 contentful 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.

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

OptionTypeDefaultDescription
pathstrpackage.jsonRelative 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

OptionTypeDefaultDescription
pathstr"package.json"Relative path to the package.json file.
fieldslist of strNoneOptional list of pyproject.toml fields to take from their counterparts in package.json. If missing, take all of the available fields.
contributors-as-maintainersboolTrueWhether contributors in package.json should be considered maintainers (otherwise, treat them as authors).
bugs-labelstr"Bug Tracker"The key in the URLs table of pyproject.toml that is populated by the bugs field in package.json
homepage-labelstr"Homepage"The key in the URLs table of pyproject.toml that is populated by the homepage field in package.json
repository-labelstr"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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc