Skip to content

Commit c5dec4f

Browse files
committed
Development instructions + link from README + additional make targets
A few miscellaneous changes that are largely documentation related: * Add `docs/development.md` containing basic instructions on how to install dependencies, run tests, run lint, run code formatting, etc. This matches convention in other River projects and makes it easier for people to bootstrap themselves when they're not deeply familiar with Python's conventions already. * Link `docs/development.md` from top-level README. This pull originally proposed also moving the README to `docs/` for consistency with other River projects, but apparently Rye does not allow this. * Add some additional make targets for other development tasks beyond the type check. Again, not strictly necessary, but sort of nice because it means you don't have to remember which targets need to use make versus which need to use Rye -- you can just `make` anything and it'll work. Also, make all targets Phony [1]. [1] https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
1 parent 144ade0 commit c5dec4f

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
.PHONY: fmt
2+
fmt:
3+
rye fmt
4+
5+
.PHONY: lint
6+
lint:
7+
rye lint
8+
9+
.PHONY: test
10+
test:
11+
rye test
12+
13+
.PHONY: typecheck
114
typecheck:
215
rye run mypy -p src.riverqueue

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# River client for Python
22

3-
An insert-only Python client for [River](https://github.com/riverqueue).
3+
An insert-only Python client for [River](https://github.com/riverqueue/river) packaged in the [`riverqueue` gem](https://rubygems.org/gems/riverqueue). Allows jobs to be inserted in Python and run by a Go worker, but doesn't support working jobs in Python.
4+
5+
## Development
6+
7+
See [development](./docs/development.md).

docs/development.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# riverqueue-python development
2+
3+
## Install dependencies
4+
5+
The project uses [Rye](https://github.com/astral-sh/rye) for its development toolchain and to run development targets. Install it with:
6+
7+
```shell
8+
$ curl -sSf https://rye.astral.sh/get | bash
9+
```
10+
11+
Or via Homebrew:
12+
13+
```shell
14+
$ brew install rye
15+
```
16+
17+
Then use it to set up a virtual environment:
18+
19+
```shell
20+
$ rye sync
21+
```
22+
23+
## Run tests
24+
25+
```shell
26+
$ rye test
27+
```
28+
29+
## Run lint
30+
31+
```shell
32+
$ rye lint
33+
```
34+
35+
## Run type check (Mypy)
36+
37+
```shell
38+
$ make typecheck
39+
```
40+
41+
## Format code
42+
43+
```shell
44+
$ rye fmt
45+
```
46+
47+
Rye uses [Ruff](https://github.com/astral-sh/ruff) under the hood for code formatting.

0 commit comments

Comments
 (0)