Merge branch 'master' into staging

This commit is contained in:
Vladimír Čunát
2019-09-02 23:25:24 +02:00
277 changed files with 4766 additions and 1895 deletions

View File

@@ -1,74 +1,55 @@
{ lib
, buildPythonPackage
{ buildPythonPackage
, fetchPypi
, isPyPy
, mock
, pytest
, flask
, jinja2
, markupsafe
, werkzeug
, itsdangerous
, dateutil
, requests
, six
, pygments
, pystache
, markdown
, pyyaml
, pyzmq
, tornado
, colorama
, isPy3k
, futures
, websocket_client
, isPy3k
, isPyPy
, jinja2
, lib
, mock
, numpy
, pandas
, greenlet
, python
, bkcharts
, nodejs
, pillow
, pytest
, python
, python-dateutil
, pyyaml
, selenium
, six
, substituteAll
, tornado
}:
buildPythonPackage rec {
pname = "bokeh";
version = "1.0.4";
version = "1.3.4";
src = fetchPypi {
inherit pname version;
sha256 = "ceeb6a75afc1b2de00c2b8b6da121dec3fb77031326897b80d4375a70e96aebf";
sha256 = "0m27j29jpi977y95k272xc24qkl5bkniy046cil116hrbgnppng2";
};
disabled = isPyPy;
patches = [
(substituteAll {
src = ./hardcode-nodejs-npmjs-paths.patch;
node_bin = "${nodejs}/bin/node";
npm_bin = "${nodejs}/bin/npm";
})
];
# Some test that uses tornado fails
# doCheck = false;
disabled = isPyPy;
checkInputs = [ mock pytest pillow selenium ];
propagatedBuildInputs = [
pillow
flask
jinja2
markupsafe
werkzeug
itsdangerous
dateutil
requests
python-dateutil
six
pygments
pystache
markdown
pyyaml
pyzmq
tornado
colorama
bkcharts
numpy
]
++ lib.optionals ( !isPy3k ) [ futures ]
++ lib.optionals ( !isPy3k && !isPyPy ) [ websocket_client ]
++ lib.optionals ( !isPyPy ) [ numpy pandas greenlet ];
++ lib.optionals ( !isPy3k ) [ futures ];
checkPhase = ''
${python.interpreter} -m unittest discover -s bokeh/tests

View File

@@ -0,0 +1,15 @@
diff --git a/bokeh/util/compiler.py b/bokeh/util/compiler.py
index a752aad7d..8af05ff63 100644
--- a/bokeh/util/compiler.py
+++ b/bokeh/util/compiler.py
@@ -442,8 +442,8 @@ def _detect_nodejs():
raise RuntimeError('node.js v%s or higher is needed to allow compilation of custom models ' % version +
'("conda install nodejs" or follow https://nodejs.org/en/download/)')
-_nodejs = None
-_npmjs = None
+_nodejs = "@node_bin@"
+_npmjs = "@npm_bin@"
def _nodejs_path():
global _nodejs

View File

@@ -2,12 +2,12 @@
, itsdangerous, click, werkzeug, jinja2, pytest }:
buildPythonPackage rec {
version = "1.0.3";
version = "1.0.4";
pname = "Flask";
src = fetchPypi {
inherit pname version;
sha256 = "ad7c6d841e64296b962296c2c2dabc6543752985727af86a975072dea984b6f3";
sha256 = "ed1330220a321138de53ec7c534c3d90cf2f7af938c7880fc3da13aa46bf870f";
};
checkInputs = [ pytest ];

View File

@@ -0,0 +1,45 @@
{ lib
, buildPythonPackage
, python
, fetchFromGitHub
, sdcc
, libusb1
, crcmod
}:
buildPythonPackage {
pname = "fx2";
version = "unstable-2019-08-27";
src = fetchFromGitHub {
owner = "whitequark";
repo = "libfx2";
rev = "dd1e42c7b46ff410dbb18beab46111bb5491400c";
sha256 = "0xvlmx6ym0ylrvnlqzf18d475wa0mfci7wkdbv30gl3hgdhsppjz";
};
nativeBuildInputs = [ sdcc ];
propagatedBuildInputs = [ libusb1 crcmod ];
preBuild = ''
cd software
${python.pythonForBuild.interpreter} setup.py build_ext
'';
preInstall = ''
mkdir -p $out/share/libfx2
cp -R ../firmware/library/{.stamp,lib,include,fx2{rules,conf}.mk} \
$out/share/libfx2
'';
# installCheckPhase tries to run build_ext again and there are no tests
doCheck = false;
meta = with lib; {
description = "Chip support package for Cypress EZ-USB FX2 series microcontrollers";
homepage = https://github.com/whitequark/libfx2;
license = licenses.bsd0;
maintainers = with maintainers; [ emily ];
};
}

View File

@@ -0,0 +1,66 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, sdcc
, nmigen
, fx2
, libusb1
, aiohttp
, pyvcd
, bitarray
, crcmod
, yosys
, icestorm
, nextpnr
}:
buildPythonPackage rec {
pname = "glasgow";
version = "unstable-2019-08-31";
realVersion = lib.substring 0 7 src.rev;
src = fetchFromGitHub {
owner = "GlasgowEmbedded";
repo = "Glasgow";
rev = "21641a13c6a0daaf8618aff3c5bfffcb26ef6cca";
sha256 = "1dpm1jmm4fg8xf17s6h9g5sc09gq8b6xq955sv2x11nrbqf98l4v";
};
nativeBuildInputs = [ sdcc ];
propagatedBuildInputs = [
nmigen
fx2
libusb1
aiohttp
pyvcd
bitarray
crcmod
];
postPatch = ''
substituteInPlace software/setup.py \
--replace 'versioneer.get_version()' '"${realVersion}"'
'';
preBuild = ''
make -C firmware LIBFX2=${fx2}/share/libfx2
cp firmware/glasgow.ihex software/glasgow
cd software
'';
# a couple failing tests and also installCheck tries to build_ext again
doInstallCheck = false;
doCheck = false;
checkPhase = ''
python -m unittest discover
'';
meta = with lib; {
description = "Software for Glasgow, a digital interface multitool";
homepage = https://github.com/GlasgowEmbedded/Glasgow;
license = licenses.bsd0;
maintainers = with maintainers; [ emily ];
};
}

View File

@@ -4,28 +4,31 @@
, appdirs
, dask
, holoviews
, hvplot
, jinja2
, msgpack-numpy
, msgpack-python
, numpy
, pandas
, panel
, python-snappy
, requests
, ruamel_yaml
, six
, tornado
, pytest
, isPy27
, pythonOlder
}:
buildPythonPackage rec {
pname = "intake";
version = "0.4.4";
disabled = isPy27;
version = "0.5.3";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
sha256 = "3fc1b7c2949c9b4200ecbbfdff17da126981a1d8d95ccb7b7bcca3e3dd849d5e";
sha256 = "1mbjr4xl4i523bg8k08s5986v2289fznd8cr3j3czn5adi8519j7";
};
checkInputs = [ pytest ];
@@ -33,11 +36,13 @@ buildPythonPackage rec {
appdirs
dask
holoviews
hvplot
jinja2
msgpack-numpy
msgpack-python
numpy
pandas
panel
python-snappy
requests
ruamel_yaml
@@ -45,10 +50,15 @@ buildPythonPackage rec {
tornado
];
postPatch = ''
# Is in setup_requires but not used in setup.py...
substituteInPlace setup.py --replace "'pytest-runner'" ""
'';
# test_discover requires driver_with_entrypoints-0.1.dist-info, which is not included in tarball
# test_filtered_compressed_cache requires calvert_uk_filter.tar.gz, which is not included in tarball
checkPhase = ''
# test_filtered_compressed_cache requires calvert_uk_filter.tar.gz, which is not included in tarball
# test_which assumes python for executable name
PATH=$out/bin:$PATH HOME=$(mktemp -d) pytest -k "not test_filtered_compressed_cache and not test_which"
PATH=$out/bin:$PATH HOME=$(mktemp -d) pytest -k "not test_discover and not test_filtered_compressed_cache"
'';
meta = with lib; {

View File

@@ -0,0 +1,32 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, nmigen
}:
buildPythonPackage rec {
pname = "nmigen-boards";
version = "unstable-2019-08-30";
realVersion = lib.substring 0 7 src.rev;
src = fetchFromGitHub {
owner = "m-labs";
repo = "nmigen-boards";
rev = "3b80b3a3749ae8f123ff258a25e81bd21412aed4";
sha256 = "01qynxip8bq23jfjc5wjd97vxfvhld2zb8sxphwf0zixrmmyaspi";
};
propagatedBuildInputs = [ nmigen ];
postPatch = ''
substituteInPlace setup.py \
--replace 'versioneer.get_version()' '"${realVersion}"'
'';
meta = with lib; {
description = "Board and connector definitions for nMigen";
homepage = https://github.com/m-labs/nmigen-boards;
license = licenses.bsd0;
maintainers = with maintainers; [ emily ];
};
}

View File

@@ -0,0 +1,65 @@
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, pyvcd
, bitarray
, jinja2
# nmigen.{test,build} call out to these
, yosys
, symbiyosys
, nextpnr ? null
, icestorm ? null
, trellis ? null
# for tests
, yices
}:
buildPythonPackage rec {
pname = "nmigen";
version = "unstable-2019-08-31";
realVersion = lib.substring 0 7 src.rev;
src = fetchFromGitHub {
owner = "m-labs";
repo = "nmigen";
rev = "2e206220462c67aa6ae97f7515a2191440fd61b3";
sha256 = "0y3w6vd493jqm9b8ppgwzs02v1al8w1n5gylljlsw70ci7fyk4qa";
};
disabled = pythonOlder "3.6";
propagatedBuildInputs = [ pyvcd bitarray jinja2 ];
checkInputs = [ yosys yices ];
postPatch = let
tool = pkg: name:
if pkg == null then {} else { "${name}" = "${pkg}/bin/${name}"; };
# Only FOSS toolchain supported out of the box, sorry!
toolchainOverrides =
tool yosys "yosys" //
tool symbiyosys "sby" //
tool nextpnr "nextpnr-ice40" //
tool nextpnr "nextpnr-ecp5" //
tool icestorm "icepack" //
tool trellis "ecppack";
in ''
substituteInPlace setup.py \
--replace 'versioneer.get_version()' '"${realVersion}"'
substituteInPlace nmigen/_toolchain.py \
--replace 'overrides = {}' \
'overrides = ${builtins.toJSON toolchainOverrides}'
'';
meta = with lib; {
description = "A refreshed Python toolbox for building complex digital hardware";
homepage = https://github.com/m-labs/nmigen;
license = licenses.bsd0;
maintainers = with maintainers; [ emily ];
};
}

