Skip to content

Commit 7a089f0

Browse files
committed
Add first draft of CONTRIBUTING.md
1 parent a96b11c commit 7a089f0

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing
2+
3+
## What this library is
4+
5+
- A headless Spotify client, allowing you to **authenticate and retrieve a decrypted audio stream for any track**.
6+
- *Not* a standalone audio player: the **provided stream must be piped to another application** (like `ffplay`) or handled by a server to be played.
7+
8+
## Environment setup
9+
10+
### Prerequisites
11+
- Python 3.10+
12+
13+
### Install runtime packages
14+
15+
```sh
16+
pip install -r requirements.txt
17+
```
18+
19+
### Install protoc
20+
21+
> This step is **only needed if you're changing any `.proto` serialization schema files**,
22+
> which will subsequently require using the protoc compiler to generate updated versions of
23+
> the `*_pb2.py` Python stubs that implement serialization/deserialization for those schemas.
24+
25+
- Go to the [protobuf release matching the version pinned in `requirements.txt`](https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.1).
26+
- Download and install the `protoc-*.zip` file meant for your platform.
27+
28+
After modifying the `.proto` files you need to, **make sure to follow [these steps](#protocol-buffer-generation) to regenerate the Python stubs**.
29+
30+
## Protocol buffer generation
31+
32+
> These steps are only necessary after changing `.proto` files.
33+
34+
- From the repository root, conveniently recompile all `.proto` schema files with this command:
35+
36+
```bash
37+
find proto -name "*.proto" | xargs protoc -I=proto --python_out=librespot/proto
38+
```
39+
40+
- Alternatively, to recompile a single file (e.g. `proto/metadata.proto`), run:
41+
42+
```bash
43+
protoc -I=proto --python_out=librespot/proto proto/metadata.proto
44+
```
45+
46+
- Commit both the source `.proto` and the regenerated Python output **together** so they can
47+
be compared easily.

0 commit comments

Comments
 (0)