Skip to content

Commit 178075b

Browse files
committed
0.3.0
1 parent 8baef31 commit 178075b

15 files changed

+114
-197
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
![python version required](https://img.shields.io/pypi/pyversions/beancount-multitool)
66
![static coverage badge](https://img.shields.io/badge/Coverage-97%25-blue)
77

8-
Beancount Multitool is a command-line-interface (CLI) tool that converts financial data from financial institutions to Beancount files.
8+
[Beancount Multitool](https://github.com/rlan/beancount-multitool/) is a command-line-interface (CLI) tool that converts financial data from financial institutions to Beancount files.
99

1010
The following institutions are supported:
1111

changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
0.3.0
4+
5+
* Fix a hard-coded year bug in JABank.py.
6+
* Add ruff. Run formatter and linter.
7+
38
0.2.1
49

510
* Update README for PyPi project page.

development.md

+47-8
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,78 @@ Instructions for developers.
77
Install
88

99
* [Homebrew](https://brew.sh/)
10-
* [pyenv](https://github.com/pyenv/pyenv) (optional)
10+
11+
* [pyenv](https://github.com/pyenv/pyenv) and [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)
12+
13+
```sh
14+
brew install pyenv pyenv-virtualenv
15+
```
16+
17+
* [pipx](https://github.com/pypa/pipx)
18+
19+
```sh
20+
brew install pipx
21+
```
22+
1123
* [Poetry](https://github.com/python-poetry/poetry)
1224

25+
```sh
26+
pipx install poetry
27+
```
28+
29+
* [ruff](https://github.com/astral-sh/ruff)
30+
31+
```sh
32+
brew install ruff
33+
```
34+
35+
Similar to this [setup](https://github.com/Hasenpfote/python-poetry-example?tab=readme-ov-file), but no tox and uses ruff.
36+
1337
## Project
1438

1539
* `git clone`
1640

17-
* Install
41+
* Development
1842

1943
```sh
2044
poetry install
2145
```
2246

23-
* Development
24-
2547
Launch virtualenv:
2648

2749
```sh
2850
poetry shell
2951
```
3052

31-
Test:
53+
Code formatting:
54+
55+
```sh
56+
poetry run ruff format
57+
```
58+
59+
Linter:
3260

3361
```sh
34-
pytest
62+
poetry run ruff check
3563
```
3664

37-
Run code coverage:
65+
Test with coverage:
3866

3967
```sh
4068
pytest --cov --cov-report term
4169
```
4270

43-
* Publish
71+
* Publish checklist
4472

4573
* https://www.digitalocean.com/community/tutorials/how-to-publish-python-packages-to-pypi-using-poetry-on-ubuntu-22-04
74+
75+
* Bump version
76+
* [pyproject.toml](pyproject.toml)
77+
* [src/beancount_multitool/__version__.py](src/beancount_multitool/__version__.py)
78+
* Update [changelog](changelog.md)
79+
* Run local tests and coverage.
80+
* Update coverage number in [README.md](README.md).
81+
* `git commit` and check that GitHub Action tests succeed.
82+
* `poetry build`
83+
* `poetry publish`
84+

poetry.lock

+4-148
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "beancount-multitool"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
description = "A CLI tool that converts financial data to Beancount files"
55
authors = ["Rick Lan <[email protected]>"]
66
license = "MIT"
@@ -30,12 +30,34 @@ tomli = { version = "^2.0.1", python = "<3.11" }
3030
[tool.poetry.group.dev.dependencies]
3131
pytest = "^8.0"
3232
pytest-cov = "^4.0"
33-
black = "^24.4.2"
34-
flake8 = "^7.0.0"
3533

3634
[tool.poetry.scripts]
3735
bean-mt = "beancount_multitool.cli:main"
3836

37+
[tool.pytest.ini_options]
38+
addopts = [
39+
"--import-mode=importlib",
40+
]
41+
pythonpath = "src"
42+
3943
[build-system]
4044
requires = ["poetry-core"]
4145
build-backend = "poetry.core.masonry.api"
46+
47+
[tool.ruff.lint]
48+
# 1. Enable flake8-bugbear (`B`) rules, in addition to the defaults.
49+
select = ["E4", "E7", "E9", "F", "B"]
50+
51+
# 2. Avoid enforcing line-length violations (`E501`)
52+
ignore = ["E501"]
53+
54+
# 3. Avoid trying to fix flake8-bugbear (`B`) violations.
55+
unfixable = ["B"]
56+
57+
# 4. Ignore `E402` (import violations) in all `__init__.py` files, and in select subdirectories.
58+
[tool.ruff.lint.per-file-ignores]
59+
"__init__.py" = ["E402"]
60+
"**/{tests,docs,tools}/*" = ["E402"]
61+
62+
[tool.ruff.format]
63+
docstring-code-format = true

src/beancount_multitool/Institution.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
class Institution(ABC):
5-
65
@abstractmethod
76
def convert(self):
87
raise NotImplementedError # abstract

src/beancount_multitool/JABank.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,5 @@ def convert(self, csv_file: str, bean_file: str):
139139
None
140140
"""
141141
year = datetime.now().year
142-
df = self.read_transaction(csv_file, 2024)
142+
df = self.read_transaction(csv_file, year)
143143
self.write_bean(df, bean_file)

0 commit comments

Comments
 (0)