Skip to content

Commit

Permalink
Merge pull request #29009 from FRidh/python-fixes-2
Browse files Browse the repository at this point in the history
Python: several fixes (2)
(cherry picked from commit aabadda)
  • Loading branch information
FRidh committed Sep 7, 2017
1 parent 165fa89 commit c51b089
Show file tree
Hide file tree
Showing 52 changed files with 1,159 additions and 204 deletions.
1 change: 1 addition & 0 deletions lib/maintainers.nix
Expand Up @@ -576,6 +576,7 @@
tavyc = "Octavian Cerna <octavian.cerna@gmail.com>";
ltavard = "Laure Tavard <laure.tavard@univ-grenoble-alpes.fr>";
teh = "Tom Hunger <tehunger@gmail.com>";
teto = "Matthieu Coudron <mcoudron@hotmail.com>";
telotortium = "Robert Irelan <rirelan@gmail.com>";
thall = "Niclas Thall <niclas.thall@gmail.com>";
thammers = "Tobias Hammerschmidt <jawr@gmx.de>";
Expand Down
10 changes: 8 additions & 2 deletions pkgs/applications/misc/toot/default.nix
@@ -1,19 +1,25 @@
{ stdenv, fetchFromGitHub, pythonPackages }:

pythonPackages.buildPythonApplication rec {
version = "0.8.0";
version = "0.13.0";
name = "toot-${version}";

src = fetchFromGitHub {
owner = "ihabunek";
repo = "toot";
rev = "${version}";
sha256 = "1y1jz4f53njq94zab0icf7jhd4jp10ywm508l4lw6spb69wr7rdy";
sha256 = "0gbsq43qv5qg4avx7czs57k40m8lzh8f1z5yizqqc7r02p2sacnc";
};

checkInputs = with pythonPackages; [ pytest ];

propagatedBuildInputs = with pythonPackages;
[ requests beautifulsoup4 future ];

checkPhase = ''
py.test
'';

meta = with stdenv.lib; {
description = "Mastodon CLI interface";
homepage = "https://github.com/ihabunek/toot";
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/libraries/protobuf/3.3.nix
@@ -0,0 +1,6 @@
{ callPackage, lib, ... }:

lib.overrideDerivation (callPackage ./generic-v3.nix {
version = "3.3.0";
sha256 = "1258yz9flyyaswh3izv227kwnhwcxn4nwavdz9iznqmh24qmi59w";
}) (attrs: { NIX_CFLAGS_COMPILE = "-Wno-error"; })
40 changes: 40 additions & 0 deletions pkgs/development/libraries/science/math/cudnn/8.0-6.0/default.nix
@@ -0,0 +1,40 @@
{ stdenv
, requireFile
, cudatoolkit
, fetchurl
}:

stdenv.mkDerivation rec {
version = "6.0";
cudatoolkit_version = "8.0";

name = "cudatoolkit-${cudatoolkit_version}-cudnn-${version}";

src = fetchurl {
url = "http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-8.0-linux-x64-v6.0.tgz";
sha256 = "173zpgrk55ri8if7s5yngsc89ajd6hz4pss4cdxlv6lcyh5122cv";
};

installPhase = ''
function fixRunPath {
p=$(patchelf --print-rpath $1)
patchelf --set-rpath "$p:${stdenv.lib.makeLibraryPath [ stdenv.cc.cc ]}" $1
}
fixRunPath lib64/libcudnn.so
mkdir -p $out
cp -a include $out/include
cp -a lib64 $out/lib64
'';

propagatedBuildInputs = [
cudatoolkit
];

meta = with stdenv.lib; {
description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
homepage = https://developer.nvidia.com/cudnn;
license = stdenv.lib.licenses.unfree;
maintainers = with maintainers; [ jpbernardy ];
};
}
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/aioamqp/default.nix
@@ -0,0 +1,24 @@
{ lib, buildPythonPackage, fetchPypi, isPy33, pythonOlder,
asyncio
}:

buildPythonPackage rec {
pname = "aioamqp";
name = "${pname}-${version}";
version = "0.10.0";

meta = {
homepage = https://github.com/polyconseil/aioamqp;
description = "AMQP implementation using asyncio";
license = lib.licenses.bsd3;
};

src = fetchPypi {
inherit pname version;
sha256 = "0132921yy31ijb8w439zcz1gla4hiws4hx8zf6la4hjr01nsy666";
};

buildInputs = lib.optionals isPy33 [ asyncio ];

disabled = pythonOlder "3.3";
}
37 changes: 37 additions & 0 deletions pkgs/development/python-modules/asana/default.nix
@@ -0,0 +1,37 @@
{ lib, buildPythonPackage, fetchPypi,
pytest, requests, requests_oauthlib, six
}:

buildPythonPackage rec {
pname = "asana";
version = "0.6.2";
name = "${pname}-${version}";

meta = {
description = "Python client library for Asana";
homepage = https://github.com/asana/python-asana;
license = lib.licenses.mit;
};

src = fetchPypi {
inherit pname version;
sha256 = "0skai72392n3i1c4bl3hn2kh5lj990qsbasdwkbjdcy6vq57jggf";
};

buildInputs = [ pytest ];
propagatedBuildInputs = [ requests requests_oauthlib six ];

patchPhase = ''
echo > requirements.txt
sed -i "s/requests~=2.9.1/requests >=2.9.1/" setup.py
sed -i "s/requests_oauthlib~=0.6.1/requests_oauthlib >=0.6.1/" setup.py
'';

# ERROR: file not found: tests
doCheck = false;

checkPhase = ''
py.test tests
'';

}
7 changes: 3 additions & 4 deletions pkgs/development/python-modules/astropy/default.nix
Expand Up @@ -2,9 +2,7 @@
, fetchPypi
, buildPythonPackage
, numpy
, cython
, h5py
, scipy }:
, pytest }:

