From a3b99d4a5e1bd35745796435e3410f3420debe68 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:04:14 -0500 Subject: [PATCH 01/13] python3Packages.aiocontextvars: init at 0.2.2 --- .../python-modules/aiocontextvars/default.nix | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/python-modules/aiocontextvars/default.nix diff --git a/pkgs/development/python-modules/aiocontextvars/default.nix b/pkgs/development/python-modules/aiocontextvars/default.nix new file mode 100644 index 00000000000..38fdf14164e --- /dev/null +++ b/pkgs/development/python-modules/aiocontextvars/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 273695af136..8c69ce56044 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4350,6 +4350,8 @@ in { fasteners = callPackage ../development/python-modules/fasteners { }; + aiocontextvars = callPackage ../development/python-modules/aiocontextvars { }; + aioeventlet = callPackage ../development/python-modules/aioeventlet { }; aiokafka = callPackage ../development/python-modules/aiokafka { }; From 982d242ba5fa377756f06ca6fc960c20d8990d4f Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:04:44 -0500 Subject: [PATCH 02/13] python3Packages.typesystem: init at 0.2.4 --- .../python-modules/typesystem/default.nix | 44 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/development/python-modules/typesystem/default.nix diff --git a/pkgs/development/python-modules/typesystem/default.nix b/pkgs/development/python-modules/typesystem/default.nix new file mode 100644 index 00000000000..8a66d6cbcc9 --- /dev/null +++ b/pkgs/development/python-modules/typesystem/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8c69ce56044..1826773c738 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5104,6 +5104,8 @@ in { typesentry = callPackage ../development/python-modules/typesentry { }; + typesystem = callPackage ../development/python-modules/typesystem { }; + s3transfer = callPackage ../development/python-modules/s3transfer { }; seqdiag = callPackage ../development/python-modules/seqdiag { }; From f45eef8ff763087dba350a6a936e5acacce22dd4 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:05:18 -0500 Subject: [PATCH 03/13] python3Packages.databases: init at 0.2.6 --- .../python-modules/databases/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/databases/default.nix diff --git a/pkgs/development/python-modules/databases/default.nix b/pkgs/development/python-modules/databases/default.nix new file mode 100644 index 00000000000..e4129ed9bbf --- /dev/null +++ b/pkgs/development/python-modules/databases/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1826773c738..f82ab9229aa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -550,6 +550,8 @@ in { inherit (pkgs.llvmPackages) openmp libcxx libcxxabi; }; + databases = callPackage ../development/python-modules/databases { }; + datamodeldict = callPackage ../development/python-modules/datamodeldict { }; datasette = callPackage ../development/python-modules/datasette { }; From 5a673d3c05a79940dea48662ebea2ac4b39fa432 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:05:45 -0500 Subject: [PATCH 04/13] python3Packages.httpx: init at 0.9.5 --- .../python-modules/httpx/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/httpx/default.nix diff --git a/pkgs/development/python-modules/httpx/default.nix b/pkgs/development/python-modules/httpx/default.nix new file mode 100644 index 00000000000..04a0592d750 --- /dev/null +++ b/pkgs/development/python-modules/httpx/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f82ab9229aa..d80a71b3187 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2620,6 +2620,8 @@ in { httpauth = callPackage ../development/python-modules/httpauth { }; + httpx = callPackage ../development/python-modules/httpx { }; + idna-ssl = callPackage ../development/python-modules/idna-ssl { }; identify = callPackage ../development/python-modules/identify { }; From 72638f40095dc1b01812ab0f515b969f897e8a3a Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:06:14 -0500 Subject: [PATCH 05/13] python3Packages.orm: init at 0.1.5 --- .../python-modules/orm/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/orm/default.nix diff --git a/pkgs/development/python-modules/orm/default.nix b/pkgs/development/python-modules/orm/default.nix new file mode 100644 index 00000000000..c2f6bc4fc57 --- /dev/null +++ b/pkgs/development/python-modules/orm/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d80a71b3187..cc29f2d59b1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6081,6 +6081,8 @@ in { ofxtools = callPackage ../development/python-modules/ofxtools { }; + orm = callPackage ../development/python-modules/orm { }; + basemap = callPackage ../development/python-modules/basemap { }; dict2xml = callPackage ../development/python-modules/dict2xml { }; From 16a6c127324c470592585e8f95746106f433e0e4 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:06:34 -0500 Subject: [PATCH 06/13] python3Packages.hstspreload: init at 2019.12.25 --- .../python-modules/hstspreload/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/development/python-modules/hstspreload/default.nix diff --git a/pkgs/development/python-modules/hstspreload/default.nix b/pkgs/development/python-modules/hstspreload/default.nix new file mode 100644 index 00000000000..a276bd33b59 --- /dev/null +++ b/pkgs/development/python-modules/hstspreload/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cc29f2d59b1..69ed76696a9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2616,6 +2616,8 @@ in { hsaudiotag3k = callPackage ../development/python-modules/hsaudiotag3k { }; + hstspreload = callPackage ../development/python-modules/hstspreload { }; + htmlmin = callPackage ../development/python-modules/htmlmin {}; httpauth = callPackage ../development/python-modules/httpauth { }; From f1a3393769d18b277d31cb673fe4975410d9b23f Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:07:02 -0500 Subject: [PATCH 07/13] python3Packages.aiomysql: init at 0.0.20 --- .../python-modules/aiomysql/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/aiomysql/default.nix diff --git a/pkgs/development/python-modules/aiomysql/default.nix b/pkgs/development/python-modules/aiomysql/default.nix new file mode 100644 index 00000000000..891e9f216ce --- /dev/null +++ b/pkgs/development/python-modules/aiomysql/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 69ed76696a9..8e7c9cb4bc8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1456,6 +1456,8 @@ in { aiohttp-swagger = callPackage ../development/python-modules/aiohttp-swagger { }; + aiomysql = callPackage ../development/python-modules/aiomysql { }; + aioprocessing = callPackage ../development/python-modules/aioprocessing { }; aioresponses = callPackage ../development/python-modules/aioresponses { }; From 5d7fd25770a98863993125d53e49b7c2d99a46a2 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:07:21 -0500 Subject: [PATCH 08/13] python3Packages.aiosqlite: init at 0.11.0 --- .../python-modules/aiosqlite/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/aiosqlite/default.nix diff --git a/pkgs/development/python-modules/aiosqlite/default.nix b/pkgs/development/python-modules/aiosqlite/default.nix new file mode 100644 index 00000000000..1032485e980 --- /dev/null +++ b/pkgs/development/python-modules/aiosqlite/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8e7c9cb4bc8..449b4f90e41 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1462,6 +1462,8 @@ in { aioresponses = callPackage ../development/python-modules/aioresponses { }; + aiosqlite = callPackage ../development/python-modules/aiosqlite { }; + aiorpcx = callPackage ../development/python-modules/aiorpcx { }; aiosmtpd = callPackage ../development/python-modules/aiosmtpd { }; From 9bb56b241629f48cc8afe2c110a3653b6a8a1c57 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:07:42 -0500 Subject: [PATCH 09/13] pythonPackages.aiounittest: init at 1.3.1 --- .../python-modules/aiounittest/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/aiounittest/default.nix diff --git a/pkgs/development/python-modules/aiounittest/default.nix b/pkgs/development/python-modules/aiounittest/default.nix new file mode 100644 index 00000000000..743600a0d3b --- /dev/null +++ b/pkgs/development/python-modules/aiounittest/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 449b4f90e41..5860304305f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1470,6 +1470,8 @@ in { aiounifi = callPackage ../development/python-modules/aiounifi { }; + aiounittest = callPackage ../development/python-modules/aiounittest { }; + aiozeroconf = callPackage ../development/python-modules/aiozeroconf { }; ajpy = callPackage ../development/python-modules/ajpy { }; From 5438b13be8e10e0e3b9079e9b5cab7f5094b3df0 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:08:10 -0500 Subject: [PATCH 10/13] pythonPackages.python-multipart: init at 0.0.5 --- .../python-multipart/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/python-multipart/default.nix diff --git a/pkgs/development/python-modules/python-multipart/default.nix b/pkgs/development/python-modules/python-multipart/default.nix new file mode 100644 index 00000000000..e3e75d88604 --- /dev/null +++ b/pkgs/development/python-modules/python-multipart/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5860304305f..bb05282bbe1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4314,6 +4314,8 @@ in { orderedset = callPackage ../development/python-modules/orderedset { }; + python-multipart = callPackage ../development/python-modules/python-multipart { }; + python-otr = callPackage ../development/python-modules/python-otr { }; plone-testing = callPackage ../development/python-modules/plone-testing { }; From 93aa213aca0c75b8ba8e8db8bca4da677d19ca6a Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:08:35 -0500 Subject: [PATCH 11/13] python3Packages.fastapi: 0.42.0 -> 0.45.0 fix broken package enable tests --- .../python-modules/fastapi/default.nix | 38 ++++++++++++++----- .../python-modules/fastapi/setup.py.patch | 13 ------- 2 files changed, 29 insertions(+), 22 deletions(-) delete mode 100644 pkgs/development/python-modules/fastapi/setup.py.patch diff --git a/pkgs/development/python-modules/fastapi/default.nix b/pkgs/development/python-modules/fastapi/default.nix index c90b64dca81..75edf5dc424 100644 --- a/pkgs/development/python-modules/fastapi/default.nix +++ b/pkgs/development/python-modules/fastapi/default.nix @@ -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.42.0"; + version = "0.45.0"; + format = "flit"; disabled = !isPy3k; - src = fetchPypi { - inherit pname version; - sha256 = "48cb522c1c993e238bfe272fbb18049cbd4bf5b9d6c0d4a4fa113cc790e8196c"; + 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; { diff --git a/pkgs/development/python-modules/fastapi/setup.py.patch b/pkgs/development/python-modules/fastapi/setup.py.patch deleted file mode 100644 index 43661343d74..00000000000 --- a/pkgs/development/python-modules/fastapi/setup.py.patch +++ /dev/null @@ -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', From 470566c0c86dc75ff8699c19ca311ad841771b19 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:09:43 -0500 Subject: [PATCH 12/13] python3Packages.pydantic: 1.0 -> 1.3 enable tests move to github --- .../python-modules/pydantic/default.nix | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/pkgs/development/python-modules/pydantic/default.nix b/pkgs/development/python-modules/pydantic/default.nix index 3e8e5086ead..088c6636fdc 100644 --- a/pkgs/development/python-modules/pydantic/default.nix +++ b/pkgs/development/python-modules/pydantic/default.nix @@ -1,21 +1,25 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , ujson , email_validator , typing-extensions , python , isPy3k +, pytest +, pytestcov }: buildPythonPackage rec { pname = "pydantic"; - version = "1.0"; + version = "1.3"; disabled = !isPy3k; - src = fetchPypi { - inherit pname version; - sha256 = "bf474cebe007701806f5f8b076fb8508116606e5c721734bb855bfec4185263c"; + 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; { From 708d34a5c5a420b8b539e5d400c2848f49438bbf Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:10:17 -0500 Subject: [PATCH 13/13] python3Packages.starlette: 0.12.13 -> 0.12.9 downgrade (fix fastapi), enable tests fastapi is the only dependent package of starlette. Downgrading version and enabling full tests to fix fastapi. --- .../python-modules/starlette/default.nix | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/starlette/default.nix b/pkgs/development/python-modules/starlette/default.nix index 6580a87b2fe..9fd1d56ea1a 100644 --- a/pkgs/development/python-modules/starlette/default.nix +++ b/pkgs/development/python-modules/starlette/default.nix @@ -1,7 +1,7 @@ { lib , stdenv , buildPythonPackage -, fetchPypi +, fetchFromGitHub , aiofiles , graphene , itsdangerous @@ -9,21 +9,25 @@ , pyyaml , requests , ujson +, python-multipart , pytest -, python , uvicorn , isPy27 , darwin +, databases +, aiosqlite }: buildPythonPackage rec { pname = "starlette"; - version = "0.12.13"; + version = "0.12.9"; disabled = isPy27; - src = fetchPypi { - inherit pname version; - sha256 = "9597bc28e3c4659107c1c4a45ec32dc45e947d78fe56230222be673b2c36454a"; + src = fetchFromGitHub { + owner = "encode"; + repo = "starlette"; + rev = version; + sha256 = "0w44s8ynzy8w8dgm755c8jina9i4dd87vqkcv7jc1kwkg384w9i5"; }; propagatedBuildInputs = [ @@ -35,13 +39,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; {