diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 90c3b93a..59be64b1 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v6.0.0 hooks: - id: check-ast - id: fix-byte-order-marker @@ -25,27 +25,26 @@ repos: - id: pretty-format-json - id: trailing-whitespace - repo: https://github.com/pycqa/flake8 - rev: '3.9.2' + rev: '7.3.0' hooks: - id: flake8 # Just check that the code is well-formed additional_dependencies: [jsonschema, python-dateutil, pyexcel-ezodf] args: [--count, "--select=E9,F63,F7,F82", --show-source, --statistics] - repo: https://github.com/pre-commit/mirrors-isort - rev: v5.9.3 + rev: v5.10.1 hooks: - id: isort args: [--line-length 160] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 25.12.0 hooks: - id: black - repo: https://github.com/asottile/pyupgrade - rev: v2.26.0 + rev: v3.21.2 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/asottile/blacken-docs - rev: v1.11.0 + rev: 1.20.0 hooks: - id: blacken-docs - additional_dependencies: [black==20.8b1] diff --git a/README.dev.md b/README.dev.md index fc236ca3..b620e18e 100644 --- a/README.dev.md +++ b/README.dev.md @@ -185,6 +185,7 @@ While every commit and push is automatically tested as described, sometimes it's * security check: `bandit -r src` * reformat code: `black src tests` * sort imports: `isort .` +* update local pre-commit repos: `pre-commit autoupdate; pre-commit install` * run pre-commit tests without committing: `pre-commit run --all-files` Logs are stored in the `log` directory. To generate debug logs, prepend the command line with `LOG_LEVEL=DEBUG`, e.g.: diff --git a/README.md b/README.md index 0c04d73f..61e281d4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Privacy-focused, free, powerful crypto tax calculator **IMPORTANT NOTICE FOR USA TAXPAYERS**: Starting in 2025, the USA has transitioned from [Universal Application to Per-Wallet Application](https://github.com/eprbell/rp2/issues/135#issuecomment-2454959334). Support for Per-Wallet Application in RP2 is still under development — see [issue #135](https://github.com/eprbell/rp2/issues/135). Do not use RP2 for 2025 (and later) USA tax reporting until this issue is fully resolved. -**IMPORTANT NOTICE FOR TAXPAYERS WORLDWIDE**: Support for Per-Wallet Application in RP2 is still in development - see [issue 135 for details](https://github.com/eprbell/rp2/issues/135#issuecomment-2454959334). If your country mandates Per-Wallet Application, do not use RP2 for tax reporting until that issue is resolved. If your country permits Universal Application (already supported by RP2), you may safely use RP2. +**IMPORTANT NOTICE FOR TAXPAYERS WORLDWIDE**: Support for Per-Wallet Application in RP2 is still in development - see [issue 135 for details](https://github.com/eprbell/rp2/issues/135#issuecomment-2454959334). If your country mandates Per-Wallet Application, do not use RP2 for tax reporting until that issue is resolved. If your country permits Universal Application (already supported by RP2), you may safely use RP2. [![Static Analysis / Main Branch](https://github.com/eprbell/rp2/actions/workflows/static_analysis.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/static_analysis.yml) [![Documentation Check / Main Branch](https://github.com/eprbell/rp2/actions/workflows/documentation_check.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/documentation_check.yml) diff --git a/docs/output_files.md b/docs/output_files.md index ea5836a0..4c199045 100644 --- a/docs/output_files.md +++ b/docs/output_files.md @@ -98,4 +98,4 @@ This is a Japan-specific report: tax_report_jp.ods output file contains a legend The NTA (National Tax Agency) provides an excel spreadsheet for calculating the total average of each crypto asset per year. This report generates a similar report and can be optionally submitted with an individual's taxes or provided to the NTA if requested. -The summary sheet contains the total for the tax year. This is what is normally reported as "miscellaneous income" (雑所得). However, it may be reported as business income in certain circumstances. Please do your own research. \ No newline at end of file +The summary sheet contains the total for the tax year. This is what is normally reported as "miscellaneous income" (雑所得). However, it may be reported as business income in certain circumstances. Please do your own research. diff --git a/input/golden/generic/test_data2_generic_lofo_rp2_full_report.ods b/input/golden/generic/test_data2_generic_lofo_rp2_full_report.ods index 6a08de97..b0862f72 100644 Binary files a/input/golden/generic/test_data2_generic_lofo_rp2_full_report.ods and b/input/golden/generic/test_data2_generic_lofo_rp2_full_report.ods differ diff --git a/input/golden/generic/test_data_generic_lofo_rp2_full_report.ods b/input/golden/generic/test_data_generic_lofo_rp2_full_report.ods index 0bb20719..db064fd5 100644 Binary files a/input/golden/generic/test_data_generic_lofo_rp2_full_report.ods and b/input/golden/generic/test_data_generic_lofo_rp2_full_report.ods differ diff --git a/input/golden/generic/test_many_year_data_generic_lofo_rp2_full_report.ods b/input/golden/generic/test_many_year_data_generic_lofo_rp2_full_report.ods index 7fbb116d..1a1f4395 100644 Binary files a/input/golden/generic/test_many_year_data_generic_lofo_rp2_full_report.ods and b/input/golden/generic/test_many_year_data_generic_lofo_rp2_full_report.ods differ diff --git a/input/golden/us/test_data2_lofo_rp2_full_report.ods b/input/golden/us/test_data2_lofo_rp2_full_report.ods index f2573883..5de17502 100644 Binary files a/input/golden/us/test_data2_lofo_rp2_full_report.ods and b/input/golden/us/test_data2_lofo_rp2_full_report.ods differ diff --git a/input/golden/us/test_data_lofo_rp2_full_report.ods b/input/golden/us/test_data_lofo_rp2_full_report.ods index 6d0a6411..e55b3b03 100644 Binary files a/input/golden/us/test_data_lofo_rp2_full_report.ods and b/input/golden/us/test_data_lofo_rp2_full_report.ods differ diff --git a/input/golden/us/test_data_lofo_tax_report_us.ods b/input/golden/us/test_data_lofo_tax_report_us.ods index c606dcfe..d7d51fe7 100644 Binary files a/input/golden/us/test_data_lofo_tax_report_us.ods and b/input/golden/us/test_data_lofo_tax_report_us.ods differ diff --git a/input/golden/us/test_large_input_lofo_rp2_full_report.ods b/input/golden/us/test_large_input_lofo_rp2_full_report.ods index b13ad27d..52e69720 100644 Binary files a/input/golden/us/test_large_input_lofo_rp2_full_report.ods and b/input/golden/us/test_large_input_lofo_rp2_full_report.ods differ diff --git a/input/golden/us/test_large_input_lofo_tax_report_us.ods b/input/golden/us/test_large_input_lofo_tax_report_us.ods index 299284db..b263dcb6 100644 Binary files a/input/golden/us/test_large_input_lofo_tax_report_us.ods and b/input/golden/us/test_large_input_lofo_tax_report_us.ods differ diff --git a/input/golden/us/test_many_year_data_lofo_rp2_full_report.ods b/input/golden/us/test_many_year_data_lofo_rp2_full_report.ods index 68393a12..1f30797b 100644 Binary files a/input/golden/us/test_many_year_data_lofo_rp2_full_report.ods and b/input/golden/us/test_many_year_data_lofo_rp2_full_report.ods differ diff --git a/input/golden/us/test_many_year_data_lofo_tax_report_us.ods b/input/golden/us/test_many_year_data_lofo_tax_report_us.ods index 3f896662..4a887a0c 100644 Binary files a/input/golden/us/test_many_year_data_lofo_tax_report_us.ods and b/input/golden/us/test_many_year_data_lofo_tax_report_us.ods differ diff --git a/lychee.toml b/lychee.toml index b6cd449a..f9c61192 100644 --- a/lychee.toml +++ b/lychee.toml @@ -4,4 +4,4 @@ exclude = [ "https://www.reddit.com/.*", "https://finance.yahoo.com/.*", "https://www.cointracker.io/.*" -] \ No newline at end of file +] diff --git a/src/rp2/abstract_accounting_method.py b/src/rp2/abstract_accounting_method.py index b4cab025..2cbd8197 100644 --- a/src/rp2/abstract_accounting_method.py +++ b/src/rp2/abstract_accounting_method.py @@ -281,7 +281,6 @@ def seek_non_exhausted_acquired_lot( if selected_acquired_lot_amount > ZERO and selected_acquired_lot: lot_candidates.clear_partial_amount(selected_acquired_lot) - if selected_acquired_lot_amount > taxable_event_amount: - self.add_selected_lot_to_heap(lot_candidates.acquired_lot_heap, selected_acquired_lot) + self.add_selected_lot_to_heap(lot_candidates.acquired_lot_heap, selected_acquired_lot) return AcquiredLotAndAmount(acquired_lot=selected_acquired_lot, amount=selected_acquired_lot_amount) return None diff --git a/src/rp2/locales/en/LC_MESSAGES/messages.po b/src/rp2/locales/en/LC_MESSAGES/messages.po index df89b727..61206dd7 100644 --- a/src/rp2/locales/en/LC_MESSAGES/messages.po +++ b/src/rp2/locales/en/LC_MESSAGES/messages.po @@ -773,4 +773,3 @@ msgstr "" #~ msgid "Exchange or wallet where balance is held (asset and exchange tab only)" #~ msgstr "" - diff --git a/src/rp2/locales/en_IE/LC_MESSAGES/messages.po b/src/rp2/locales/en_IE/LC_MESSAGES/messages.po index ce9cb288..e32c6387 100644 --- a/src/rp2/locales/en_IE/LC_MESSAGES/messages.po +++ b/src/rp2/locales/en_IE/LC_MESSAGES/messages.po @@ -755,4 +755,3 @@ msgstr "" msgid "{}_{}" msgstr "" - diff --git a/src/rp2/locales/es/LC_MESSAGES/messages.po b/src/rp2/locales/es/LC_MESSAGES/messages.po index 3c251590..36da0da0 100644 --- a/src/rp2/locales/es/LC_MESSAGES/messages.po +++ b/src/rp2/locales/es/LC_MESSAGES/messages.po @@ -755,4 +755,3 @@ msgstr "{}_Resumen" msgid "{}_{}" msgstr "{}_{}" - diff --git a/src/rp2/locales/ja/LC_MESSAGES/messages.po b/src/rp2/locales/ja/LC_MESSAGES/messages.po index 75b6c449..fb972a8e 100644 --- a/src/rp2/locales/ja/LC_MESSAGES/messages.po +++ b/src/rp2/locales/ja/LC_MESSAGES/messages.po @@ -755,4 +755,3 @@ msgstr "" msgid "{}_{}" msgstr "" - diff --git a/src/rp2/locales/kl/LC_MESSAGES/messages.po b/src/rp2/locales/kl/LC_MESSAGES/messages.po index 6bb1d1d5..6b51e987 100644 --- a/src/rp2/locales/kl/LC_MESSAGES/messages.po +++ b/src/rp2/locales/kl/LC_MESSAGES/messages.po @@ -764,4 +764,3 @@ msgstr "__test_{}_{}" #~ msgid "US dollar value of the fees" #~ msgstr "__test_US dollar value of the fees" - diff --git a/src/rp2/locales/messages.pot b/src/rp2/locales/messages.pot index 915bff81..dc86dab4 100644 --- a/src/rp2/locales/messages.pot +++ b/src/rp2/locales/messages.pot @@ -754,4 +754,3 @@ msgstr "" msgid "{}_{}" msgstr "" -