This repository has been archived by the owner on Oct 7, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
default.nix
69 lines (62 loc) · 1.85 KB
/
default.nix
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ pkgs ? import <nixpkgs> { }, include_nixfmt ? false }:
let
pythonPackages = import ./requirements.nix { inherit pkgs; };
version = "dev";
sourceFilter = with pkgs.lib;
with builtins;
path: type:
let
name = baseNameOf (toString path);
ignoreDirectories = directories:
!(any (directory: directory == name && type == "directory")
directories);
ignoreFileTypes = types:
!(any (type: hasSuffix ("." + type) name && type == "regular") types);
ignoreEmacsFiles = !(hasPrefix ".#" name);
in ignoreDirectories [
"__pycache__"
"build"
"dist"
".mypy_cache"
".git"
"integrationtests"
] && ignoreFileTypes [ "pyc" ] && ignoreEmacsFiles;
source = pkgs.lib.cleanSourceWith {
src = ./.;
filter = sourceFilter;
};
pypi2nixFunction = { mkDerivation, lib, attrs, click, jinja2
, nix-prefetch-github, packaging, parsley, setuptools, setuptools-scm, toml
, jsonschema, hypothesis, pyyaml, }:
mkDerivation {
name = "pypi2nix-${version}";
src = source;
buildInputs = [ ];
doCheck = false;
propagatedBuildInputs = [
attrs
click
jinja2
jsonschema
nix-prefetch-github
packaging
parsley
pyyaml
setuptools
setuptools-scm
toml
];
meta = {
homepage = "https://github.com/nix-community/pypi2nix";
description =
"A tool that generates nix expressions for your python packages, so you don't have to.";
maintainers = with lib.maintainers; [ seppeljordan ];
};
};
callPackage = pkgs.lib.callPackageWith ({
mkDerivation = pythonPackages.mkDerivation;
lib = pkgs.lib;
git = pkgs.git;
nix-prefetch-hg = pkgs.nix-prefetch-hg;
} // pythonPackages.packages);
in callPackage pypi2nixFunction { }