From b540cd5e2cedbf76944b8f36c9bffa067d650385 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Fri, 10 Jun 2022 22:04:07 +0100 Subject: [PATCH] Docs: update install instructions --- README.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7758506..cab8ea4 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,40 @@ - [Installation](#installation) - [License](#license) -## Installation +## Global dependency -```console -pip install hatch-nodejs-version +Ensure `hatch-nodejs-version` is defined within the `build-system.requires` field in your `pyproject.toml` file. + +```toml +[build-system] +requires = ["hatchling", "hatch-nodejs-version"] +build-backend = "hatchling.build" ``` +## Version source + +The [version source plugin](https://hatch.pypa.io/latest/plugins/version-source/) name is `nodejs`. + +- ***pyproject.toml*** + + ```toml + [tool.hatch.version] + source = "nodejs" + ``` + +- ***hatch.toml*** + + ```toml + [version] + source = "nodejs" + ``` + +### Version source options + +| Option | Type | Default | Description | +|---------------| --- |---------------|--------------------------------------------| +| `path` | `str` | `package.json` | Relative path to the `package.json` file. | + ## License `hatch-nodejs-version` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.