-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild-from-Source.md.jinja
More file actions
103 lines (70 loc) · 2.6 KB
/
Build-from-Source.md.jinja
File metadata and controls
103 lines (70 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
`{{ project_name_formatted }}` is written in Python. While prebuilt wheels are provided for end users, it is also straightforward to build `{{ project_name_formatted }}` from either the Python [source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/) or the GitHub repository.
- [Make commands](#make-commands)
- [Prerequisites](#prerequisites)
- [Clone](#clone)
- [Install Python dependencies](#install-python-dependencies)
- [Build](#build)
- [Lint and Autoformat](#lint-and-autoformat)
- [Testing](#testing)
## Make commands
As a convenience, `{{ project_name_formatted }}` uses a `Makefile` for commonly used commands. You can print the main available commands by running `make` with no arguments
```bash
> make
build build the library
clean clean the repository
fix run autofixers
install install library
lint run lints
test run the tests
```
## Prerequisites
`{{ project_name_formatted }}` has a few system-level dependencies which you can install from your machine package manager. Other package managers like `conda`, `nix`, etc, should also work fine.
## Clone
Clone the repo with:
```bash
git clone https://github.com/{{ github }}/{{ project_name_formatted }}.git
cd {{ project_name_formatted }}
```
## Install Python dependencies
Python build and develop dependencies are specified in the `pyproject.toml`, but you can manually install them:
```bash
make requirements
```
Note that these dependencies would otherwise be installed normally as part of [PEP517](https://peps.python.org/pep-0517/) / [PEP518](https://peps.python.org/pep-0518/).
## Build
Build the python project in the usual manner:
```bash
make build
```
## Lint and Autoformat
`{{ project_name_formatted }}` has linting and auto formatting.
| Language | Linter | Autoformatter | Description |
| :------- | :---------- | :------------ | :---------- |
| Python | `ruff` | `ruff` | Style |
| Markdown | `mdformat` | `mdformat` | Style |
| Markdown | `codespell` | | Spelling |
**Python Linting**
```bash
make lint-py
```
**Python Autoformatting**
```bash
make fix-py
```
**Documentation Linting**
```bash
make lint-docs
```
**Documentation Autoformatting**
```bash
make fix-docs
```
## Testing
`{{ project_name_formatted }}` has extensive Python tests. The tests can be run via `pytest`. First, install the Python development dependencies with
```bash
make develop
```
**Python**
```bash
make test
```