Skip to content

Commit

Permalink
pip to uv CI migration (#321)
Browse files Browse the repository at this point in the history
* bump ruff + auto-fixes

* use uv to install deps in CI

* revert to editable install

* split 'dev' optional deps into dev + lint
  • Loading branch information
janosh authored Mar 9, 2024
1 parent 123d16d commit d7f79f4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
cache: pip
cache-dependency-path: pyproject.toml

- name: Install uv
run: pip install uv

- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -43,7 +46,7 @@ jobs:
run: conda install -c conda-forge openbabel

- name: Install dependencies
run: pip install '.[dev]'
run: uv pip install -e '.[dev]' --system

- name: pytest
env:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.3.2
hooks:
- id: ruff
args: [--fix, --ignore, D]
Expand Down
1 change: 0 additions & 1 deletion custodian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
framework written in Python.
"""


import os

from .custodian import Custodian
Expand Down
1 change: 0 additions & 1 deletion custodian/feff/handlers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""This module implements specific error handler for FEFF runs."""


import logging
import re

Expand Down
1 change: 0 additions & 1 deletion custodian/qchem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""This package implements various QChem Jobs and Error Handlers."""


__author__ = "Samuel Blau, Brandon Wood, Shyam Dwaraknath"
__credits__ = "Xiaohui Qu"
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ dependencies = ["monty>=2.0.6", "psutil", "ruamel.yaml>=0.15.6"]
vasp = ["pymatgen"]
nwchem = ["pymatgen"]
qchem = ["pymatgen"]
dev = ["mypy", "pre-commit", "pymatgen", "pytest", "pytest-cov", "ruff"]
dev = ["pymatgen", "pytest", "pytest-cov"]
lint = ["mypy", "pre-commit", "ruff"]
error-statistics = ["sentry-sdk>=0.8.0"]

[project.scripts]
Expand All @@ -63,7 +64,9 @@ exclude = ["*.tests", "*.tests.*"]
[tool.ruff]
target-version = "py39"
line-length = 120
lint.select = [

[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
Expand Down Expand Up @@ -94,14 +97,15 @@ lint.select = [
"W", # pycodestyle warning
"YTT", # flake8-2020
]
lint.ignore = [
ignore = [
"B023", # Function definition does not bind loop variable
"B028", # No explicit stacklevel keyword argument found
"B904", # Within an except clause, raise exceptions with ...
"C408", # unnecessary-collection-call
"D105", # Missing docstring in magic method
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"ISC001",
"PD011", # pandas-use-of-dot-values
"PD901", # pandas-df-variable-name
"PERF203", # try-except-in-loop
Expand All @@ -111,8 +115,8 @@ lint.ignore = [
"RUF012", # Disable checks for mutable class args. This is a non-problem.
"SIM105", # Use contextlib.suppress(OSError) instead of try-except-pass
]
lint.pydocstyle.convention = "google"
lint.isort.split-on-trailing-comma = false
pydocstyle.convention = "google"
isort.split-on-trailing-comma = false

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
Expand Down

0 comments on commit d7f79f4

Please sign in to comment.