Merge pull request #120909 from eduardosm/bpython

bpython: fix build
This commit is contained in:
Guillaume Girol 2021-05-09 18:39:48 +00:00 committed by GitHub
commit 9be4c79278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 19 deletions

View File

@ -3,12 +3,15 @@
, fetchPypi
, curtsies
, greenlet
, mock
, jedi
, pygments
, pyxdg
, requests
, substituteAll
, urwid
, which }:
, watchdog
, which
}:
buildPythonPackage rec {
pname = "bpython";
@ -24,17 +27,22 @@ buildPythonPackage rec {
which = "${which}/bin/which";
})];
propagatedBuildInputs = [ curtsies greenlet pygments requests urwid ];
propagatedBuildInputs = [
curtsies
greenlet
pygments
pyxdg
requests
urwid
];
postInstall = ''
substituteInPlace "$out/share/applications/org.bpython-interpreter.bpython.desktop" \
--replace "Exec=/usr/bin/bpython" "Exec=$out/bin/bpython"
'';
checkInputs = [ mock ];
# tests fail: https://github.com/bpython/bpython/issues/712
doCheck = false;
checkInputs = [ jedi watchdog ];
pythonImportsCheck = [ "bpython" ];
meta = with lib; {
description = "A fancy curses interface to the Python interactive interpreter";

View File

@ -1,22 +1,14 @@
{ lib, buildPythonPackage, fetchPypi, fetchpatch, pythonOlder, blessings, mock, nose, pyte, wcwidth, typing ? null}:
{ lib, buildPythonPackage, fetchPypi, pythonOlder, blessings, mock, nose, pyte, cwcwidth, typing ? null}:
buildPythonPackage rec {
pname = "curtsies";
version = "0.3.0";
version = "0.3.5";
src = fetchPypi {
inherit pname version;
sha256 = "89c802ec051d01dec6fc983e9856a3706e4ea8265d2940b1f6d504a9e26ed3a9";
sha256 = "1g8dwafx4vx06isjkn28r3cwb0hw1bv67lgygaz34yk66lrzz1x5";
};
patches = [
# Fix dependency on typing. Remove with the next release
(fetchpatch {
url = "https://github.com/bpython/curtsies/commit/217b4f83e954837f8adc4c549c1f2f9f2bb272a7.patch";
sha256 = "1d3zwx9c7i0drb4nvydalm9mr83jrvdm75ffgisri89h337hiffs";
})
];
propagatedBuildInputs = [ blessings wcwidth ]
propagatedBuildInputs = [ blessings cwcwidth ]
++ lib.optionals (pythonOlder "3.5") [ typing ];
checkInputs = [ mock pyte nose ];

View File

@ -0,0 +1,34 @@
{ lib, buildPythonPackage, fetchPypi, cython, pytestCheckHook }:
buildPythonPackage rec {
pname = "cwcwidth";
version = "0.1.4";
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "1azrphpkcyggg38xvkfb9dpc4xmmm90p02kf8dkqd4d6j5w96aj8";
};
nativeBuildInputs = [ cython ];
checkInputs = [ pytestCheckHook ];
# Hack needed to make pytest + cython work
# https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298
preCheck = ''
export HOME=$(mktemp -d)
cp -r $TMP/$sourceRoot/tests $HOME
pushd $HOME
'';
postCheck = "popd";
pythonImportsCheck = [ "cwcwidth" ];
meta = with lib; {
description = "Python bindings for wc(s)width";
homepage = "https://github.com/sebastinas/cwcwidth";
changelog = "https://github.com/sebastinas/cwcwidth/blob/main/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ eduardosm ];
};
}

View File

@ -1631,6 +1631,8 @@ in {
cvxpy = callPackage ../development/python-modules/cvxpy { };
cwcwidth = callPackage ../development/python-modules/cwcwidth { };
cx_Freeze = callPackage ../development/python-modules/cx_freeze { };
cx_oracle = callPackage ../development/python-modules/cx_oracle { };