View File

@@ -11,18 +11,13 @@
buildPythonPackage rec {
pname = "panel";
version = "0.4.0";
version = "0.6.2";
src = fetchPypi {
inherit pname version;
sha256 = "21fc6729909dba4ba8c9a84b7fadd293322cc2594d15ac73b0f66a5ceffd1f98";
sha256 = "04w8jjlf7yz3k84xnacahczc9mmddqyp756rj3n8hclks9c1ww40";
};
postPatch = ''
substituteInPlace setup.py \
--replace "testpath<0.4" "testpath"
'';
propagatedBuildInputs = [
bokeh
param

View File

@@ -7,11 +7,11 @@
buildPythonPackage rec {
pname = "param";
version = "1.8.2";
version = "1.9.1";
src = fetchPypi {
inherit pname version;
sha256 = "49927979d4f6c994bcd8f6f7f2b34e3a0a7f0d62404dca6bcae5acde0192bb01";
sha256 = "1dbnviszdq3d2k3dfwpimb0adf27yzwm4iyv42rk8xvd8c6p9gdi";
};
checkInputs = [ flake8 nose ];

View File

@@ -2,11 +2,11 @@
buildPythonPackage rec {
pname = "phonenumbers";
version = "8.10.16";
version = "8.10.17";
src = fetchPypi {
inherit pname version;
sha256 = "1cfkyz991nbqsak3mdwybaxvzqbdcqivxnl84n8p4dyi5lk45v4b";
sha256 = "023rcv3qishd5n33gj22dzgq51kzpk41ckcmim96s1xvdbd2sxg9";
};
meta = {

View File

@@ -22,12 +22,12 @@
buildPythonPackage rec {
pname = "pikepdf";
version = "1.1.0";
version = "1.6.2";
disabled = ! isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "14b36r6h3088z2sxp2pqvm171js53hz53mwm1g52iadignjnp0my";
sha256 = "1x1b55znr0j4fib69l2h0xq0qmbf2nbxwbwd4f7y8r4sqi20239z";
};
buildInputs = [
@@ -55,8 +55,11 @@ buildPythonPackage rec {
propagatedBuildInputs = [ defusedxml lxml ];
postPatch = ''
substituteInPlace requirements/test.txt \
--replace "pytest >= 3.6.0, < 4.1.0" "pytest >= 4.2.1, < 5"
sed -i \
-e 's/^pytest .*/pytest/g' \
-e 's/^attrs .*/attrs/g' \
-e 's/^hypothesis .*/hypothesis/g' \
requirements/test.txt
'';
preBuild = ''
@@ -70,4 +73,3 @@ buildPythonPackage rec {
maintainers = [ maintainers.kiwi ];
};
}

View File

@@ -2,11 +2,11 @@
buildPythonPackage rec {
pname = "pybind11";
version = "2.2.4";
version = "2.3.0";
src = fetchPypi {
inherit pname version;
sha256 = "1kz1z2cg3q901q9spkdhksmcfiskaghzmbb9ivr5mva856yvnak4";
sha256 = "0923ngd2cvck3lhl7584y08n36pm6zqihfm1s69sbdc11xg936hr";
};
patches = [

View File

@@ -0,0 +1,27 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder
, pytest
}:
buildPythonPackage rec {
version = "1.0.4";
pname = "pytest-random-order";
src = fetchPypi {
inherit pname version;
sha256 = "6b2159342a4c8c10855bc4fc6d65ee890fc614cb2b4ff688979b008a82a0ff52";
};
disabled = pythonOlder "3.5";
propagatedBuildInputs = [ pytest ];
meta = with stdenv.lib; {
homepage = "https://github.com/jbasko/pytest-random-order";
description = "Randomise the order of tests with some control over the randomness";
license = licenses.mit;
maintainers = [ maintainers.prusnak ];
};
}

View File

@@ -58,8 +58,23 @@ let
variant = if cudaSupport then "-gpu" else "";
pname = "tensorflow${variant}";
# TODO: remove after there's support for setupPyDistFlags
setuppy = ../../../development/interpreters/python/run_setup.py;
pythonEnv = python.withPackages (_:
[ # python deps needed during wheel build time
numpy
keras-preprocessing
protobuf
wrapt
gast
astor
absl-py
termcolor
keras-applications
setuptools
wheel
] ++ lib.optionals (!isPy3k)
[ future
mock
]);
bazel-build = buildBazelPackage {
name = "${pname}-${version}";
@@ -96,27 +111,15 @@ let
# https://gitweb.gentoo.org/repo/gentoo.git/tree/sci-libs/tensorflow
nativeBuildInputs = [
swig which cython
swig which pythonEnv
];
buildInputs = [
python
jemalloc
openmpi
glibcLocales
git
# python deps needed during wheel build time
numpy
keras-preprocessing
protobuf
wrapt
gast
astor
absl-py
termcolor
keras-applications
# libs taken from system through the TF_SYS_LIBS mechanism
# grpc
sqlite
@@ -133,20 +136,12 @@ let
giflib
re2
pkgs.lmdb
# for building the wheel
setuptools
wheel
] ++ lib.optionals (!isPy3k) [
future
mock
] ++ lib.optionals cudaSupport [
cudatoolkit
cudnn
nvidia_x11
];
# arbitrarily set to the current latest bazel version, overly careful
TF_IGNORE_MAX_BAZEL_VERSION = true;
@@ -194,8 +189,8 @@ let
INCLUDEDIR = "${includes_joined}/include";
PYTHON_BIN_PATH = python.interpreter;
PYTHON_BIN_PATH = pythonEnv.interpreter;
TF_NEED_GCP = true;
TF_NEED_HDFS = true;
TF_ENABLE_XLA = tfFeature xlaSupport;
@@ -237,6 +232,9 @@ let
export PYTHON_LIB_PATH="$NIX_BUILD_TOP/site-packages"
export CC_OPT_FLAGS="${lib.concatStringsSep " " opt_flags}"
mkdir -p "$PYTHON_LIB_PATH"
# To avoid mixing Python 2 and Python 3
unset PYTHONPATH
'';
configurePhase = ''
@@ -313,13 +311,7 @@ in buildPythonPackage {
rm $out/bin/tensorboard
'';
# TODO: remove after there's support for setupPyDistFlags
buildPhase = ''
runHook preBuild
cp ${setuppy} nix_run_setup
${python.interpreter} nix_run_setup --project_name ${pname} bdist_wheel
runHook postBuild
'';
setupPyGlobalFlags = [ "--project_name ${pname}" ];
# tensorflow/tools/pip_package/setup.py
propagatedBuildInputs = [

View File

@@ -26,9 +26,6 @@ buildPythonPackage rec {
propagatedBuildInputs = [ typing-extensions protobuf hidapi ecdsa mnemonic requests pyblake2 click construct libusb1 rlp shamir-mnemonic ];
# build requires UTF-8 locale
LANG = "en_US.UTF-8";
checkInputs = [
pytest
];
@@ -36,7 +33,7 @@ buildPythonPackage rec {
# disable test_tx_api.py as it requires being online
checkPhase = ''
runHook preCheck
${python.interpreter} -m pytest --pyarg trezorlib.tests.unit_tests --ignore trezorlib/tests/unit_tests/test_tx_api.py
${python.interpreter} -m pytest --pyargs trezorlib.tests.unit_tests --ignore trezorlib/tests/unit_tests/test_tx_api.py
runHook postCheck
'';

View File

@@ -1,23 +1,33 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pyopenssl
, libuv
, psutil
, isPy27
, CoreServices
, ApplicationServices
}:
buildPythonPackage rec {
pname = "uvloop";
version = "0.12.2";
version = "0.13.0";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "c48692bf4587ce281d641087658eca275a5ad3b63c78297bbded96570ae9ce8f";
sha256 = "0blcnrd5vky2k1m1p1skx4516dr1jx76yyb0c6fi82si6mqd0b4l";
};
buildInputs = [ libuv ];
buildInputs = [
libuv
] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
postPatch = ''
# Removing code linting tests, which we don't care about
rm tests/test_sourcecode.py
'';
checkInputs = [ pyopenssl psutil ];