1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7 build,
8 git,
9 pytest-cov-stub,
10 pytest-mock,
11 pytestCheckHook,
12 setuptools,
13 tomli-w,
14 trove-classifiers,
15 virtualenv,
16}:
17
18buildPythonPackage rec {
19 pname = "poetry-core";
20 version = "2.1.2";
21 pyproject = true;
22
23 disabled = pythonOlder "3.9";
24
25 src = fetchFromGitHub {
26 owner = "python-poetry";
27 repo = "poetry-core";
28 tag = version;
29 hash = "sha256-fNj/LI4A4RjjPzYT+0ekwqmm3qzzZL3aACOe8BHviuk=";
30 };
31
32 nativeCheckInputs = [
33 build
34 git
35 pytest-mock
36 pytest-cov-stub
37 pytestCheckHook
38 setuptools
39 tomli-w
40 trove-classifiers
41 virtualenv
42 ];
43
44 disabledTests = [
45 # Requires git history to work correctly
46 "default_with_excluded_data"
47 "default_src_with_excluded_data"
48 "test_package_with_include"
49 # Distribution timestamp mismatches, as we operate on 1980-01-02
50 "test_sdist_mtime_zero"
51 "test_sdist_members_mtime_default"
52 "test_dist_info_date_time_default_value"
53 ];
54
55 pythonImportsCheck = [ "poetry.core" ];
56
57 # Allow for packages to use PEP420's native namespace
58 pythonNamespaces = [ "poetry" ];
59
60 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-int-conversion";
61
62 meta = with lib; {
63 changelog = "https://github.com/python-poetry/poetry-core/blob/${src.tag}/CHANGELOG.md";
64 description = "Poetry PEP 517 Build Backend";
65 homepage = "https://github.com/python-poetry/poetry-core/";
66 license = licenses.mit;
67 teams = [ teams.python ];
68 };
69}