diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0cb7374..9173e1e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/README.md b/README.md index c9fab04..50fc869 100644 --- a/README.md +++ b/README.md @@ -391,6 +391,17 @@ python train.py -m 'experiment=glob(*)' +
+Apply pre-commit hooks + +> 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 +``` + +
+
## ❤️  Contributions @@ -1081,7 +1092,7 @@ pre-commit install ``` After that your code will be automatically reformatted on every new commit.
-Currently template contains configurations of **black** (python code formatting), **isort** (python import sorting), **flake8** (python code analysis) and **prettier** (yaml formating).
+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).
To reformat all files in the project use command: diff --git a/requirements.txt b/requirements.txt index 0b3f725..6d4f290 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.cfg b/setup.cfg index 31b1a54..a205e67 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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