Skip to content

Commit

Permalink
add pre-commit setup
Browse files Browse the repository at this point in the history
  • Loading branch information
neggles committed Jun 12, 2023
1 parent ddca0f9 commit c64fc2b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.272"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=61.0.0",
"wheel",
]
requires = ["setuptools>=61.0.0", "wheel", "setuptools_scm[toml]>=6.2"]

[tool.setuptools_scm]
write_to = "muse_maskgit_pytorch/_version.py"
Expand All @@ -15,7 +12,13 @@ target-version = ['py38', 'py39', 'py310']
[tool.ruff]
line-length = 110
target-version = 'py38'
format = "grouped"
ignore-init-module-imports = true
select = ["E", "F", "I"]
ignore = ['F841', 'F401', 'E501']

[tool.ruff.isort]
combine-as-imports = true
force-wrap-aliases = true
known-local-folder = ["muse_maskgit_pytorch"]
known-first-party = ["muse_maskgit_pytorch"]
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup, find_packages
from setuptools import find_packages, setup

setup(
name="muse-maskgit-pytorch",
Expand All @@ -17,6 +17,13 @@
"attention mechanism",
"text-to-image",
],
extras_require={
"dev": [
"pre-commit>=3.3.2",
"black>=23.3.0",
"ruff>=0.0.272",
]
},
install_requires=[
"accelerate",
"diffusers",
Expand Down

0 comments on commit c64fc2b

Please sign in to comment.