Update requirements and pre-commit hooks (#255)

* Update package versions in requirements.txt
* Update pre-commit hooks versions in pre-commit-config.yaml
* Specify testpath in setup.cfg
* Update readme
This commit is contained in:
ashleve authored and GitHub committed 2022-02-19 21:00:56 +01:00
1 parent ddbd1e3c78
commit d25db15ad5
4 files changed
+23 -18

No files matched your search

+5 -5
View File
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.1.0
hooks:
# list of supported hooks: https://pre-commit.com/hooks.html
- id: trailing-whitespace
@@ -12,28 +12,28 @@ repos:
# python code formatting
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.1.0
hooks:
- id: black
args: [--line-length, "99"]
# python import sorting
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.0
rev: v2.5.1
hooks:
- id: prettier
types: [yaml]
# python code analysis
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 4.0.1
hooks:
- id: flake8
+12 -1
View File
@@ -391,6 +391,17 @@ python train.py -m 'experiment=glob(*)'
</details>
<details>
<summary><b>Apply pre-commit hooks</b></summary>
> Apply pre-commit hooks to automatically format your code and configs, perform code analysis and remove output from jupyter notebooks. See [# Best Practices](#best-practices) for more.
```bash
pre-commit run -a
```
</details>
<br>
## ❤️&nbsp;&nbsp;Contributions
@@ -1081,7 +1092,7 @@ pre-commit install
```
After that your code will be automatically reformatted on every new commit.<br>
Currently template contains configurations of **black** (python code formatting), **isort** (python import sorting), **flake8** (python code analysis) and **prettier** (yaml formating). <br>
Currently template contains configurations of **black** (python code formatting), **isort** (python import sorting), **flake8** (python code analysis), **prettier** (yaml formating) and **nbstripout** (clearing output from jupyter notebooks). <br>
To reformat all files in the project use command:
+5 -10
View File
@@ -1,36 +1,31 @@
# --------- pytorch --------- #
torch>=1.10.0
torchvision>=0.11.0
pytorch-lightning>=1.5.0
torchmetrics>=0.6.0
pytorch-lightning>=1.5.10
torchmetrics>=0.7.0
# --------- hydra --------- #
hydra-core>=1.1.0
hydra-colorlog>=1.1.0
hydra-optuna-sweeper>=1.1.0
# hydra-ax-sweeper
# hydra-ray-launcher
# hydra-submitit-launcher
# --------- loggers --------- #
wandb
# wandb
# neptune-client
# mlflow
# comet-ml
# torch_tb_profiler
# tensorboard
# --------- linters --------- #
pre-commit # hooks for applying linters on commit
black # code formatting
isort # import sorting
flake8 # code analysis
nbstripout # remove output from jupyter notebooks
# --------- others --------- #
python-dotenv # loading env variables from .env file
rich # beautiful text formatting in terminal
pytest # tests
sh # for running bash commands in some tests
scikit-learn # used in some callbacks
seaborn # used in some callbacks
jupyterlab # better jupyter notebooks
pudb # debugger
+1 -2
View File
@@ -12,7 +12,6 @@ ignore =
F401 # Module imported but unused
W504 # Line break occurred after a binary operator
F841 # Local variable name is assigned to but never used
F403 # from module import *
E501 # Line too long
exclude =
.git
@@ -24,7 +23,7 @@ exclude =
[tool:pytest]
python_files = tests/*
testpaths = tests/
log_cli = True
markers =
slow