Skip to content

Commit 7dd54f6

Browse files
authored
python3Packages.beancount: 2.3.6 -> 3.1.0 (#371541)
2 parents b3c931b + b236f1f commit 7dd54f6

File tree

11 files changed

+299
-64
lines changed

11 files changed

+299
-64
lines changed

nixos/doc/manual/release-notes/rl-2505.section.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@
179179

180180
- `ast-grep` remove `sg` command to prevent conflict with `sg` command from shadow-utils. If you need legacy sg command compatibility with old code, you can use `ast-grep.override { enableLegacySg = true; }`
181181

182+
- `python3Packages.beancount` was updated to 3.1.0. Previous major version remains available as `python3Packages.beancount_2`.
183+
182184
- `binwalk` was updated to 3.1.0, which has been rewritten in rust. The python module is no longer available.
183185
See the release notes of [3.1.0](https://github.com/ReFirmLabs/binwalk/releases/tag/v3.1.0) for more information.
184186

pkgs/by-name/be/beanprice/package.nix

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
python3Packages.buildPythonApplication rec {
88
pname = "beanprice";
9-
version = "1.2.1-unstable-2024-06-19";
9+
version = "2.0.0";
1010
pyproject = true;
1111

1212
src = fetchFromGitHub {
1313
owner = "beancount";
1414
repo = "beanprice";
15-
rev = "e894c9182f4d16f9a46ccb87bdaeca1a7dede040";
16-
hash = "sha256-l96W77gldE06Za8fj84LADGCqlYeWlHKvWQO+oLy1gI=";
15+
tag = "v${version}";
16+
hash = "sha256-+bqYnTzZByJlCPUhThM2B9UjgdWzjF21Yiw3fQAZ6k4=";
1717
};
1818

1919
build-system = with python3Packages; [ setuptools ];
@@ -31,9 +31,10 @@ python3Packages.buildPythonApplication rec {
3131
regex
3232
];
3333

34-
pythonImportsCheck = [ "beancount" ];
34+
pythonImportsCheck = [ "beanprice" ];
3535

3636
meta = {
37+
broken = lib.versionOlder python3Packages.beancount.version "3";
3738
homepage = "https://github.com/beancount/beanprice";
3839
description = "Price quotes fetcher for Beancount";
3940
longDescription = ''

pkgs/by-name/fa/fava/package.nix

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
python3Packages.buildPythonApplication rec {
88
pname = "fava";
9-
version = "1.29";
9+
version = "1.30.1";
1010
pyproject = true;
1111

1212
src = fetchPypi {
1313
inherit pname version;
14-
hash = "sha256-UZZ142FchYXqPtHb6EWnKjV+xtJ0Gvu+SovTH6+kVn8=";
14+
hash = "sha256-69Wx9/H7nLDPZP9LOUnDJngY9YTCcr+oQ0E6+xeIWPE=";
1515
};
1616

1717
postPatch = ''
@@ -24,11 +24,12 @@ python3Packages.buildPythonApplication rec {
2424
dependencies = with python3Packages; [
2525
babel
2626
beancount
27+
beangulp
28+
beanquery
2729
cheroot
2830
click
2931
flask
3032
flask-babel
31-
jaraco-functools
3233
jinja2
3334
markdown2
3435
ply
@@ -39,17 +40,22 @@ python3Packages.buildPythonApplication rec {
3940

4041
nativeCheckInputs = [ python3Packages.pytestCheckHook ];
4142

43+
env = {
44+
# Disable some tests when building with beancount2
45+
SNAPSHOT_IGNORE = lib.versions.major python3Packages.beancount.version == "2";
46+
};
47+
4248
preCheck = ''
4349
export HOME=$TEMPDIR
4450
'';
4551

46-
meta = with lib; {
52+
meta = {
4753
description = "Web interface for beancount";
4854
mainProgram = "fava";
4955
homepage = "https://beancount.github.io/fava";
5056
changelog = "https://beancount.github.io/fava/changelog.html";
51-
license = licenses.mit;
52-
maintainers = with maintainers; [
57+
license = lib.licenses.mit;
58+
maintainers = with lib.maintainers; [
5359
bhipple
5460
sigmanificient
5561
];
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchPypi,
5+
isPy3k,
6+
beautifulsoup4,
7+
bottle,
8+
chardet,
9+
python-dateutil,
10+
google-api-python-client,
11+
google-auth-oauthlib,
12+
lxml,
13+
oauth2client,
14+
ply,
15+
pytest,
16+
python-magic,
17+
requests,
18+
}:
19+
20+
buildPythonPackage rec {
21+
version = "2.3.6";
22+
format = "setuptools";
23+
pname = "beancount";
24+
25+
disabled = !isPy3k;
26+
27+
src = fetchPypi {
28+
inherit pname version;
29+
hash = "sha256-gB+Tvta1fS4iQ2aIxInVob8fduIQ887RhoB1fmDTR1o=";
30+
};
31+
32+
# Tests require files not included in the PyPI archive.
33+
doCheck = false;
34+
35+
propagatedBuildInputs = [
36+
beautifulsoup4
37+
bottle
38+
chardet
39+
python-dateutil
40+
google-api-python-client
41+
google-auth-oauthlib
42+
lxml
43+
oauth2client
44+
ply
45+
python-magic
46+
requests
47+
# pytest really is a runtime dependency
48+
# https://github.com/beancount/beancount/blob/v2/setup.py#L81-L82
49+
pytest
50+
];
51+
52+
# beancount cannot be directly bumped to 3.x
53+
# e.g. https://github.com/NixOS/nixpkgs/issues/380197
54+
passthru.skipBulkUpdate = true;
55+
56+
meta = with lib; {
57+
homepage = "https://github.com/beancount/beancount";
58+
description = "Double-entry bookkeeping computer language";
59+
longDescription = ''
60+
A double-entry bookkeeping computer language that lets you define
61+
financial transaction records in a text file, read them in memory,
62+
generate a variety of reports from them, and provides a web interface.
63+
'';
64+
license = licenses.gpl2Only;
65+
maintainers = with maintainers; [
66+
sharzy
67+
polarmutex
68+
];
69+
};
70+
}
Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,68 @@
11
{
22
lib,
3+
bison,
34
buildPythonPackage,
4-
fetchPypi,
5-
isPy3k,
6-
beautifulsoup4,
7-
bottle,
8-
chardet,
5+
click,
6+
fetchFromGitHub,
7+
flex,
8+
gnupg,
9+
meson,
10+
meson-python,
11+
pytestCheckHook,
912
python-dateutil,
10-
google-api-python-client,
11-
google-auth-oauthlib,
12-
lxml,
13-
oauth2client,
14-
ply,
15-
pytest,
16-
python-magic,
17-
requests,
13+
regex,
1814
}:
1915

2016
buildPythonPackage rec {
21-
version = "2.3.6";
22-
format = "setuptools";
17+
version = "3.1.0";
2318
pname = "beancount";
19+
pyproject = true;
2420

25-
disabled = !isPy3k;
26-
27-
src = fetchPypi {
28-
inherit pname version;
29-
hash = "sha256-gB+Tvta1fS4iQ2aIxInVob8fduIQ887RhoB1fmDTR1o=";
21+
src = fetchFromGitHub {
22+
owner = "beancount";
23+
repo = "beancount";
24+
tag = version;
25+
hash = "sha256-ogjBW/NGlMmhYlzcx3EWWoVi+OOEv2Wm49tzwMiNb8A=";
3026
};
3127

32-
# Tests require files not included in the PyPI archive.
33-
doCheck = false;
28+
build-system = [
29+
meson
30+
meson-python
31+
];
3432

35-
propagatedBuildInputs = [
36-
beautifulsoup4
37-
bottle
38-
chardet
33+
dependencies = [
34+
click
3935
python-dateutil
40-
google-api-python-client
41-
google-auth-oauthlib
42-
lxml
43-
oauth2client
44-
ply
45-
python-magic
46-
requests
47-
# pytest really is a runtime dependency
48-
# https://github.com/beancount/beancount/blob/v2/setup.py#L81-L82
49-
pytest
36+
regex
37+
];
38+
39+
nativeBuildInputs = [
40+
bison
41+
flex
5042
];
5143

52-
# beancount cannot be directly bumped to 3.x
53-
# e.g. https://github.com/NixOS/nixpkgs/issues/380197
54-
passthru.skipBulkUpdate = true;
44+
nativeCheckInputs = [
45+
gnupg
46+
pytestCheckHook
47+
];
48+
49+
preCheck = ''
50+
# avoid local paths, relative imports wont resolve correctly
51+
mv beancount tests
52+
'';
53+
54+
pythonImportsCheck = [ "beancount" ];
5555

56-
meta = with lib; {
56+
meta = {
5757
homepage = "https://github.com/beancount/beancount";
58+
changelog = "https://github.com/beancount/beancount/releases/tag/${src.tag}";
5859
description = "Double-entry bookkeeping computer language";
5960
longDescription = ''
6061
A double-entry bookkeeping computer language that lets you define
6162
financial transaction records in a text file, read them in memory,
6263
generate a variety of reports from them, and provides a web interface.
6364
'';
64-
license = licenses.gpl2Only;
65-
maintainers = with maintainers; [
66-
sharzy
67-
polarmutex
68-
];
65+
license = lib.licenses.gpl2Only;
66+
maintainers = with lib.maintainers; [ alapshin ];
6967
};
7068
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
lib,
3+
beancount,
4+
beautifulsoup4,
5+
buildPythonPackage,
6+
chardet,
7+
click,
8+
fetchFromGitHub,
9+
lxml,
10+
petl,
11+
python-magic,
12+
pytestCheckHook,
13+
setuptools,
14+
}:
15+
16+
buildPythonPackage rec {
17+
pname = "beangulp";
18+
version = "0.2.0";
19+
pyproject = true;
20+
21+
src = fetchFromGitHub {
22+
owner = "beancount";
23+
repo = "beangulp";
24+
tag = "v${version}";
25+
hash = "sha256-h7xLHwEyS+tOI7v6Erp12VfVnxOf4930++zghhC3in4=";
26+
};
27+
28+
build-system = [ setuptools ];
29+
30+
dependencies = [
31+
beancount
32+
beautifulsoup4
33+
chardet
34+
click
35+
lxml
36+
python-magic
37+
];
38+
39+
nativeCheckInputs = [
40+
petl
41+
pytestCheckHook
42+
];
43+
44+
pythonImportsCheck = [
45+
"beangulp"
46+
];
47+
48+
meta = {
49+
homepage = "https://github.com/beancount/beangulp";
50+
description = "Importers framework for Beancount";
51+
longDescription = ''
52+
Beangulp provides a framework for importing transactions into a Beancoount
53+
ledger from account statements and other documents and for managing documents.
54+
'';
55+
license = lib.licenses.gpl2Only;
56+
maintainers = with lib.maintainers; [ alapshin ];
57+
};
58+
}

pkgs/development/python-modules/beanquery/default.nix

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@
77
python-dateutil,
88
pytestCheckHook,
99
setuptools,
10-
tatsu,
10+
tatsu-lts,
1111
}:
12-
buildPythonPackage rec {
12+
buildPythonPackage {
1313
pname = "beanquery";
14-
version = "0.1.0";
14+
version = "0.1.0-unstable-2025-01-10";
1515
pyproject = true;
1616

1717
src = fetchFromGitHub {
1818
owner = "beancount";
1919
repo = "beanquery";
20-
tag = "v${version}";
21-
hash = "sha256-1+KTUvnqPceRbzY1OZwOSQdK7f78K9kSwtQfI1SUIa8=";
20+
# Pinned at commit where tatsu dependency replaced with tatsu-lts
21+
# Later snapsot versions break fava build due to API changes at beanquery/shell.py
22+
rev = "e77a67996a54eef2e9d77b6352c74a40164e281d";
23+
hash = "sha256-XYfKAscm55lY4YjIGTQ6RMFnCPWemfszpheGQ9qjMiM=";
2224
};
2325

2426
build-system = [ setuptools ];
@@ -27,15 +29,12 @@ buildPythonPackage rec {
2729
beancount
2830
click
2931
python-dateutil
30-
tatsu
32+
tatsu-lts
3133
];
3234

33-
pythonRelaxDeps = [ "tatsu" ];
34-
3535
nativeCheckInputs = [ pytestCheckHook ];
3636

3737
pythonImportsCheck = [
38-
"beancount"
3938
"beanquery"
4039
];
4140

0 commit comments

Comments
 (0)