diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..da0e2a8b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-json + + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + + - repo: https://github.com/pre-commit/mirrors-isort + rev: v5.10.1 + hooks: + - id: isort + name: isort (python) + args: ["--profile", "black"] + + - repo: https://github.com/PyCQA/flake8 + rev: 5.0.4 + hooks: + - id: flake8 + additional_dependencies: [flake8-docstrings] + args: ["--max-line-length=200", "--ignore=W605,E402"] diff --git a/pyproject.toml b/pyproject.toml index 0ca62b29..10bbe0d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ authors = [ ] description = "Neural Modules with Adaptive Nonlinear Constraints and Efficient Regularization" readme = "README.md" -requires-python = ">=3.9, <3.11" +requires-python = ">=3.9, <=3.11" keywords = [ "Deep Learning", "Pytorch", @@ -76,3 +76,4 @@ where = ["src"] tests = ["pytest", "hypothesis"] examples = ["casadi", "cvxpy", "imageio", "cvxpylayers"] docs = ["sphinx", "sphinx-rtd-theme"] +dev = ["pre-commit", "flake8", "black"]