Skip to content

Commit

Permalink
ruff setup and pre-commit (pytorch#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyprince authored Nov 21, 2024
1 parent 3ee42b6 commit 9accded
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 35 deletions.
23 changes: 5 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,9 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
# - repo: https://github.com/PyCQA/isort
# rev: 5.13.2
# hooks:
# - id: isort
# args: [--profile, black]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: flake8
args: ['--ignore=E501,E203,E731,W503']
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.10.0
# hooks:
# - id: mypy
# additional_dependencies: [types-dataclasses, numpy]
- id: ruff
args: [ --fix ]
- id: ruff-format
18 changes: 2 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ dev-dependencies = [
[tool.setuptools]
packages = ["low_bits_training", "low_bits_training.datasets", "low_bits_training.models"]

[tool.black]
[tool.ruff]
line-length = 90
target-version = ['py310']

[tool.isort]
line_length = 90
py_version = 310

[tool.mypy]
python_version = "3.10"
show_error_codes = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
check_untyped_defs = true
disallow_any_generics = true
no_implicit_optional = false
target-version = 'py310'
1 change: 0 additions & 1 deletion scripts/download_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def sync_between_nodes(source_path, source_host, dest_path, dest_host):


def main(args):

run = wandb.init(
entity=args.entity,
project=args.project,
Expand Down
1 change: 1 addition & 0 deletions scripts/titan_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
python sweep.py --config '{"command":"./train.sh", ...}' # JSON string
"""

import json
import argparse
from itertools import product
Expand Down

0 comments on commit 9accded

Please sign in to comment.