Skip to content

Commit

Permalink
Merge pull request #511 from avcopan/dev
Browse files Browse the repository at this point in the history
New: Formatting, linting, type-checking
  • Loading branch information
avcopan authored Jul 1, 2024
2 parents 36406d6 + 0e749e4 commit 43ed3b9
Show file tree
Hide file tree
Showing 23 changed files with 94 additions and 2,604 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: test

on: [push, pull_request]
on:
push:
pull_request:
workflow_dispatch:

jobs:
# Run tests
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false

name: test
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Download central config files
- name: Download environment files
run: |
wget https://raw.githubusercontent.com/avcopan/amech-dev/main/pixi.toml
wget https://raw.githubusercontent.com/avcopan/amech-dev/main/pixi.lock
wget https://raw.githubusercontent.com/Auto-Mech/amech-dev/main/pixi.toml
wget https://raw.githubusercontent.com/Auto-Mech/amech-dev/main/pixi.lock
- name: Set up Pixi
uses: prefix-dev/[email protected]
Expand All @@ -26,13 +28,17 @@ jobs:
run: |
pixi run pip install . --no-deps
- name: Run linter
- name: Lint (new)
run: |
pixi run ./lint.sh
- name: Lint (old)
run: |
pixi run pylint --rcfile=.pylintrc automol
pixi run pylint --rcfile=.pylintrc phydat
pixi run pylint --rcfile=.pylintrc autoreact
- name: Run pytests
- name: Test
run: |
pixi run pytest -v automol -v automol --ignore=automol/tests/test_convert.py
pixi run pytest -v autoreact
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
exclude: docs/

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.291
hooks:
- id: ruff
args: ["--fix"]
exclude: docs/

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
exclude: docs/
7 changes: 3 additions & 4 deletions automol/error.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
""" Library of automol errors.
"""
"""Library of automol errors."""


class FailedGeometryGenerationError(RuntimeError):
""" exception for when we fail to generate a correct geometry """
"""exception for when we fail to generate a correct geometry."""


class FailedInchiGenerationError(RuntimeError):
""" exception for when we fail to generate a correct inchi """
"""exception for when we fail to generate a correct inchi."""
5 changes: 2 additions & 3 deletions automol/inchi_key.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
""" ChIKeys
"""
"""ChIKeys."""

import pyparsing as pp

Expand All @@ -20,7 +19,7 @@


def to_dict(chk: str) -> dict:
"""Split the ChI key into a dictionary of parsed elements
"""Split the ChI key into a dictionary of parsed elements.
:param chk: The ChI key
:type chk: str
Expand Down
291 changes: 0 additions & 291 deletions docs/_static/css/automech.css

This file was deleted.

Loading

0 comments on commit 43ed3b9

Please sign in to comment.