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

python3Packages.beancount: 2.3.6 -> 3.1.0 #371541

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

Conversation

alapshin
Copy link
Contributor

@alapshin alapshin commented Jan 6, 2025

Add package for beancount v3
Add package for beangulp as a replacement for beancount.ingest
Update package for beanquery to use snapshot version that using TatSu-LTS dependency: beancount/beanquery#226
Update fava to version 1.30.1 which supports both beancount2 and beancount3.

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
@alapshin alapshin force-pushed the beancount3 branch 2 times, most recently from 4faf5eb to 85ca22d Compare January 7, 2025 16:21
@alapshin alapshin force-pushed the beancount3 branch 2 times, most recently from d4e4b3c to 4bedca5 Compare February 21, 2025 13:54
@alapshin
Copy link
Contributor Author

alapshin commented Feb 21, 2025

One more argument for dropping support for beancount v2

New version (2.0.0) of beanprice doesn't support it either: beancount/beanprice#98

After some thought I really want to drop support for beancount v2 in this PR but not sure which way forward is the best.

I understand that there are people who would be inconvenienced by this but feel now is a good moment to od it. Most of the tools from the ecosystem supports beancount v3 and some supports only v3 going forward (see beanprice for example).

I see multiple ways forward

  1. Have only v3
  2. Have both beancount v2 and v3 in nixpkgs and use v2 by default
  3. Have both beancount v2 and v3 in nixpkgs and use v3 by default

In both situation 2 and 3 it should be possible to force version using overlay similar to

    pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
      (pyfinal: pyprev: {
        beancount = pyprev.beancount_3; case 2
        // or
        beancount = pyprev.beancount_2; // case 3
      })
    ]

and have all other packages use it. However this only works as long as package itself implements support for v2 and v3 (like fava for example). If package drops support for v2 (like beanprice 2.0) it wouldn't work and one would have to have separate beanprice package for beancount v2. This could be achievable but I'm not sure if it worth it.

@alapshin
Copy link
Contributor Author

Separate commit for changes to this file.

This still hasn't been addressed. The attribute still has the wrong name. ...

I have removed formatting changes to beancount/default.nix. Attribute was also renamed from beancount3 to beancount_3.

@dotlambda
Copy link
Member

Have both beancount v2 and v3 in nixpkgs and use v3 by default

Let's do this one for now. We can drop v2 once it fails to build.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

The commit message needs to be adapted. I suggest

  • python313Packages.beancount: 2.3.6 -> 3.1.0
  • python313Packages.beancount_2: init at 2.3.6

@dotlambda
Copy link
Member

Also updated beanprice 2.0 which require beancount >= 3, but because v3 is default now it works.

It might make sense to set meta.broken = lib.versionOlder beancount.version "3"

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation labels Feb 21, 2025
@dotlambda dotlambda changed the title python313Packages.beancount3: init at 3.1.0 @alapshin python3Packages.beancount: 2.3.6 -> 3.1.0 Feb 21, 2025
@dotlambda dotlambda changed the title @alapshin python3Packages.beancount: 2.3.6 -> 3.1.0 python3Packages.beancount: 2.3.6 -> 3.1.0 Feb 21, 2025
@alapshin alapshin marked this pull request as ready for review February 21, 2025 18:04
@alapshin
Copy link
Contributor Author

Added comment in beanquery package explaining choice of snapshot version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: packaging request Request for a new package to be added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 8.has: changelog 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 11-100 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants