2020-08-11 21:00:24 +02:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder, isPy27
|
2021-10-07 06:41:13 +02:00
|
|
|
, git
|
2020-08-11 21:00:24 +02:00
|
|
|
, importlib-metadata
|
|
|
|
, intreehooks
|
|
|
|
, pathlib2
|
|
|
|
, pep517
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, tomlkit
|
2021-03-25 08:23:40 +01:00
|
|
|
, typing ? null
|
2020-08-11 21:00:24 +02:00
|
|
|
, virtualenv
|
2020-08-11 20:41:35 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "poetry-core";
|
2021-10-07 06:41:13 +02:00
|
|
|
version = "1.0.7";
|
2020-08-11 21:00:24 +02:00
|
|
|
format = "pyproject";
|
2020-08-11 20:41:35 +02:00
|
|
|
|
2020-08-11 21:00:24 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-poetry";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-10-07 06:41:13 +02:00
|
|
|
sha256 = "0v86x8f8pcbviv2cdn7jjbgj3c994qasx0bqk1kr0mj8m6pjwy9z";
|
2020-08-11 20:41:35 +02:00
|
|
|
};
|
|
|
|
|
2021-04-21 20:22:49 +02:00
|
|
|
postPatch = lib.optionalString (pythonOlder "3.8") ''
|
|
|
|
# remove >1.0.3
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'importlib-metadata = {version = "^1.7.0", python = "~2.7 || >=3.5, <3.8"}' \
|
|
|
|
'importlib-metadata = {version = ">=1.7.0", python = "~2.7 || >=3.5, <3.8"}'
|
|
|
|
'';
|
|
|
|
|
2020-08-11 21:00:24 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
intreehooks
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
] ++ lib.optionals isPy27 [
|
|
|
|
pathlib2
|
|
|
|
typing
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2021-10-07 06:41:13 +02:00
|
|
|
git
|
2020-08-11 21:00:24 +02:00
|
|
|
pep517
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
|
|
|
tomlkit
|
|
|
|
virtualenv
|
|
|
|
];
|
|
|
|
|
|
|
|
# requires git history to work correctly
|
2020-10-03 22:25:51 +02:00
|
|
|
disabledTests = [ "default_with_excluded_data" "default_src_with_excluded_data" ];
|
2020-08-11 21:00:24 +02:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "poetry.core" ];
|
|
|
|
|
2021-08-30 03:42:12 +02:00
|
|
|
# allow for package to use pep420's native namespaces
|
|
|
|
pythonNamespaces = [ "poetry" ];
|
|
|
|
|
2020-08-11 21:00:24 +02:00
|
|
|
meta = with lib; {
|
2020-08-11 20:41:35 +02:00
|
|
|
description = "Core utilities for Poetry";
|
2020-08-11 21:00:24 +02:00
|
|
|
homepage = "https://github.com/python-poetry/poetry-core/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jonringer ];
|
2020-08-11 20:41:35 +02:00
|
|
|
};
|
2020-08-11 21:00:24 +02:00
|
|
|
}
|