New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poetry: fix build and update from 1.0.5 -> 1.0.9 #91222
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both crashtest and keyring have removed support for python2, I would just remove it from poetry altogether. Also, we are quite outside the version range of ~1/2 the dependencies, we should have tests. This is what I came up with:
{ lib, buildPythonPackage, fetchFromGitHub, isPy27, pythonOlder
, cachecontrol
, cachy
, cleo
, clikit
, html5lib
, httpretty
, importlib-metadata
, intreehooks
, jsonschema
, keyring
, lockfile
, pexpect
, pkginfo
, pygments
, pyparsing
, pyrsistent
, pytestCheckHook
, pytestcov
, pytest-mock
, requests
, requests-toolbelt
, shellingham
, tomlkit
}:
buildPythonPackage rec {
pname = "poetry";
version = "1.0.9";
format = "pyproject";
disabled = isPy27;
src = fetchFromGitHub {
owner = "python-poetry";
repo = pname;
rev = version;
sha256 = "0gi1li55rim60hf1gdpgpx84zlkaj0wv12wbv7dib9malhfj3pnz";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "pyrsistent = \"^0.14.2\"" "pyrsistent = \"^0.16.0\"" \
--replace "requests-toolbelt = \"^0.8.0\"" "requests-toolbelt = \"^0.9.1\"" \
--replace 'importlib-metadata = {version = "~1.1.3", python = "<3.8"}' \
'importlib-metadata = {version = ">=1.3,<2", python = "<3.8"}' \
--replace "tomlkit = \"^0.5.11\"" "tomlkit = \"^0.6.0\"" \
--replace "cleo = \"^0.7.6\"" "cleo = \"^0.8.0\"" \
--replace "version = \"^20.0.1\", python = \"^3.5\"" "version = \"^21.0.0\", python = \"^3.5\"" \
--replace "clikit = \"^0.4.2\"" "clikit = \"^0.6.2\""
'';
nativeBuildInputs = [ intreehooks ];
propagatedBuildInputs = [
cachecontrol
cachy
cleo
clikit
html5lib
jsonschema
keyring
lockfile
pexpect
pkginfo
pyparsing
pyrsistent
requests
requests-toolbelt
shellingham
tomlkit
] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
postInstall = ''
mkdir -p "$out/share/bash-completion/completions"
"$out/bin/poetry" completions bash > "$out/share/bash-completion/completions/poetry"
mkdir -p "$out/share/zsh/vendor-completions"
"$out/bin/poetry" completions zsh > "$out/share/zsh/vendor-completions/_poetry"
mkdir -p "$out/share/fish/vendor_completions.d"
"$out/bin/poetry" completions fish > "$out/share/fish/vendor_completions.d/poetry.fish"
'';
checkInputs = [ pytestCheckHook httpretty pytest-mock pygments pytestcov ];
preCheck = "export HOME=$TMPDIR";
disabledTests = [
# touches network
"git"
"solver"
"load"
"vcs"
"prereleases_if_they_are_compatible"
# requires git history to work correctly
"default_with_excluded_data"
];
meta = with lib; {
homepage = "https://python-poetry.org/";
description = "Python dependency management and packaging made easy";
license = licenses.mit;
maintainers = with maintainers; [ jakewaksbaum ];
};
}
Also fix the build by adding the crashtest dependency.
Yeah, thanks for the recommendation and your work on the tests. I squashed them into the poetry commit. |
Disables Python2 support and enables tests. Co-Authored-By: Jonathan Ringer <jonringer117@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Result of nixpkgs-review pr 91222 1
13 packages built:
- cmake-language-server
- python37Packages.aria2p
- python37Packages.cleo
- python37Packages.clikit
- python37Packages.crashtest
- python37Packages.poetry
- python37Packages.xdg
- python38Packages.aria2p
- python38Packages.cleo
- python38Packages.clikit
- python38Packages.crashtest
- python38Packages.poetry
- python38Packages.xdg
Motivation for this change
Poetry failed to build.
keyring
, could also be substituted by using a patch, since it's a multiline statement in pyproject.tml, if that is what you prefer.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)@jbaum98