Merge branch 'master' into staging

This commit is contained in:
Vladimír Čunát
2017-02-16 19:02:37 +01:00
85 changed files with 2899 additions and 1057 deletions

View File

@@ -0,0 +1,19 @@
{ stdenv, fetchPypi, buildPythonPackage }:
buildPythonPackage rec {
pname = "aenum";
version = "1.4.7";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "1bvn2k53nz99fiwql5fkl0fh7xjw8ama9qzdjp36609mpk05ikl8";
};
meta = {
description = "Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants";
maintainer = with stdenv.lib.maintainers; [ vrthra ];
license = with stdenv.lib.licenses; [ bsd3 ];
homepage = https://bitbucket.org/stoneleaf/aenum;
};
}

View File

@@ -0,0 +1,43 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, pytest
, pytestcov
, pytestpep8
, pytest_xdist
, six
, Theano
, pyyaml
}:
buildPythonPackage rec {
pname = "Keras";
version = "1.2.2";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "0bby93sffjadrxnx9j9nn2lq0ygsgqjp16260c6lz77b6r1qrcfj";
};
checkInputs = [
pytest
pytestcov
pytestpep8
pytest_xdist
];
propagatedBuildInputs = [
six Theano pyyaml
];
# Couldn't get tests working
doCheck = false;
meta = with stdenv.lib; {
description = "Deep Learning library for Theano and TensorFlow";
homepage = "https://keras.io";
license = licenses.mit;
maintainers = with maintainers; [ NikolaMandic ];
};
}

View File

@@ -0,0 +1,22 @@
{ stdenv, fetchPypi, buildPythonPackage, six }:
buildPythonPackage rec {
pname = "leather";
version = "0.3.3";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "125r372q7bwcajfdysp7w5zh5wccwxf1mkhqawl8h518nl1icv87";
};
propagatedBuildInputs = [ six ];
meta = with stdenv.lib; {
homepage = "http://leather.rtfd.io";
description = "Python charting library";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ vrthra ];
};
}

View File

@@ -0,0 +1,38 @@
{ buildPythonPackage, fetchurl, glibcLocales, mock, pytest, botocore,
testfixtures, pillow, six, twisted, w3lib, lxml, queuelib, pyopenssl,
service-identity, parsel, pydispatcher, cssselect, lib }:
buildPythonPackage rec {
name = "Scrapy-${version}";
version = "1.3.1";
buildInputs = [ glibcLocales mock pytest botocore testfixtures pillow ];
propagatedBuildInputs = [
six twisted w3lib lxml cssselect queuelib pyopenssl service-identity parsel pydispatcher
];
# Scrapy is usually installed via pip where copying all
# permissions makes sense. In Nix the files copied are owned by
# root and readonly. As a consequence scrapy can't edit the
# project templates.
patches = [ ./permissions-fix.patch ];
LC_ALL="en_US.UTF-8";
checkPhase = ''
py.test --ignore=tests/test_linkextractors_deprecated.py --ignore=tests/test_proxy_connect.py
# The ignored tests require mitmproxy, which depends on protobuf, but it's disabled on Python3
'';
src = fetchurl {
url = "mirror://pypi/S/Scrapy/${name}.tar.gz";
sha256 = "0s5qkxwfq842maxjd2j82ldp4dyb70kla3z5rr56z0p7ig53cbvk";
};
meta = with lib; {
description = "A fast high-level web crawling and web scraping framework, used to crawl websites and extract structured data from their pages";
homepage = "http://scrapy.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ drewkett ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,28 @@
diff --git a/scrapy/commands/startproject.py b/scrapy/commands/startproject.py
index 5941066..89f8edb 100644
--- a/scrapy/commands/startproject.py
+++ b/scrapy/commands/startproject.py
@@ -4,7 +4,7 @@ import os
import string
from importlib import import_module
from os.path import join, exists, abspath
-from shutil import ignore_patterns, move, copy2, copystat
+from shutil import ignore_patterns, move, copyfile, copystat
import scrapy
from scrapy.commands import ScrapyCommand
@@ -76,8 +76,7 @@ class Command(ScrapyCommand):
if os.path.isdir(srcname):
self._copytree(srcname, dstname)
else:
- copy2(srcname, dstname)
- copystat(src, dst)
+ copyfile(srcname, dstname)
def run(self, args, opts):
if len(args) not in (1, 2):
@@ -118,4 +117,3 @@ class Command(ScrapyCommand):
_templates_base_dir = self.settings['TEMPLATES_DIR'] or \
join(scrapy.__path__[0], 'templates')
return join(_templates_base_dir, 'project')
-

View File

@@ -0,0 +1,52 @@
{ stdenv
, fetchurl
, buildPythonPackage
, swig
, numpy
, six
, protobuf3_0
, cudatoolkit75
, cudnn5_cudatoolkit75
, gcc49
, zlib
, linuxPackages
, mock
}:
buildPythonPackage rec {
pname = "tensorflow";
version = "0.11.0rc0";
name = "${pname}-${version}";
format = "wheel";
src = fetchurl {
url = "https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-${version}-cp27-none-linux_x86_64.whl";
sha256 = "1r8zlz95sw7bnjzg5zdbpa9dj8wmp8cvvgyl9sv3amsscagnnfj5";
};
buildInputs = [ swig ];
propagatedBuildInputs = [ numpy six protobuf3_0 cudatoolkit75 cudnn5_cudatoolkit75 gcc49 mock ];
# Note that we need to run *after* the fixup phase because the
# libraries are loaded at runtime. If we run in preFixup then
# patchelf --shrink-rpath will remove the cuda libraries.
postFixup = let
rpath = stdenv.lib.makeLibraryPath [
gcc49.cc.lib
zlib cudatoolkit75
cudnn5_cudatoolkit75
linuxPackages.nvidia_x11
];
in ''
find $out -name '*.so' -exec patchelf --set-rpath "${rpath}" {} \;
'';
doCheck = false;
meta = with stdenv.lib; {
description = "TensorFlow helps the tensors flow (no gpu support)";
homepage = http://tensorflow.org;
license = licenses.asl20;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,48 @@
{ stdenv
, fetchurl
, buildPythonPackage
, numpy
, six
, protobuf3_0_0b2
, swig
, mock
, gcc
, zlib
}:
# tensorflow is built from a downloaded wheel, because the upstream
# project's build system is an arcane beast based on
# bazel. Untangling it and building the wheel from source is an open
# problem.
buildPythonPackage rec {
pname = "tensorflow";
version = "0.10.0";
name = "${pname}-${version}";
format = "wheel";
src = fetchurl {
url = if stdenv.isDarwin then
"https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-${version}-py2-none-any.whl" else
"https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-${version}-cp27-none-linux_x86_64.whl";
sha256 = if stdenv.isDarwin then
"1gjybh3j3rn34bzhsxsfdbqgsr4jh50qyx2wqywvcb24fkvy40j9" else
"0g05pa4z6kdy0giz7hjgjgwf4zzr5l8cf1zh247ymixlikn3fnpx";
};
propagatedBuildInputs = [ numpy six protobuf3_0_0b2 swig mock];
preFixup = ''
RPATH="${stdenv.lib.makeLibraryPath [ gcc.cc.lib zlib ]}"
find $out -name '*.so' -exec patchelf --set-rpath "$RPATH" {} \;
'';
doCheck = false;
meta = with stdenv.lib; {
description = "TensorFlow helps the tensors flow (no gpu support)";
homepage = http://tensorflow.org;
license = licenses.asl20;
platforms = with platforms; linux ++ darwin;
};
}