diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6eb83c10..9ca37920 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,13 +22,14 @@ jobs: python-version: "3.11" - name: Install dependencies run: | - python -m pip install --upgrade pip uv - python -m uv pip install ruff==0.5.2 + python -m pip install --upgrade pip + python -m pip install uv + python -m uv pip install ruff==0.6.3 # Update output format to enable automatic inline annotations. - name: Run Ruff Linter run: ruff check --output-format=github - - name: Run Ruff Formatter - run: ruff format --check + # - name: Run Ruff Formatter + # run: ruff format --check test: runs-on: ubuntu-latest @@ -38,10 +39,11 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.11 - name: Install dependencies run: | - python -m pip install --upgrade pip uv + python -m pip install --upgrade pip + python -m pip install uv python -m uv pip install torch==2.3.1+cpu torchvision==0.18.1+cpu -f https://download.pytorch.org/whl/torch_stable.html make install_dev - name: Test with pytest diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000..1d0d38db --- /dev/null +++ b/ruff.toml @@ -0,0 +1,72 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 120 +indent-width = 4 + +# Assume Python 3.11 +target-version = "py311" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +select = [ + # "E", # pycodestyle + # "F", # pyglake + # "I", # Isort + "PERF", # Perlint + # "PL", # Pylint + # "RUF", # Ruff + # "S", # Bandit + # "SIM", # Simplify + # "UP", # Upgrade + # "W", # Warning +] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" diff --git a/setup.py b/setup.py index 301b9b83..0ce3eaa1 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ REQUIRED = [] # What packages are optional? -EXTRAS = {"test": ["pytest", "mock", "ruff==0.5.2"]} +EXTRAS = {"test": ["pytest", "mock", "ruff==0.6.3"]} # Import the README and use it as the long-description. # Note: this will only work if 'README.md' is present in your MANIFEST.in file!