Plugin for setuptools to run npm commands.
Usage
This command provides npm_install and npm_run commands.
Run python setup.py npm_install –help or python setup.py npm_run –help for available options.
npm_not_skipped is a helper function that can be used as predicate for distutils subcommand. It evaluates to True if env variable SKIP_NPM is not defined. This variable is exclusive to this helper function and is not evaluated in npm_install and npm_run commands themselves.
Example
Let’s say you have defined build command in package.json and you’d like to run npm clean-install and npm run build each time you run setup.py build. You’d configure your project like this:
# pyproject.toml
[build-system]
requires = ["setuptools", "setuptools-npm"]
build-backend = "setuptools.build_meta"
# setup.py
from distutils.command.build import build
from setuptools import setup
from setuptools_npm import npm_not_skipped
class custom_build(build):
sub_commands = [
('npm_install', npm_not_skipped),
('npm_run', npm_not_skipped),
] + build.sub_commands
setup(cmdclass={'build': custom_build, 'sdist': custom_sdist})
# setup.cfg
[npm_run]
script = build
Metadata
Release files for setuptools-npm 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| setuptools-npm-0.3.tar.gz | 15.5 kB | Without provenance | Details for setuptools-npm-0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| setuptools_npm-0.3-py3-none-any.whl | Python 3 | none | any | Details for setuptools_npm-0.3-py3-none-any.whl |
Total release size: 31.3 kB
Release files / setuptools-npm-0.3.tar.gz
| Download URL | setuptools-npm-0.3.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46c77ea1ebcecf2eca2f0c1dd27b066cc5cc18a230aa250b54ce4a1d2d005c70
|
|
BLAKE2b-256 checksum How to use checksums |
59f7085661b8f234a889a18034ff15b16662406d03d6f51399d50d2924df6110
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|
Release files / setuptools_npm-0.3-py3-none-any.whl
| Download URL | setuptools_npm-0.3-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75bbc46ce8a2c7d2594394ec1e80d39d5dc0d10e260d3d3f3ab2dac1d5772f49
|
|
BLAKE2b-256 checksum How to use checksums |
f90c4b6f2aad09e6f4cad49143195c8c5e4af1dac62e6670038ff3ac6afb8613
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|
Security for setuptools-npm 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.