Skip to content

Commit

Permalink
just: new grill command passes
Browse files Browse the repository at this point in the history
  • Loading branch information
epogrebnyak committed May 18, 2023
1 parent 644d290 commit dab32b0
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ledger = ledger.process_entries([e1, e2, e3, e4, e5])
income_statement = ledger.income_statement()
print(income_statement)
assert income_statement == IncomeStatement(
income={'sales': 400},
income={'sales': 400},
expenses={'cogs': 200, 'sga': 50}
)
```
Expand Down
12 changes: 2 additions & 10 deletions abacus/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@
from dataclasses import dataclass, field
from typing import Dict, List, Tuple

from .accounts import (
Asset,
Capital,
Expense,
Income,
IncomeSummaryAccount,
Liability,
Netting,
get_contra_account_type,
)
from .accounts import (Asset, Capital, Expense, Income, IncomeSummaryAccount,
Liability, Netting, get_contra_account_type)
from .ledger import Ledger


Expand Down
3 changes: 2 additions & 1 deletion abacus/closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from typing import List

from .accounting_types import AccountName, Entry, Posting, RenameAccount
from .accounts import Asset, Capital, Expense, Income, IncomeSummaryAccount, Liability
from .accounts import (Asset, Capital, Expense, Income, IncomeSummaryAccount,
Liability)
from .ledger import Ledger, expenses, income, subset_by_class


Expand Down
6 changes: 2 additions & 4 deletions abacus/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from typing import Dict

from .accounting_types import AccountName, Amount
from .closing import (
closing_entries_for_permanent_contra_accounts,
closing_entries_for_temporary_contra_accounts,
)
from .closing import (closing_entries_for_permanent_contra_accounts,
closing_entries_for_temporary_contra_accounts)
from .ledger import Ledger, assets, capital, expenses, income, liabilities


Expand Down
2 changes: 1 addition & 1 deletion experimental/pure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from copy import deepcopy
from pprint import pprint


def empty_account():
Expand Down Expand Up @@ -153,7 +154,6 @@ def balance_sheet(chart, ledger):
inc = income_statement(chart_, ledger_)
bal = balance_sheet(chart_, ledger_)

from pprint import pprint

pprint(inc)
pprint(bal)
Expand Down
19 changes: 14 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ package := "abacus"
test:
poetry run pytest

# run all tests and checks
grill:
just test
just readme
just ruff
just mypy
just md
just lint

# run readme.py
readme:
poetry run python readme.py
Expand All @@ -22,10 +31,10 @@ mypy:

# black and isort
lint:
black .
isort .
poetry run black .
poetry run isort .

# build documentation
# build documentation (must change to mkdocstrings)
docs:
poetry run sphinx-build -a docs docs/site

Expand All @@ -37,10 +46,10 @@ show:
pages:
poetry run ghp-import docs/site

# create rst source for API documentation
# create rst source for API documentation (must change to mkdocstrings)
apidoc:
sphinx-apidoc -o docs src/{{package}}

# launch streamlit app
# launch streamlit app (depreciated)
app:
poetry run streamlit run app.py
14 changes: 3 additions & 11 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
from abacus.accounting_types import Entry, RenameAccount
from abacus.accounts import (
Asset,
Capital,
ContraAsset,
ContraIncome,
Expense,
Income,
IncomeSummaryAccount,
Liability,
Netting,
)
from abacus.accounts import (Asset, Capital, ContraAsset, ContraIncome,
Expense, Income, IncomeSummaryAccount, Liability,
Netting)
from abacus.closing import closing_entries
from abacus.ledger import Ledger

Expand Down
13 changes: 3 additions & 10 deletions tests/test_contras.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# %%

from abacus.accounts import (
Asset,
Capital,
ContraAsset,
ContraCapital,
ContraIncome,
Income,
IncomeSummaryAccount,
Netting,
)
from abacus.accounts import (Asset, Capital, ContraAsset, ContraCapital,
ContraIncome, Income, IncomeSummaryAccount,
Netting)
from abacus.chart import Chart, make_ledger

chart = Chart(
Expand Down

0 comments on commit dab32b0

Please sign in to comment.