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