Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
26 changes: 21 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
upload:
python setup.py sdist bdist_wheel
twine upload dist/*

# Run tests
.PHONY: test
test:
tox
tox -e py

# Run linters
.PHONY: lint
lint:
pre-commit run -a

# Build the distribution (sdist and wheel).
.PHONY: dist
dist:
rm -f dist/*.tar.gz
rm -f dist/*.whl
python -m build
twine check dist/*

# Upload the distribution
.PHONY: upload
upload: dist
twine upload dist/*
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
47 changes: 39 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
[project]
name = "fava-plugins"
version = "1.0"
description = "A collection of Beancount plugins."
readme = "README.md"
requires-python = ">=3.9"
license = {text = "MIT License"}
authors = [
{name = "Jakob Schnitzer", email = "mail@jakobschnitzer.de"}
]
keywords = ["fava", "beancount", "accounting",]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"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",
]
dependencies = [
"beancount>=2,<4",
]

[project.urls]
Homepage = "https://github.com/beancount/fava-plugins"
Source = "https://github.com/beancount/fava-plugins"
Issues = "https://github.com/beancount/fava-plugins/issues"

[build-system]
requires = ["setuptools>=45", "wheel"]
build-backend = "setuptools.build_meta"

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

[tool.pylint.'MESSAGES CONTROL']
disable = [
"too-few-public-methods",
"not-callable", # false positive for Beancount Entries
"isinstance-second-argument-not-valid-type"
]
36 changes: 0 additions & 36 deletions setup.cfg

This file was deleted.

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
Loading