1{
2 lib,
3 fetchFromGitHub,
4 fetchpatch,
5 python3,
6}:
7
8python3.pkgs.buildPythonApplication rec {
9 pname = "pubs";
10 version = "0.9.0";
11 pyproject = true;
12
13 src = fetchFromGitHub {
14 owner = "pubs";
15 repo = "pubs";
16 tag = "v${version}";
17 hash = "sha256-U/9MLqfXrzYVGttFSafw4pYDy26WgdsJMCxciZzO1pw=";
18 };
19
20 patches = [
21 # https://github.com/pubs/pubs/pull/278
22 (fetchpatch {
23 url = "https://github.com/pubs/pubs/commit/9623d2c3ca8ff6d2bb7f6c8d8624f9a174d831bc.patch";
24 hash = "sha256-6qoufKPv3k6C9BQTZ2/175Nk7zWPh89vG+zebx6ZFOk=";
25 })
26 # https://github.com/pubs/pubs/pull/279
27 (fetchpatch {
28 url = "https://github.com/pubs/pubs/commit/05e214eb406447196c77c8aa3e4658f70e505f23.patch";
29 hash = "sha256-UBkKiYaG6y6z8lsRpdcsaGsoklv6qj07KWdfkQcVl2g=";
30 })
31 ];
32
33 build-system = with python3.pkgs; [
34 setuptools
35 ];
36
37 dependencies = with python3.pkgs; [
38 argcomplete
39 beautifulsoup4
40 bibtexparser
41 configobj
42 feedparser
43 python-dateutil
44 pyyaml
45 requests
46 six
47 standard-pipes # https://github.com/pubs/pubs/issues/282
48 ];
49
50 nativeCheckInputs = with python3.pkgs; [
51 ddt
52 mock
53 pyfakefs
54 pytestCheckHook
55 ];
56
57 disabledTestPaths = [
58 # Disabling git tests because they expect git to be preconfigured
59 # with the user's details. See
60 # https://github.com/NixOS/nixpkgs/issues/94663
61 "tests/test_git.py"
62 ];
63
64 disabledTests = [
65 # https://github.com/pubs/pubs/issues/276
66 "test_readme"
67 # AssertionError: Lists differ: ['Ini[112 chars]d to...
68 "test_add_non_standard"
69 ];
70
71 pythonImportsCheck = [
72 "pubs"
73 ];
74
75 meta = {
76 description = "Command-line bibliography manager";
77 mainProgram = "pubs";
78 homepage = "https://github.com/pubs/pubs";
79 changelog = "https://github.com/pubs/pubs/blob/v${version}/changelog.md";
80 license = lib.licenses.lgpl3Only;
81 maintainers = with lib.maintainers; [
82 dotlambda
83 ];
84 };
85}