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