- Notifications
You must be signed in to change notification settings - Fork1
Build from Source
python-template-js is written in Python and JavaScript. While prebuilt wheels are provided for end users, it is also straightforward to buildpython-template-js from either the Pythonsource distribution or the GitHub repository.
As a convenience,python-template-js uses aMakefile for commonly used commands. You can print the main available commands by runningmake with no arguments
> makebuild build the libraryclean clean the repositoryfix run autofixersinstall install librarylint run lintstest run the tests
python-template-js has a few system-level dependencies which you can install from your machine package manager. Other package managers likeconda,nix, etc, should also work fine.
Clone the repo with:
git clone https://github.com/python-project-templates/python-template-js.gitcd python-template-jsFollow the instructions forinstalling NodeJS for your system. Once installed, you caninstallpnpm with:
npm install --global pnpm
Python build and develop dependencies are specified in thepyproject.toml, but you can manually install them:
make requirements
Note that these dependencies would otherwise be installed normally as part ofPEP517 /PEP518.
Build the python project in the usual manner:
make build
python-template-js has linting and auto formatting.
| Language | Linter | Autoformatter | Description |
|---|---|---|---|
| Python | ruff | ruff | Style |
| Python | ruff | ruff | Imports |
| JavaScript | prettier | prettier | Style |
| Markdown | mdformat | mdformat | Style |
| Markdown | codespell | Spelling |
Python Linting
make lint-py
Python Autoformatting
make fix-py
JavaScript Linting
make lint-js
JavaScript Autoformatting
make fix-js
Documentation Linting
make lint-docs
Documentation Autoformatting
make fix-docs
python-template-js has both Python and JavaScript tests. The bulk of the functionality is tested in Python, which can be run viapytest. First, install the Python development dependencies with
make develop
Python
make test-py
JavaScript
make test-js
This wiki is autogenerated. To made updates, open a PR against the original source file indocs/wiki.