1{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder, isPy27
2, importlib-metadata
3, intreehooks
4, isort
5, pathlib2
6, pep517
7, pytest-mock
8, pytestCheckHook
9, tomlkit
10, typing
11, virtualenv
12}:
13
14buildPythonPackage rec {
15 pname = "poetry-core";
16 version = "1.0.0a9";
17 format = "pyproject";
18
19 src = fetchFromGitHub {
20 owner = "python-poetry";
21 repo = pname;
22 rev = version;
23 sha256 = "1ln47x1bc1yvhdfwfnkqx4d2j7988a59v8vmcriw14whfgzfki75";
24 };
25
26 # avoid mass-rebuild of python packages
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace "^1.7.0" "^1.6.0"
30 '';
31
32 nativeBuildInputs = [
33 intreehooks
34 ];
35
36 propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [
37 importlib-metadata
38 ] ++ lib.optionals isPy27 [
39 pathlib2
40 typing
41 ];
42
43 checkInputs = [
44 isort
45 pep517
46 pytest-mock
47 pytestCheckHook
48 tomlkit
49 virtualenv
50 ];
51
52 # requires git history to work correctly
53 disabledTests = [ "default_with_excluded_data" ];
54
55 pythonImportsCheck = [ "poetry.core" ];
56
57 meta = with lib; {
58 description = "Core utilities for Poetry";
59 homepage = "https://github.com/python-poetry/poetry-core/";
60 license = licenses.mit;
61 maintainers = with maintainers; [ jonringer ];
62 };
63}