Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python312Packages.beancount3: init at 3.0.0 #371541

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alapshin
Copy link
Contributor

@alapshin alapshin commented Jan 6, 2025

Added package for beancount3
Update fava to version 1.30 which supports both beancount2 and beancount3.
Add package for beangulp as a replacement for beancount.ingest

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@alapshin alapshin changed the title Update Beancount to a new major version python312Packages.beancount: 2.3.6 -> 3.0.0 Jan 6, 2025
@nix-owners nix-owners bot requested a review from natsukium January 6, 2025 20:11
@github-actions github-actions bot added 10.rebuild-darwin: 11-100 10.rebuild-linux: 11-100 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog labels Jan 6, 2025
@SharzyL
Copy link
Contributor

SharzyL commented Jan 7, 2025

I am not using v3 currently. How is it working with existing tools now?

@alapshin
Copy link
Contributor Author

alapshin commented Jan 7, 2025

I am not using v3 currently. How is it working with existing tools now?

I used v3 for the last 6 months, and it works ok for me. However, I don't use any custom importers based on beancount.ingest which is the main breaking change, and input my expenses by hand. Until recently, Fava didn't support v3, but now it does: beancount/fava#1831

Overall, I think it is in good enough shape for everyday use, but it depends on your setup.

@SharzyL
Copy link
Contributor

SharzyL commented Jan 7, 2025

It would be nice to have v3 in nixpkgs. But since there are major incompatibilities between v2 and v3, and v2 is still widely used, I would like to keep both v2 and v3 in nixpkgs, i.e. beancount and beancount3. Otherwise users may find their tools broken after an upgrade. When v2 is marked as deprecated, we can add warnings in nixpkgs and later replace beancount with beancount3.

@github-actions github-actions bot removed 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog labels Jan 7, 2025
@alapshin
Copy link
Contributor Author

alapshin commented Jan 7, 2025

Ok, makes sense. I reworked PR: added separate package for beancount3 and support for building fava with either version. This way user can specify beancount = beancount3 via overlay and use it everywhere.

@alapshin alapshin changed the title python312Packages.beancount: 2.3.6 -> 3.0.0 python312Packages.beancount3: init at 3.0.0 Jan 7, 2025
pkgs/by-name/fa/fava/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/fa/fava/package.nix Outdated Show resolved Hide resolved
pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
fetchPypi,
python3Packages,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is very cumbersome to override python3Packages to build fava with beancount3 due to the strange design in python3Packages. Can we just build fava with beancount3? May this cause compatibility issues?

Copy link
Contributor Author

@alapshin alapshin Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it help if, instead of accepting python3Packages, the package accepted beancount dependency directly? I think this wouldn't work since package uses buildPythonApplication

It is possible to build Fava either with v2 or v3, but as far as I understand depending on version used Fava uses different approach for importers under the hood

https://github.com/beancount/fava/blob/main/CHANGES

For importers, this sticks to beancount.ingest on v2 and used beangulp for v3.
Due to changes related to duplicate detection, duplicate detection is not
automatically done by Fava here but can still be manually specified as hooks.

Also, I'm not sure if it is a good idea to mix-match beancount version between different packages (fava, beanprice, beanquery, beangulp, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants