1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, setuptools-scm
6, toml
7, pytestCheckHook
8}:
9
10buildPythonPackage rec {
11 pname = "pure_eval";
12 version = "0.2.2";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "alexmojaki";
19 repo = pname;
20 rev = "v${version}";
21 hash = "sha256-9N+UcgAv30s4ctgsBrOHiix4BoXhKPgxH/GOz/NIFdU=";
22 };
23
24 SETUPTOOLS_SCM_PRETEND_VERSION = version;
25
26 buildInputs = [
27 setuptools-scm
28 ];
29
30 propagatedBuildInputs = [
31 toml
32 ];
33
34 nativeCheckInputs = [
35 pytestCheckHook
36 ];
37
38 pythonImportsCheck = [
39 "pure_eval"
40 ];
41
42 meta = with lib; {
43 description = "Safely evaluate AST nodes without side effects";
44 homepage = "https://github.com/alexmojaki/pure_eval";
45 license = licenses.mit;
46 maintainers = with maintainers; [ gebner ];
47 };
48}