Skip to content

Commit 60aee3f

Browse files
committed
docs: add poetry installation info to contributing
1 parent 848d211 commit 60aee3f

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

CONTRIBUTING.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,68 @@
11
# Contributing
22
Contributions are welcome! Make sure to first open an issue discussing the problem or the new feature before creating a pull request. This project uses [poetry](https://python-poetry.org/).
33

4+
## Installation
5+
Python and poetry are used for the dependency and build management.
6+
7+
### Install Poetry
8+
[Poetry](https://python-poetry.org/) can be installed with `pip` on most systems, but the direct installer on windows systems may work better.
9+
10+
#### Linux/MacOS
11+
```bash
12+
$ pip install poetry
13+
```
14+
15+
#### Windows
16+
```bash
17+
$ (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
18+
```
19+
or
20+
```bash
21+
$ (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
22+
```
23+
24+
### Install Dependencies
25+
Once poetry is installed, the dependencies can be installed with the following command
26+
```bash
27+
$ poetry install --with dev
28+
```
29+
30+
### Open Shell
31+
The virtualenv can be accessed using the following command to avoid prepending `poetry run` to every command
32+
```bash
33+
$ poetry shell
34+
```
35+
36+
437
## Code Style
538
The code follows the [black](https://github.com/psf/black) code style. Import statements are sorted with [isort](https://pycqa.github.io/isort/). The project must type-check with [pyright](https://github.com/microsoft/pyright). It is recommend to run the type-checker via the VSCode Python extension (discussed below).
639

7-
**Format**
40+
**Reformat**
841
```bash
942
# omit `poetry run` if u have the virtualenv activated
1043
$ poetry run isort beet_observer
1144
$ poetry run black beet_observer
1245
```
1346

14-
**Check**
47+
**Check Formatting**
1548
```bash
1649
# omit `poetry run` if u have the virtualenv activated
1750
$ poetry run black --check beet_observer
1851
$ poetry run isort --check-only beet_observer
1952
```
2053

54+
**Type check**
55+
```bash
56+
# omit `poetry run` if u have the virtualenv activated
57+
$ poetry run pyright
58+
```
59+
2160
You can run `poetry self add 'poethepoet[poetry_plugin]'` to get access to an easier set of commands:
2261
```bash
2362
# omit `poetry` if u have the virtualenv activated
2463
$ poetry poe format
2564
$ poetry poe check
65+
$ poetry poe typing
2666
```
2767

2868
## IDE

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ typeCheckingMode = "strict"
3838
[tool.poe.tasks]
3939
format = {shell = "isort beet_observer & black beet_observer"}
4040
check = {shell = "isort --check-only beet_observer & black --check beet_observer"}
41+
typing = {shell = "pyright"}
4142

4243
[build-system]
4344
requires = ["poetry-core"]

0 commit comments

Comments
 (0)