diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbacef3..6c69166 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: ci on: push: + pull_request: jobs: test: name: Run tests and build distribution diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d84ead6..d809bd1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,37 +1,37 @@ exclude: "^docs/conf.py" repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: - - id: trailing-whitespace - - id: check-added-large-files - - id: check-ast - - id: check-json - - id: check-merge-conflict - - id: check-xml - - id: check-yaml - - id: debug-statements - - id: end-of-file-fixer - - id: requirements-txt-fixer - - id: mixed-line-ending - args: ["--fix=auto"] +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: check-ast + - id: check-json + - id: check-merge-conflict + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: requirements-txt-fixer + - id: mixed-line-ending + args: ['--fix=auto'] - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort +- repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort - - repo: https://github.com/psf/black - rev: 23.12.1 - hooks: - - id: black - language_version: python3 +- repo: https://github.com/psf/black + rev: 24.8.0 + hooks: + - id: black + language_version: python3 - - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 - hooks: - - id: flake8 +- repo: https://github.com/PyCQA/flake8 + rev: 7.1.1 + hooks: + - id: flake8 - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 @@ -39,14 +39,8 @@ repos: - id: pyupgrade args: ["--py37-plus"] - - repo: https://github.com/Lucas-C/pre-commit-hooks-markup - rev: v1.0.1 - hooks: - - id: rst-linter - files: README.rst - - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 - hooks: - - id: mypy - args: [--install-types, --non-interactive, --ignore-missing-imports] +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.11.1 + hooks: + - id: mypy + args: [--install-types, --non-interactive, --ignore-missing-imports] diff --git a/setup.cfg b/setup.cfg index eaa8236..0af1f60 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,7 @@ packages = find: setup_requires = setuptools_scm install_requires = - beancount>=2.3.5 + beancount>=2.3.5,<3.0.0 scikit-learn>=1.0 numpy>=1.18.0 diff --git a/smart_importer/__init__.py b/smart_importer/__init__.py index 1194690..fd40389 100644 --- a/smart_importer/__init__.py +++ b/smart_importer/__init__.py @@ -1,4 +1,5 @@ """Smart importer for Beancount and Fava.""" + from smart_importer.entries import update_postings from smart_importer.hooks import apply_hooks # noqa from smart_importer.predictor import EntryPredictor diff --git a/smart_importer/detector.py b/smart_importer/detector.py index 72d8286..42b578e 100644 --- a/smart_importer/detector.py +++ b/smart_importer/detector.py @@ -1,4 +1,5 @@ """Duplicate detector hook.""" + import logging from beancount.ingest import similar diff --git a/smart_importer/hooks.py b/smart_importer/hooks.py index f7815f7..b767824 100644 --- a/smart_importer/hooks.py +++ b/smart_importer/hooks.py @@ -1,4 +1,5 @@ """Importer decorators.""" + import logging from functools import wraps diff --git a/smart_importer/predictor.py b/smart_importer/predictor.py index 08b171f..4ec3b74 100644 --- a/smart_importer/predictor.py +++ b/smart_importer/predictor.py @@ -1,4 +1,5 @@ """Machine learning importer decorators.""" + # pylint: disable=unsubscriptable-object from __future__ import annotations diff --git a/tests/data_test.py b/tests/data_test.py index 3890be2..577ea71 100644 --- a/tests/data_test.py +++ b/tests/data_test.py @@ -1,4 +1,5 @@ """Tests for the `PredictPostings` decorator""" + # pylint: disable=missing-docstring import os import pprint diff --git a/tests/pipelines_test.py b/tests/pipelines_test.py index c216c10..0105fae 100644 --- a/tests/pipelines_test.py +++ b/tests/pipelines_test.py @@ -1,4 +1,5 @@ """Tests for the Machine Learning Helpers.""" + # pylint: disable=missing-docstring import numpy as np from beancount.parser import parser diff --git a/tests/predictors_test.py b/tests/predictors_test.py index c825017..14c82e3 100644 --- a/tests/predictors_test.py +++ b/tests/predictors_test.py @@ -1,4 +1,5 @@ """Tests for the `PredictPayees` and the `PredictPostings` decorator""" + # pylint: disable=missing-docstring from beancount.ingest.importer import ImporterProtocol from beancount.parser import parser