buildPythonPackage rec {

Expand All @@ -17,7 +15,8 @@ buildPythonPackage rec {
inherit pname version;
sha256 = "25e0881a392a2e03b4a705cf9592f01894d23f64797323b21387efa8ea9ec03e";
};
propagatedBuildInputs = [ numpy cython h5py scipy ];

propagatedBuildInputs = [ pytest numpy ]; # yes it really has pytest in install_requires


meta = {
Expand Down
33 changes: 33 additions & 0 deletions pkgs/development/python-modules/backports_weakref/default.nix
@@ -0,0 +1,33 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, setuptools_scm
# , backports
, python
}:

buildPythonPackage rec {
name = "${pname}-${version}";
pname = "backports.weakref";
version = "1.0rc1";
src = fetchPypi {
inherit pname version;
sha256 = "14i8m3lspykdfpzf50grij3z286j9q8f32f2bnwdicv659qvy4w8";
};

buildInputs = [ setuptools_scm ];
# checkInputs = [ backports ];

# Requires backports package
doCheck = false;

checkPhase = ''
${python.interpreter} -m unittest discover tests
'';

meta = with stdenv.lib; {
description = "Backports of new features in Python’s weakref module";
license = licenses.psfl;
maintainers = with maintainers; [ jpbernardy ];
};
}
45 changes: 45 additions & 0 deletions pkgs/development/python-modules/behave/default.nix
@@ -0,0 +1,45 @@
{ stdenv, fetchPypi
, buildPythonApplication, python, pythonAtLeast
, mock, nose, pyhamcrest
, glibcLocales, parse, parse-type, six
}:
buildPythonApplication rec {
pname = "behave";
version = "1.2.5";
name = "${pname}-${version}";

disabled = pythonAtLeast "3.6";

src = fetchPypi {
inherit pname version;
sha256 = "81b731ac5187e31e4aad2594944fa914943683a9818320846d037c5ebd6d5d0b";
};

checkInputs = [ mock nose pyhamcrest ];
buildInputs = [ glibcLocales ];
propagatedBuildInputs = [ parse parse-type six ];

postPatch = ''
patchShebangs bin
'';

doCheck = true;

checkPhase = ''
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
nosetests -x
${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' features/
${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' tools/test-features/
${python.interpreter} bin/behave -f progress3 --stop --tags='~@xfail' issue.features/
'';

meta = with stdenv.lib; {
homepage = https://github.com/behave/behave;
description = "behaviour-driven development, Python style";
license = licenses.bsd2;
maintainers = with maintainers; [ alunduil ];
};
}
15 changes: 11 additions & 4 deletions pkgs/development/python-modules/coveralls/default.nix
Expand Up @@ -2,12 +2,15 @@
, lib
, fetchPypi
, mock
, pytest_27
, pytest
, pytestrunner
, sh
, coverage
, docopt
, requests
, urllib3
, git
, isPy3k
}:

buildPythonPackage rec {
Expand All @@ -21,13 +24,17 @@ buildPythonPackage rec {
sha256 = "510682001517bcca1def9f6252df6ce730fcb9831c62d9fff7c7d55b6fdabdf3";
};

buildInputs = [
checkInputs = [
mock
sh
pytest_27
pytest
git
];

buildInputs = [
pytestrunner
];

# FIXME: tests requires .git directory to be present
doCheck = false;

Expand All @@ -39,7 +46,7 @@ buildPythonPackage rec {
coverage
docopt
requests
];
] ++ lib.optional (!isPy3k) urllib3;

meta = {
description = "Show coverage stats online via coveralls.io";
Expand Down
18 changes: 18 additions & 0 deletions pkgs/development/python-modules/diff-match-patch/default.nix
@@ -0,0 +1,18 @@
{ lib, buildPythonPackage, fetchPypi }:

buildPythonPackage rec {
pname = "diff-match-patch";
name = "${pname}-${version}";
version = "20121119";

meta = {
homepage = https://code.google.com/p/google-diff-match-patch/;
description = "Diff, Match and Patch libraries for Plain Text";
license = lib.licenses.asl20;
};

src = fetchPypi {
inherit pname version;
sha256 = "0k1f3v8nbidcmmrk65m7h8v41jqi37653za9fcs96y7jzc8mdflx";
};
}
23 changes: 23 additions & 0 deletions pkgs/development/python-modules/django-ipware/default.nix
@@ -0,0 +1,23 @@
{ lib, buildPythonPackage, fetchPypi, django }:

buildPythonPackage rec {
pname = "django-ipware";
name = "${pname}-${version}";
version = "1.1.6";

meta = {
description = "A Django application to retrieve user's IP address";
homepage = https://github.com/un33k/django-ipware;
license = lib.licenses.mit;
};

src = fetchPypi {
inherit pname version;
sha256 = "00zah4g2h93nbsijz556j97v9qkn9sxcia1a2wrwdwnav2fhzack";
};

propagatedBuildInputs = [ django ];

# django.core.exceptions.ImproperlyConfigured: Requested setting IPWARE_TRUSTED_PROXY_LIST, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
doCheck = false;
}
29 changes: 29 additions & 0 deletions pkgs/development/python-modules/django-jinja2/default.nix
@@ -0,0 +1,29 @@
{ lib, buildPythonPackage, fetchPypi,
django, jinja2, pytz, tox
}:

buildPythonPackage rec {
pname = "django-jinja";
name = "${pname}-${version}";
version = "2.2.2";

meta = {
description = "Simple and nonobstructive jinja2 integration with Django";
homepage = https://github.com/niwinz/django-jinja;
license = lib.licenses.bsd3;
};

src = fetchPypi {
inherit pname version;
sha256 = "099b99iprkvlsndrjmw4v3i3i60i9gm1aq5r88z15r7vgmv6sigj";
};

buildInputs = [ django pytz tox ];
propagatedBuildInputs = [ django jinja2 ];

# python installed: The directory '/homeless-shelter/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.,appdirs==1.4.3,Django==1.11.1,django-jinja==2.2.2,Jinja2==2.9.6,MarkupSafe==1.0,packaging==16.8,pyparsing==2.2.0,pytz==2017.2,six==1.10.0
doCheck = false;
checkPhase = ''
tox
'';
}
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/django-pglocks/default.nix
@@ -0,0 +1,24 @@
{ lib, buildPythonPackage, fetchPypi, django }:

buildPythonPackage rec {
pname = "django-pglocks";
name = "${pname}-${version}";
version = "1.0.2";

meta = {
description = "PostgreSQL locking context managers and functions for Django.";
homepage = https://github.com/Xof/django-pglocks;
license = lib.licenses.mit;
};

src = fetchPypi {
inherit pname version;
sha256 = "1ks4k0bk4457wfl3xgzr4v7xb0lxmnkhxwhlp0bbnmzipdafw1cl";
};

buildInputs = [ django ];
propagatedBuildInputs = [ django ];

# tests need a postgres database
doCheck = false;
}

0 comments on commit c51b089

Please sign in to comment.