Skip to content

Commit 2127c07

Browse files
authored
Added contribution guides. (#167)
1 parent 95a90fe commit 2127c07

2 files changed

Lines changed: 81 additions & 1 deletion

File tree

docs/contrib.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
order: 5
3+
---
4+
5+
# Contribution guide
6+
7+
We love contributions. This guide is for all folks who want to make taskiq
8+
better together.
9+
10+
We have several rules for contributors:
11+
* Please do not add malware.
12+
* Please make sure that your request solves problem.
13+
14+
If you struggle with something or feel frustrating, you either create an issue, create a discussion on page or publish draft PR and ask your question in description.
15+
16+
We have lots of tests in CI. But since runs from first-time contributors should be approved you better test locally, it just takes less time.
17+
18+
We love contributions. This guide is for all folks who want to make taskiq better together.
19+
We have several rules for contributors:
20+
* Please do not add malware.
21+
* Please make sure that your request solves the problem.
22+
23+
If you struggle with something or feel frustrated, you either create an issue, create a [discussions](https://github.com/orgs/taskiq-python/discussions).
24+
page or publish a draft PR and ask your question in the description.
25+
26+
We have lots of tests in CI. But since CI runs from first-time contributors should be approved, you better test locally. It just takes less time to prepare PR for merging.
27+
28+
## Setting up environment
29+
30+
We use poetry for managing dependencies. To install it, please follow the official guide in [documentation](https://python-poetry.org/docs/).
31+
32+
After you have cloned the taskiq repo, install dependencies using this command:
33+
34+
```bash
35+
poetry install
36+
```
37+
38+
It will install all required dependencies.
39+
If you want to run pytest against different python environments, please install `pyenv` using instructions from its [readme](https://github.com/pyenv/pyenv).
40+
41+
After pyenv is ready, you can install all python versions using this command:
42+
43+
```bash
44+
pyenv install
45+
```
46+
47+
## Linting
48+
49+
We have `pre-commit` configured with all our settings. We highly recommend you to install it as a git hook using `pre-commit install` command.
50+
51+
But even without installation, you can run all lints manually:
52+
53+
```bash
54+
pre-commit run -a
55+
```
56+
57+
58+
## Testing
59+
60+
You can run `pytest` without any parameters and it will do the thing.
61+
62+
```bash
63+
pytest
64+
```
65+
66+
If you want to speedup testings, you can run it with `-n` option from [pytest-xdist](https://pypi.org/project/pytest-xdist/) to run tests in parallel.
67+
68+
```bash
69+
pytest -n 2
70+
```
71+
72+
Also we use `tox` to test against different environments. You can publish a PR to run pytest with different
73+
python versions, but if you want to do it locally, just run `tox` command.
74+
75+
76+
```bash
77+
tox
78+
```
79+
80+
Tox assumes that you've installed python versions using pyenv with command above.

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ allowlist_externals = poetry
1212
commands_pre =
1313
poetry install
1414
commands =
15-
poetry run pytest -vv tests/
15+
poetry run pytest -vv

0 commit comments

Comments
 (0)