You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure to install `dev-requirements.txt`instead of`requirements.txt`. \
337
-
`dev-requirements.txt` will install all dependencies in `requirements.txt` plus any development dependencies. \
338
-
This will also install the versions in use of [`pylint`](https://github.com/pylint-dev/pylint) and [`mypy`](https://github.com/python/mypy), which you should both use before opening your PRs.
338
+
Make sure to install `dev-requirements.txt`(and not`requirements.txt`!). \
339
+
`dev-requirements.txt` will install all dependencies in `requirements.txt` plus any development dependency. \
340
+
dev-requirements includes [mypy](https://github.com/python/mypy), [black](https://github.com/psf/black), [isort](https://github.com/PyCQA/isort), [flake8](https://github.com/PyCQA/flake8), and [pre-commit](https://github.com/pre-commit/pre-commit) (more on these tools in later chapters).
339
341
340
342
All done, your Python 3.8+ environment should now be able to run `bitfinex-api-py`'s source code.
341
343
344
+
### Set up the pre-commit hooks (optional)
345
+
346
+
**Do not skip this paragraph if you intend to contribute to the project.**
347
+
348
+
This repository includes a pre-commit configuration file that defines the following hooks:
349
+
1.[isort](https://github.com/PyCQA/isort)
350
+
2.[black](https://github.com/psf/black)
351
+
3.[flake8](https://github.com/PyCQA/flake8)
352
+
353
+
To set up pre-commit use:
354
+
```console
355
+
python3 -m pre-commit install
356
+
```
357
+
358
+
These will ensure that isort, black and flake8 are run on each git commit.
359
+
360
+
[Visit this page to learn more about git hooks and pre-commit.](https://pre-commit.com/#introduction)
361
+
362
+
#### Manually triggering the pre-commit hooks
363
+
364
+
You can also manually trigger the execution of all hooks with:
365
+
```console
366
+
python3 -m pre-commit run --all-files
367
+
```
368
+
342
369
## Before opening a PR
343
370
344
-
**We won't accept your PR or we will request changes if the following requirements aren't met.**
371
+
**We won't accept your PR or we'll request changes if the following requirements aren't met.**
345
372
346
373
Wheter you're submitting a bug fix, a new feature or a documentation change, you should first discuss it in an issue.
347
374
348
-
All PRs must follow this [PULL_REQUEST_TEMPLATE](https://github.com/bitfinexcom/bitfinex-api-py/blob/v3-beta/.github/PULL_REQUEST_TEMPLATE.md) and include an exhaustive description.
375
+
You must be able to check off all tasks listed in [PULL_REQUEST_TEMPLATE](https://raw.githubusercontent.com/bitfinexcom/bitfinex-api-py/master/.github/PULL_REQUEST_TEMPLATE.md) before opening a pull request.
376
+
377
+
### Tip
349
378
350
-
Before opening a pull request, you should also make sure that:
351
-
-[ ][`pylint`](https://github.com/pylint-dev/pylint) returns a score of 10.00/10.00 when run against your code.
352
-
-[ ][`mypy`](https://github.com/python/mypy) doesn't throw any error code when run on the project (excluding notes).
379
+
Setting up the project's pre-commit hooks will help automate this process ([more](#set-up-the-pre-commit-hooks-optional)).
0 commit comments