tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
python3.pkgs.beetcamp: init at 0.22.0
Rebecca Turner
5 months ago
290fffd8
2a137478
+168
-1
4 changed files
expand all
collapse all
unified
split
pkgs
development
python-modules
beetcamp
default.nix
remove-git-pytest-option.diff
coloraide
default.nix
top-level
python-packages.nix
+67
pkgs/development/python-modules/beetcamp/default.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
beets,
4
4
+
buildPythonPackage,
5
5
+
fetchFromGitHub,
6
6
+
httpx,
7
7
+
packaging,
8
8
+
poetry-core,
9
9
+
pycountry,
10
10
+
pytest-cov-stub,
11
11
+
pytestCheckHook,
12
12
+
rich-tables,
13
13
+
filelock,
14
14
+
writableTmpDirAsHomeHook,
15
15
+
nix-update-script,
16
16
+
}:
17
17
+
18
18
+
let
19
19
+
version = "0.22.0";
20
20
+
in
21
21
+
buildPythonPackage {
22
22
+
pname = "beetcamp";
23
23
+
inherit version;
24
24
+
pyproject = true;
25
25
+
26
26
+
src = fetchFromGitHub {
27
27
+
owner = "snejus";
28
28
+
repo = "beetcamp";
29
29
+
tag = version;
30
30
+
hash = "sha256-5tcQtvYmXT213mZnzKz2kwE5K22rro++lRF65PjC5X0=";
31
31
+
};
32
32
+
33
33
+
patches = [
34
34
+
./remove-git-pytest-option.diff
35
35
+
];
36
36
+
37
37
+
build-system = [
38
38
+
poetry-core
39
39
+
];
40
40
+
41
41
+
dependencies = [
42
42
+
beets
43
43
+
httpx
44
44
+
packaging
45
45
+
pycountry
46
46
+
];
47
47
+
48
48
+
nativeCheckInputs = [
49
49
+
writableTmpDirAsHomeHook
50
50
+
pytestCheckHook
51
51
+
pytest-cov-stub
52
52
+
rich-tables
53
53
+
filelock
54
54
+
];
55
55
+
56
56
+
passthru.updateScript = nix-update-script { };
57
57
+
58
58
+
meta = {
59
59
+
description = "Bandcamp autotagger source for beets (http://beets.io)";
60
60
+
homepage = "https://github.com/snejus/beetcamp";
61
61
+
license = lib.licenses.gpl2Only;
62
62
+
maintainers = [
63
63
+
lib.maintainers._9999years
64
64
+
];
65
65
+
mainProgram = "beetcamp";
66
66
+
};
67
67
+
}
+98
pkgs/development/python-modules/beetcamp/remove-git-pytest-option.diff
···
1
1
+
The test suite has support for comparing results against a base revision of the
2
2
+
repository.
3
3
+
4
4
+
This requires that we run the tests from a Git checkout of the `beetcamp` repo,
5
5
+
which we do not do. We don't want to compare against a base revision, so we
6
6
+
just remove the option entirely.
7
7
+
8
8
+
diff --git a/tests/conftest.py b/tests/conftest.py
9
9
+
index 04d81f66f0..018d9e3c0c 100644
10
10
+
--- a/tests/conftest.py
11
11
+
+++ b/tests/conftest.py
12
12
+
@@ -9,7 +9,6 @@
13
13
+
14
14
+
import pytest
15
15
+
from beets.autotag.hooks import AlbumInfo, TrackInfo
16
16
+
-from git import Repo
17
17
+
from rich_tables.diff import pretty_diff
18
18
+
from rich_tables.utils import make_console
19
19
+
20
20
+
@@ -17,10 +16,8 @@
21
21
+
from beetsplug.bandcamp.helpers import Helpers
22
22
+
23
23
+
if TYPE_CHECKING:
24
24
+
- from _pytest.config import Config
25
25
+
from _pytest.config.argparsing import Parser
26
26
+
from _pytest.fixtures import SubRequest
27
27
+
- from _pytest.terminal import TerminalReporter
28
28
+
from rich.console import Console
29
29
+
30
30
+
31
31
+
@@ -29,28 +26,6 @@
32
32
+
33
33
+
34
34
+
def pytest_addoption(parser: Parser) -> None:
35
35
+
- newest_folders = sorted(
36
36
+
- (p for p in Path("lib_tests").glob("*") if p.is_dir()),
37
37
+
- key=lambda p: p.stat().st_ctime,
38
38
+
- reverse=True,
39
39
+
- )
40
40
+
- all_names = [f.name for f in newest_folders]
41
41
+
- names = [n for n in all_names if n != "dev"]
42
42
+
- names_set = set(names)
43
43
+
-
44
44
+
- base_name = ""
45
45
+
- for commit in Repo(".").iter_commits(paths=["./beetsplug"]):
46
46
+
- short_commit = str(commit)[:8]
47
47
+
- if short_commit in names_set:
48
48
+
- base_name = short_commit
49
49
+
- break
50
50
+
-
51
51
+
- parser.addoption(
52
52
+
- "--base",
53
53
+
- choices=all_names,
54
54
+
- default=base_name or "dev",
55
55
+
- help="base directory / comparing against",
56
56
+
- )
57
57
+
parser.addoption(
58
58
+
"--target",
59
59
+
default="dev",
60
60
+
@@ -64,16 +39,6 @@
61
61
+
)
62
62
+
63
63
+
64
64
+
-def pytest_terminal_summary(
65
65
+
- terminalreporter: TerminalReporter,
66
66
+
- exitstatus: int, # noqa: ARG001
67
67
+
- config: Config,
68
68
+
-) -> None:
69
69
+
- base = config.getoption("base")
70
70
+
- target = config.getoption("target")
71
71
+
- terminalreporter.write(f"--- Compared {target} against {base} ---\n")
72
72
+
-
73
73
+
-
74
74
+
def pytest_assertrepr_compare(op: str, left: Any, right: Any): # noqa: ARG001
75
75
+
"""Pretty print the difference between dict objects."""
76
76
+
actual, expected = left, right
77
77
+
diff --git a/tests/test_lib.py b/tests/test_lib.py
78
78
+
index 665d5aa61d..0a81e42b24 100644
79
79
+
--- a/tests/test_lib.py
80
80
+
+++ b/tests/test_lib.py
81
81
+
@@ -19,7 +19,6 @@
82
82
+
83
83
+
import pytest
84
84
+
from filelock import FileLock
85
85
+
-from git import Repo
86
86
+
from rich import box
87
87
+
from rich.console import Group
88
88
+
from rich.markup import escape
89
89
+
@@ -273,9 +272,6 @@
90
90
+
return
91
91
+
92
92
+
sections = [("Failed", summary["failed"], "red")]
93
93
+
- with suppress(TypeError):
94
94
+
- if Repo(pytestconfig.rootpath).active_branch.name == "dev":
95
95
+
- sections.append(("Fixed", summary["fixed"], "green"))
96
96
+
97
97
+
columns = []
98
98
+
for name, all_changes, color in sections:
+1
-1
pkgs/development/python-modules/coloraide/default.nix
···
31
31
];
32
32
33
33
meta = {
34
34
-
description = "A color library for Python";
34
34
+
description = "Color library for Python";
35
35
homepage = "https://pypi.org/project/coloraide/";
36
36
license = lib.licenses.mit;
37
37
maintainers = [
+2
pkgs/top-level/python-packages.nix
···
1801
1801
1802
1802
bech32 = callPackage ../development/python-modules/bech32 { };
1803
1803
1804
1804
+
beetcamp = callPackage ../development/python-modules/beetcamp { };
1805
1805
+
1804
1806
before-after = callPackage ../development/python-modules/before-after { };
1805
1807
1806
1808
behave = callPackage ../development/python-modules/behave { };