Merge branch 'master' of github.com:NixOS/nixpkgs into staging-next

This commit is contained in:
Jonathan Ringer
2019-12-30 10:14:18 -08:00
45 changed files with 806 additions and 180 deletions

View File

@@ -1,20 +1,42 @@
{ lib, buildPythonPackage, fetchPypi, pythonOlder,
{ lib
, buildPythonPackage
, fetchFromGitHub
, pamqp
, pytest
, asynctest
, pyrabbit2
, isPy27
}:
buildPythonPackage rec {
pname = "aioamqp";
version = "0.14.0";
disabled = isPy27;
meta = {
src = fetchFromGitHub {
owner = "Polyconseil";
repo = pname;
rev = "${pname}-${version}";
sha256 = "1gpfsrc2vi6w33c9zsycd2qn589pr7a222rb41r85m915283zy48";
};
propagatedBuildInputs = [
pamqp
];
checkInputs = [
pytest
asynctest
pyrabbit2
];
# tests assume rabbitmq server running
doCheck = false;
meta = with lib; {
homepage = https://github.com/polyconseil/aioamqp;
description = "AMQP implementation using asyncio";
license = lib.licenses.bsd3;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
src = fetchPypi {
inherit pname version;
sha256 = "eef5c23a7fedee079d8326406f5c7a5725dfe36c359373da3499fffa16f79915";
};
disabled = pythonOlder "3.3";
}

View File

@@ -0,0 +1,48 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestrunner
, pytest
, pytest-asyncio
, contextvars
, sqlalchemy
, isPy27
, pythonOlder
}:
buildPythonPackage rec {
pname = "aiocontextvars";
version = "0.2.2";
disabled = isPy27;
src = fetchFromGitHub {
owner = "fantix";
repo = pname;
rev = "v${version}";
sha256 = "0a2gmrm9csiknc8n3si67sgzffkydplh9d7ga1k87ygk2aj22mmk";
};
buildInputs = [
pytestrunner
];
checkInputs = [
pytest
pytest-asyncio
];
propagatedBuildInputs = [
sqlalchemy
] ++ lib.optionals (pythonOlder "3.7") [ contextvars ];
checkPhase = ''
pytest
'';
meta = with lib; {
description = "Asyncio support for PEP-567 contextvars backport";
homepage = https://github.com/fantix/aiocontextvars;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -0,0 +1,47 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pymysql
, pytest
, isPy27
}:
buildPythonPackage rec {
pname = "aiomysql";
version = "0.0.20";
disabled = isPy27;
src = fetchFromGitHub {
owner = "aio-libs";
repo = pname;
rev = "v${version}";
sha256 = "1mxih81zc2k64briirpp5wz4f72l8v05avfyfibaq9fr6lcbih9b";
};
propagatedBuildInputs = [
pymysql
];
checkInputs = [
pytest
];
postPatch = ''
substituteInPlace setup.py \
--replace "PyMySQL>=0.9,<=0.9.2" "PyMySQL"
'';
checkPhase = ''
pytest
'';
# tests require mysql database
doCheck = false;
meta = with lib; {
description = "MySQL driver for asyncio";
homepage = https://github.com/aio-libs/aiomysql;
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -0,0 +1,36 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools
, aiounittest
, isPy27
, pytest
}:
buildPythonPackage rec {
pname = "aiosqlite";
version = "0.11.0";
disabled = isPy27;
src = fetchFromGitHub {
owner = "jreese";
repo = pname;
rev = "v${version}";
sha256 = "0pmkp4iy738yv2sl08kvhd0ma6wjqbmfnwid72gvg4zqsr1hnn0z";
};
buildInputs = [
setuptools
];
checkInputs = [
aiounittest
];
meta = with lib; {
description = "Asyncio bridge to the standard sqlite3 module";
homepage = https://github.com/jreese/aiosqlite;
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -0,0 +1,36 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, nose
, coverage
, isPy27
}:
buildPythonPackage rec {
pname = "aiounittest";
version = "1.3.1";
disabled = isPy27;
src = fetchFromGitHub {
owner = "kwarunek";
repo = pname;
rev = version;
sha256 = "0mlic2q49cb0vv62mixy4i4x8c91qb6jlji7khiamcxcg676nasl";
};
checkInputs = [
nose
coverage
];
checkPhase = ''
nosetests
'';
meta = with lib; {
description = "Test asyncio code more easily";
homepage = https://github.com/kwarunek/aiounittest;
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -0,0 +1,49 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, sqlalchemy
, aiocontextvars
, isPy27
, pytest
, asyncpg
, aiomysql
, aiosqlite
}:
buildPythonPackage rec {
pname = "databases";
version = "0.2.6";
disabled = isPy27;
src = fetchFromGitHub {
owner = "encode";
repo = pname;
rev = version;
sha256 = "0cdb4vln4zdmqbbcj7711b81b2l64jg1miihqcg8gpi35v404h2q";
};
propagatedBuildInputs = [
sqlalchemy
aiocontextvars
];
checkInputs = [
pytest
asyncpg
aiomysql
aiosqlite
];
# big chunk to tests depend on existing posgresql and mysql databases
# some tests are better than no tests
checkPhase = ''
pytest --ignore=tests/test_integration.py --ignore=tests/test_databases.py
'';
meta = with lib; {
description = "Async database support for Python";
homepage = https://github.com/encode/databases;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -1,22 +1,36 @@
{ lib
, buildPythonPackage
, fetchPypi
, tox
, fetchFromGitHub
, pytest
, pytestcov
, pytest_xdist
, pytest-django
, mock
}:
buildPythonPackage rec {
pname = "diskcache";
version = "4.1.0";
src = fetchPypi {
inherit pname version;
sha256 = "bcee5a59f9c264e2809e58d01be6569a3bbb1e36a1e0fb83f7ef9b2075f95ce0";
src = fetchFromGitHub {
owner = "grantjenks";
repo = "python-diskcache";
rev = "v${version}";
sha256 = "0xy2vpk4hixb4gg871d9sx9wxdz8pi0pmnfdwg4bf8jqfjg022w8";
};
checkInputs = [
tox
pytest
pytestcov
pytest_xdist
pytest-django
mock
];
checkPhase = ''
pytest
'';
meta = with lib; {
description = "Disk and file backed persistent cache";
homepage = "http://www.grantjenks.com/docs/diskcache/";

View File

@@ -1,22 +1,28 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, uvicorn
, starlette
, pydantic
, python
, isPy3k
, which
, pytest
, pytestcov
, pyjwt
, passlib
, aiosqlite
}:
buildPythonPackage rec {
pname = "fastapi";
version = "0.45.0";
format = "flit";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "44712863ca3899eb812a6869a2efe02d6be6ae972968c76a43d82ec472788f17";
src = fetchFromGitHub {
owner = "tiangolo";
repo = "fastapi";
rev = version;
sha256 = "1qwh382ny6qa3zi64micdq4j7dc64zv4rfd8g91j0digd4rhs6i1";
};
propagatedBuildInputs = [
@@ -25,10 +31,24 @@ buildPythonPackage rec {
pydantic
];
patches = [ ./setup.py.patch ];
checkInputs = [
pytest
pytestcov
pyjwt
passlib
aiosqlite
];
# starlette pinning kept in place due to 0.12.9 being a hard
# dependency luckily fastapi is currently the only dependent on
# starlette. Please remove pinning when possible
postPatch = ''
substituteInPlace pyproject.toml \
--replace "pydantic >=0.32.2,<=0.32.2" "pydantic"
'';
checkPhase = ''
${python.interpreter} -c "from fastapi import FastAPI; app = FastAPI()"
pytest --ignore=tests/test_default_response_class.py
'';
meta = with lib; {

View File

@@ -1,13 +0,0 @@
diff --git a/setup.py b/setup.py
index ccc3d2b..77ce446 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ package_data = \
{'': ['*']}
install_requires = \
-['starlette >=0.11.1,<=0.12.0', 'pydantic >=0.30,<=0.30.0']
+['starlette >=0.11.1', 'pydantic >=0.30']
extras_require = \
{'all': ['requests',

View File

@@ -1,26 +1,34 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, pythonOlder
, pytest
}:
buildPythonPackage rec {
pname = "fsspec";
version = "0.6.2";
disabled = pythonOlder "3.5";
src = fetchPypi {
inherit pname version;
sha256 = "ffd7cd5ac32f36698097c3d78c2c433d4c12f7e4bce3a3a4036fd3491188046d";
src = fetchFromGitHub {
owner = "intake";
repo = "filesystem_spec";
rev = version;
sha256 = "1y3d6xw14rcldz9779ir6mjaff4rk82ch6ahn4y9mya0qglpc31i";
};
# no tests
doCheck = false;
checkInputs = [
pytest
];
checkPhase = ''
pytest
'';
meta = with lib; {
description = "A specification that python filesystems should adhere to.";
homepage = "https://github.com/intake/filesystem_spec";
description = "A specification that python filesystems should adhere to";
homepage = https://github.com/intake/filesystem_spec;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -0,0 +1,28 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, isPy27
}:
buildPythonPackage rec {
pname = "hstspreload";
version = "2019.12.25";
disabled = isPy27;
src = fetchFromGitHub {
owner = "sethmlarson";
repo = pname;
rev = version;
sha256 = "1aa7jccwldxw3s0z668qqb0i0plsark1q3jvkmqkyp645w5bfilk";
};
# tests require network connection
doCheck = false;
meta = with lib; {
description = "Chromium HSTS Preload list as a Python package and updated daily";
homepage = https://github.com/sethmlarson/hstspreload;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -0,0 +1,68 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, certifi
, hstspreload
, chardet
, h11
, h2
, idna
, rfc3986
, sniffio
, isPy27
, pytest
, pytestcov
, trustme
, uvicorn
, trio
, brotli
}:
buildPythonPackage rec {
pname = "httpx";
version = "0.9.5";
disabled = isPy27;
src = fetchFromGitHub {
owner = "encode";
repo = pname;
rev = version;
sha256 = "140z2j7b5hlcxvfb433hqv5b8irqa88hpq33lzr9m992djbhj2hb";
};
propagatedBuildInputs = [
certifi
hstspreload
chardet
h11
h2
idna
rfc3986
sniffio
];
checkInputs = [
pytest
pytestcov
trustme
uvicorn
trio
brotli
];
postPatch = ''
substituteInPlace setup.py \
--replace "h11==0.8.*" "h11"
'';
checkPhase = ''
PYTHONPATH=.:$PYTHONPATH pytest
'';
meta = with lib; {
description = "The next generation HTTP client";
homepage = https://github.com/encode/httpx;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -10,11 +10,24 @@ buildPythonPackage rec {
src = fetchPypi {
inherit pname version;
sha256 = "95d18aa13ceb1b18a6109433b42d054e13b9a295cba96c08ab719f864f589d68";
sha256 = "0s4xb17qd7vimc46rafbjnibj4sf0lnv8cwl22k1h6zb7jhqmlcm";
};
checkInputs = [ pytest ];
propagatedBuildInputs = [ numpy cython ];
nativeBuildInputs = [
cython
];
checkInputs = [
pytest
];
propagatedBuildInputs = [
numpy
];
checkPhase = ''
pytest
'';
meta = with lib; {
description = "Block-oriented, in-memory buffer transformation, compression, and decompression functions";

View File

@@ -0,0 +1,43 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, databases
, typesystem
, aiosqlite
, pytest
, pytestcov
}:
buildPythonPackage rec {
pname = "orm";
version = "0.1.5";
src = fetchFromGitHub {
owner = "encode";
repo = "orm";
rev = version;
sha256 = "1g70cr0559iyqfzidwh6n2qq6d4dcnrr4sg0jkn1s4qzka828mj7";
};
propagatedBuildInputs = [
databases
typesystem
];
checkInputs = [
aiosqlite
pytest
pytestcov
];
checkPhase = ''
PYTHONPATH=$PYTHONPATH:. pytest
'';
meta = with lib; {
description = "An async ORM";
homepage = https://github.com/encode/orm;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -1,21 +1,25 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, ujson
, email_validator
, typing-extensions
, python
, isPy3k
, pytest
, pytestcov
}:
buildPythonPackage rec {
pname = "pydantic";
version = "1.2";
version = "1.3";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "da10b034750addbd95a328654d20364c479f4e2e26e0f72933204d61cbc8fa78";
src = fetchFromGitHub {
owner = "samuelcolvin";
repo = pname;
rev = "v${version}";
sha256 = "0s85nzlsyj97j54zsgv569hkzv617z0vqsifsxkkyiimgbvnx7g8";
};
propagatedBuildInputs = [
@@ -24,22 +28,13 @@ buildPythonPackage rec {
typing-extensions
];
checkInputs = [
pytest
pytestcov
];
checkPhase = ''
${python.interpreter} -c """
from datetime import datetime
from typing import List
from pydantic import BaseModel
class User(BaseModel):
id: int
name = 'John Doe'
signup_ts: datetime = None
friends: List[int] = []
external_data = {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']}
user = User(**external_data)
assert user.id is "123"
"""
pytest
'';
meta = with lib; {

View File

@@ -0,0 +1,26 @@
{ lib
, buildPythonPackage
, fetchPypi
, requests
}:
buildPythonPackage rec {
pname = "pyrabbit2";
version = "1.0.7";
src = fetchPypi {
inherit pname version;
sha256 = "d27160cb35c096f0072df57307233d01b117a451236e136604a8e51be6f106c0";
};
propagatedBuildInputs = [
requests
];
meta = with lib; {
description = "A Pythonic interface to the RabbitMQ Management HTTP API";
homepage = https://github.com/deslum/pyrabbit2;
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -0,0 +1,41 @@
{ lib
, buildPythonPackage
, fetchPypi
, pytest
, pytestcov
, mock
, pyyaml
, six
}:
buildPythonPackage rec {
pname = "python-multipart";
version = "0.0.5";
src = fetchPypi {
inherit pname version;
sha256 = "f7bb5f611fc600d15fa47b3974c8aa16e93724513b49b5f95c81e6624c83fa43";
};
checkInputs = [
pytest
pytestcov
mock
pyyaml
];
propagatedBuildInputs = [
six
];
checkPhase = ''
pytest
'';
meta = with lib; {
description = "A streaming multipart parser for Python";
homepage = https://github.com/andrew-d/python-multipart;
license = licenses.asl20;
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -9,11 +9,13 @@
, pyyaml
, requests
, ujson
, python-multipart
, pytest
, python
, uvicorn
, isPy27
, darwin
, databases
, aiosqlite
}:
buildPythonPackage rec {
@@ -35,13 +37,17 @@ buildPythonPackage rec {
requests
ujson
uvicorn
python-multipart
databases
] ++ stdenv.lib.optional stdenv.isDarwin [ darwin.apple_sdk.frameworks.ApplicationServices ];
checkInputs = [
pytest
aiosqlite
];
checkPhase = ''
${python.interpreter} -c """
from starlette.applications import Starlette
app = Starlette(debug=True)
"""
pytest --ignore=tests/test_graphql.py
'';
meta = with lib; {

View File

@@ -1,7 +1,14 @@
{ lib, fetchPypi, buildPythonPackage, isPy27, isPy3k
, numpy, enum34, futures, pathlib
, pytest
{ lib
, fetchPypi
, buildPythonPackage
, isPy27
, isPy3k
, numpy
, imagecodecs-lite
, enum34
, futures
, pathlib
, pytest
}:
buildPythonPackage rec {
@@ -18,14 +25,24 @@ buildPythonPackage rec {
# Missing dependencies: imagecodecs, czifile, cmapfile, oiffile, lfdfiles
# and test data missing from PyPI tarball
doCheck = false;
checkInputs = [ pytest ];
checkInputs = [
pytest
];
checkPhase = ''
pytest
'';
propagatedBuildInputs = [ numpy ]
++ lib.optionals isPy27 [ futures enum34 pathlib ]
++ lib.optionals isPy3k [ imagecodecs-lite ];
propagatedBuildInputs = [
numpy
] ++ lib.optionals isPy3k [
imagecodecs-lite
] ++ lib.optionals isPy27 [
futures
enum34
pathlib
];
meta = with lib; {
description = "Read and write image data from and to TIFF files.";

View File

@@ -1,5 +1,6 @@
{ stdenv, buildPythonPackage, fetchPypi, twine, pbr, click, click-completion, validate-email,
pendulum, ptable, requests, inquirer, pythonOlder, pytest, pytestcov, pytest-mock, faker, factory_boy }:
pendulum, ptable, requests, inquirer, pythonOlder, pytest, pytestcov, pytest-mock, faker, factory_boy,
setuptools }:
buildPythonPackage rec {
@@ -16,6 +17,7 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace requirements.txt \
--replace "pendulum==2.0.4" "pendulum>=2.0.4" \
--replace "click-completion==0.5.0" "click-completion>=0.5.0" \
--replace "pbr==5.1.2" "pbr>=5.1.2" \
--replace "inquirer==2.5.1" "inquirer>=2.5.1"
@@ -37,6 +39,7 @@ buildPythonPackage rec {
'';
propagatedBuildInputs = [
setuptools
click
click-completion
validate-email

View File

@@ -16,13 +16,13 @@
buildPythonPackage rec {
pname = "trezor";
version = "0.11.5";
version = "0.11.6";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "cd8aafd70a281daa644c4a3fb021ffac20b7a88e86226ecc8bb3e78e1734a184";
sha256 = "1i73j812i0dgjw9n106pipc6qksd9cgs59d0as0b4j5iyl0087hh";
};
propagatedBuildInputs = [ typing-extensions protobuf hidapi ecdsa mnemonic requests pyblake2 click construct libusb1 rlp shamir-mnemonic trezor-udev-rules ];

View File

@@ -0,0 +1,44 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, isPy27
, pytest
, pytestcov
, jinja2
, pyyaml
}:
buildPythonPackage rec {
pname = "typesystem";
version = "0.2.4";
disabled = isPy27;
src = fetchFromGitHub {
owner = "encode";
repo = pname;
rev = version;
sha256 = "1k0jwcky17zwaz2vx4x2zbsnp270g4mgn7kx5bpl8jgx76qmsnba";
};
propagatedBuildInputs = [
jinja2
pyyaml
];
checkInputs = [
pytest
pytestcov
];
# for some reason jinja2 not picking up forms directory (1% of tests)
checkPhase = ''
pytest --ignore=tests/test_forms.py
'';
meta = with lib; {
description = "A type system library for Python";
homepage = https://github.com/encode/typesystem;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}