summaryrefslogtreecommitdiff
path: root/default.nix
blob: a828aa9ac2a06a21ef895d754ab05c6c3ee4dd59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ pkgs ? import <nixpkgs> {} }:
with pkgs.python313Packages;

let
  sources = import ./npins;
  pywikiapi = buildPythonPackage rec {
    pname = "pywikiapi";
    version = "pinned";
    src = sources.pywikiapi;

    dependencies = [
      requests
    ];
  };
  logformat = import "${sources.logformat}" {};
in
buildPythonApplication rec {
  pname = "osm-proposals";
  version = "git";
  src = ./.;
  pyproject = true;

  build-system = [
    hatchling
  ];

  dependencies = [
    requests
    mwparserfromhell
    pywikiapi
    logformat
  ];

  # smoke test
  preCheck = "$out/bin/osm-proposals --help >/dev/null";

  postInstall = ''
    mkdir -p $out/share/osm-proposals
    cp -r ${./static}/. $out/share/osm-proposals/
  '';

  nativeCheckInputs = [
    pytestCheckHook
  ];
}