Skip to content

Commit

Permalink
modernise
Browse files Browse the repository at this point in the history
  • Loading branch information
yagebu committed Jan 20, 2025
1 parent 6165f77 commit a446a18
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 43 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.9", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: pip install tox wheel setuptools
run: pip install tox wheel setuptools pre-commit
- name: Run lint
run: tox -e lint
run: pre-commit run -a
- name: Run tests
run: tox -e py
23 changes: 6 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
repos:
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.8.3
hooks:
- id: reorder-python-imports
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
hooks:
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
test:
tox -e py

lint:
pre-commit run -a

upload:
python setup.py sdist bdist_wheel
twine upload dist/*

test:
tox
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fava-plugins

a collection of Beancount plugins. Install with `pip3 install fava-plugins`.
a collection of Beancount plugins. Install with `pip install fava-plugins`.

- [`split_income`](https://github.com/beancount/fava-plugins/blob/main/fava_plugins/split_income.py): Split income transactions into pre-tax and post-tax postings.
- [`todo_as_error`](https://github.com/beancount/fava-plugins/blob/main/fava_plugins/todo_as_error.py): Display 'todo'-metadata-entries as errors.
1 change: 1 addition & 0 deletions fava_plugins/split_income.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
Income:Net 800.00 EUR
Income:Net:Bonus 100.00 EUR
"""

import ast
import collections
import copy
Expand Down
1 change: 1 addition & 0 deletions fava_plugins/todo_as_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Expenses:Groceries 150.00 USD
Assets:Cash
"""

import collections

from beancount.core.data import Transaction
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ build-backend = "setuptools.build_meta"
[tool.black]
line-length = 79

[tool.ruff]
target-version = "py39"
line-length = 79

[tool.pylint.'MESSAGES CONTROL']
disable = [
"too-few-public-methods",
Expand Down
10 changes: 4 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ classifiers =
Intended Audience :: Information Technology
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: JavaScript
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3 :: Only
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Topic :: Office/Business :: Financial :: Accounting
Topic :: Office/Business :: Financial :: Investment

[options]
packages = find:
zip_safe = False
install_requires = beancount>=2.0
include_package_data = True

Expand Down
12 changes: 1 addition & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
[tox]
envlist = lint,py
envlist = py
isolated_build = True

[testenv]
deps =
pytest
commands = pytest tests

[testenv:lint]
deps =
flake8
pylint
pytest
commands =
flake8 fava_plugins tests
pylint fava_plugins
pylint tests -d missing-docstring -d not-callable

0 comments on commit a446a18

Please sign in to comment.