1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 pytestCheckHook,
7 astunparse,
8 setuptools,
9}:
10buildPythonPackage rec {
11 pname = "import-expression";
12 version = "1.1.4";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "ioistired";
17 repo = "import-expression-parser";
18 rev = "refs/tags/v${version}";
19 hash = "sha256-mll2NePB7fthzltLOk6D9BgaDpH6GaW4psqcGun/0qM=";
20 };
21
22 patches = [
23 (fetchpatch {
24 url = "https://github.com/ioistired/import-expression-parser/commit/3daf968c3163b64685aa529740e132f0df5ab262.patch";
25 hash = "sha256-2Ubv3onor2D26udZbDDMb3iNLopEIRnIcO/X6WUVmJU=";
26 })
27 ];
28
29 nativeBuildInputs = [ setuptools ];
30 propagatedBuildInputs = [ astunparse ];
31 nativeCheckInputs = [ pytestCheckHook ];
32 pytestFlagsArray = [ "tests.py" ];
33
34 pythonImportsCheck = [
35 "import_expression"
36 "import_expression._codec"
37 ];
38
39 meta = {
40 description = "Transpiles a superset of python to allow easy inline imports";
41 homepage = "https://github.com/ioistired/import-expression-parser";
42 license = with lib.licenses; [
43 mit
44 psfl
45 ];
46 mainProgram = "import-expression";
47 maintainers = with lib.maintainers; [ lychee ];
48 };
49}