From fbde6016f315ef4e795c3cf7a88b821467812158 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:49:05 -0400 Subject: [PATCH 1/9] pythonPackages.csvs-to-sqlite: init at 0.9 --- .../python-modules/csvs-to-sqlite/default.nix | 49 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/csvs-to-sqlite/default.nix diff --git a/pkgs/development/python-modules/csvs-to-sqlite/default.nix b/pkgs/development/python-modules/csvs-to-sqlite/default.nix new file mode 100644 index 000000000000..ab9ca9827186 --- /dev/null +++ b/pkgs/development/python-modules/csvs-to-sqlite/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestrunner +, click +, dateparser +, pandas +, py-lru-cache +, six +, pytest +}: + +buildPythonPackage rec { + pname = "csvs-to-sqlite"; + version = "0.9"; + + src = fetchFromGitHub { + owner = "simonw"; + repo = pname; + rev = version; + sha256 = "0js86m4kj70g9n9gagr8l6kgswqllg6hn1xa3yvxwv95i59ihpz5"; + }; + + buildInputs = [ pytestrunner ]; + + propagatedBuildInputs = [ + click + dateparser + pandas + py-lru-cache + six + ]; + + checkInputs = [ + pytest + ]; + + checkPhase = '' + pytest + ''; + + meta = with lib; { + description = "Convert CSV files into a SQLite database"; + homepage = https://github.com/simonw/csvs-to-sqlite; + license = licenses.asl20; + maintainers = [ maintainers.costrouc ]; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 57ba1ab44dcc..02eb987260fc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1325,6 +1325,8 @@ in csvkit = callPackage ../tools/text/csvkit { }; + csvs-to-sqlite = with python3Packages; toPythonApplication csvs-to-sqlite; + cucumber = callPackage ../development/tools/cucumber {}; daemontools = callPackage ../tools/admin/daemontools { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 38d82984c488..5e9afc29e83b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1230,6 +1230,8 @@ in { csscompressor = callPackage ../development/python-modules/csscompressor {}; + csvs-to-sqlite = callPackage ../development/python-modules/csvs-to-sqlite { }; + cufflinks = callPackage ../development/python-modules/cufflinks { }; cupy = callPackage ../development/python-modules/cupy { From a6de2a2a7caf14660e4b6b6243e734b8eedfc4c8 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:52:16 -0400 Subject: [PATCH 2/9] pythonPackages.datasette: init at 0.27 --- .../python-modules/datasette/default.nix | 73 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 77 insertions(+) create mode 100644 pkgs/development/python-modules/datasette/default.nix diff --git a/pkgs/development/python-modules/datasette/default.nix b/pkgs/development/python-modules/datasette/default.nix new file mode 100644 index 000000000000..581571f886df --- /dev/null +++ b/pkgs/development/python-modules/datasette/default.nix @@ -0,0 +1,73 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, click +, click-default-group +, sanic +, jinja2 +, hupper +, pint +, pluggy +, pytest +, pytestrunner +, pytest-asyncio +, aiohttp +, beautifulsoup4 +}: + +buildPythonPackage rec { + pname = "datasette"; + version = "0.27"; + + src = fetchFromGitHub { + owner = "simonw"; + repo = "datasette"; + rev = "0.27"; + sha256 = "02k1kk6bw034rs74w0viwzapxz684lqgjvw5q5j5xgr0i4kynylp"; + }; + + buildInputs = [ pytestrunner ]; + + propagatedBuildInputs = [ + click + click-default-group + sanic + jinja2 + hupper + pint + pluggy + ]; + + checkInputs = [ + pytest + pytest-asyncio + aiohttp + beautifulsoup4 + ]; + + postConfigure = '' + substituteInPlace setup.py \ + --replace "click==6.7" "click" \ + --replace "click-default-group==1.2" "click-default-group" \ + --replace "Sanic==0.7.0" "Sanic" \ + --replace "Jinja2==2.10" "Jinja2" \ + --replace "hupper==1.0" "hupper" \ + --replace "pint==0.8.1" "pint" + ''; + + # many tests require network access + checkPhase = '' + pytest --ignore tests/test_api.py \ + --ignore tests/test_csv.py \ + --ignore tests/test_html.py \ + --ignore tests/test_publish_heroku.py + ''; + + meta = with lib; { + description = "An instant JSON API for your SQLite databases"; + homepage = https://github.com/simonw/datasette; + license = licenses.asl20; + maintainers = [ maintainers.costrouc ]; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 02eb987260fc..ef2910fb466e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1337,6 +1337,8 @@ in datamash = callPackage ../tools/misc/datamash { }; + datasette = with python3Packages; toPythonApplication datasette; + datefudge = callPackage ../tools/system/datefudge { }; dateutils = callPackage ../tools/misc/dateutils { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5e9afc29e83b..6906c77b725b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -336,6 +336,8 @@ in { datamodeldict = callPackage ../development/python-modules/datamodeldict { }; + datasette = callPackage ../development/python-modules/datasette { }; + dbf = callPackage ../development/python-modules/dbf { }; dbfread = callPackage ../development/python-modules/dbfread { }; From 825364c32d06a4cd5e891e49727f9aafcc63798b Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:52:41 -0400 Subject: [PATCH 3/9] pythonPackages.httptools: init at 0.0.13 --- .../python-modules/httptools/default.nix | 21 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/development/python-modules/httptools/default.nix diff --git a/pkgs/development/python-modules/httptools/default.nix b/pkgs/development/python-modules/httptools/default.nix new file mode 100644 index 000000000000..fc83675fd657 --- /dev/null +++ b/pkgs/development/python-modules/httptools/default.nix @@ -0,0 +1,21 @@ +{ lib +, buildPythonPackage +, fetchPypi +}: + +buildPythonPackage rec { + pname = "httptools"; + version = "0.0.13"; + + src = fetchPypi { + inherit pname version; + sha256 = "e00cbd7ba01ff748e494248183abc6e153f49181169d8a3d41bb49132ca01dfc"; + }; + + meta = with lib; { + description = "A collection of framework independent HTTP protocol utils"; + homepage = https://github.com/MagicStack/httptools; + license = licenses.mit; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6906c77b725b..048914da5a00 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -468,6 +468,8 @@ in { httpsig = callPackage ../development/python-modules/httpsig { }; + httptools = callPackage ../development/python-modules/httptools { }; + i3ipc = callPackage ../development/python-modules/i3ipc { }; imutils = callPackage ../development/python-modules/imutils { }; From 1b60d165bbc12bdd9e6ed30eb6afe3e3b2c17c73 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:53:03 -0400 Subject: [PATCH 4/9] pythonPackages.py-lru-cache: init at 0.1.4 --- .../python-modules/py-lru-cache/default.nix | 23 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/development/python-modules/py-lru-cache/default.nix diff --git a/pkgs/development/python-modules/py-lru-cache/default.nix b/pkgs/development/python-modules/py-lru-cache/default.nix new file mode 100644 index 000000000000..b1d8c4f2946d --- /dev/null +++ b/pkgs/development/python-modules/py-lru-cache/default.nix @@ -0,0 +1,23 @@ +{ lib +, buildPythonPackage +, fetchPypi +}: + +buildPythonPackage rec { + pname = "py-lru-cache"; + version = "0.1.4"; + + src = fetchPypi { + inherit version; + pname = "py_lru_cache"; + sha256 = "1w3a8l3ckl1zz0f2vlfrawl9a402r458p7xzhy4sgq8k9rl37pq2"; + }; + + meta = with lib; { + description = "An in-memory LRU cache for python"; + homepage = https://github.com/stucchio/Python-LRU-cache; + license = licenses.gpl3; + maintainers = [ maintainers.costrouc ]; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 048914da5a00..2849f3b3114b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -652,6 +652,8 @@ in { py-cpuinfo = callPackage ../development/python-modules/py-cpuinfo { }; + py-lru-cache = callPackage ../development/python-modules/py-lru-cache { }; + pydbus = callPackage ../development/python-modules/pydbus { }; pydocstyle = callPackage ../development/python-modules/pydocstyle { }; From b9ccbbffa7397b2bb9e4d6e260b58af9bd47cf00 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:53:23 -0400 Subject: [PATCH 5/9] pythonPackages.uvloop: init at 0.12.2 --- .../python-modules/uvloop/default.nix | 30 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/uvloop/default.nix diff --git a/pkgs/development/python-modules/uvloop/default.nix b/pkgs/development/python-modules/uvloop/default.nix new file mode 100644 index 000000000000..9c3dae74a79e --- /dev/null +++ b/pkgs/development/python-modules/uvloop/default.nix @@ -0,0 +1,30 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pyopenssl +, libuv +, psutil +, isPy27 +}: + +buildPythonPackage rec { + pname = "uvloop"; + version = "0.12.2"; + disabled = isPy27; + + src = fetchPypi { + inherit pname version; + sha256 = "c48692bf4587ce281d641087658eca275a5ad3b63c78297bbded96570ae9ce8f"; + }; + + buildInputs = [ libuv ]; + + checkInputs = [ pyopenssl psutil ]; + + meta = with lib; { + description = "Fast implementation of asyncio event loop on top of libuv"; + homepage = http://github.com/MagicStack/uvloop; + license = licenses.mit; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2849f3b3114b..cb4a7b35ce4a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -913,6 +913,8 @@ in { unifi = callPackage ../development/python-modules/unifi { }; + uvloop = callPackage ../development/python-modules/uvloop { }; + pyunifi = callPackage ../development/python-modules/pyunifi { }; vidstab = callPackage ../development/python-modules/vidstab { }; From 0ddf3fe7d857f9037d61240f5944e0e6782a5178 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:53:44 -0400 Subject: [PATCH 6/9] pythonPackages.pytest-sanic: init at 1.0.0 --- .../python-modules/pytest-sanic/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-sanic/default.nix diff --git a/pkgs/development/python-modules/pytest-sanic/default.nix b/pkgs/development/python-modules/pytest-sanic/default.nix new file mode 100644 index 000000000000..c760b6a5542a --- /dev/null +++ b/pkgs/development/python-modules/pytest-sanic/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytest +, aiohttp +, async_generator +}: + +buildPythonPackage rec { + pname = "pytest-sanic"; + version = "1.0.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "0vlaq6p9g2p1xj9wshmin58p1faf5h9rcxvmjapx26zv8n23rnm1"; + }; + + propagatedBuildInputs = [ + pytest + aiohttp + async_generator + ]; + + # circular dependency on sanic + doCheck = false; + + meta = with lib; { + description = "A pytest plugin for Sanic"; + homepage = https://github.com/yunstanford/pytest-sanic/; + license = licenses.asl20; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cb4a7b35ce4a..a42f9486bec8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1654,6 +1654,8 @@ in { pytest-relaxed = callPackage ../development/python-modules/pytest-relaxed { }; + pytest-sanic = callPackage ../development/python-modules/pytest-sanic { }; + pytest-flake8 = callPackage ../development/python-modules/pytest-flake8 { }; pytest-flakes = callPackage ../development/python-modules/pytest-flakes { }; From 5d930e2dfaa7472f89bce70ce03fd454d3466d5d Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:54:04 -0400 Subject: [PATCH 7/9] pythonPackages.sanic: init at 19.3.1 --- .../python-modules/sanic/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/sanic/default.nix diff --git a/pkgs/development/python-modules/sanic/default.nix b/pkgs/development/python-modules/sanic/default.nix new file mode 100644 index 000000000000..6aae4c11fdd4 --- /dev/null +++ b/pkgs/development/python-modules/sanic/default.nix @@ -0,0 +1,68 @@ +{ lib +, buildPythonPackage +, fetchPypi +, httptools +, aiofiles +, websockets +, multidict +, uvloop +, ujson +, pytest +, gunicorn +, pytestcov +, aiohttp +, beautifulsoup4 +, pytest-sanic +, pytest-sugar +, pytest-benchmark +}: + +buildPythonPackage rec { + pname = "sanic"; + version = "19.3.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "ce434eb154872ca64493a6c3a288f11fd10bca0de7be7bf9f1d0d063185e51ec"; + }; + + propagatedBuildInputs = [ + httptools + aiofiles + websockets + multidict + uvloop + ujson + ]; + + checkInputs = [ + pytest + gunicorn + pytestcov + aiohttp + beautifulsoup4 + pytest-sanic + pytest-sugar + pytest-benchmark + ]; + + postConfigure = '' + substituteInPlace setup.py \ + --replace "websockets>=6.0,<7.0" "websockets" + ''; + + # 10/500 tests ignored due to missing directory and + # requiring network access + checkPhase = '' + pytest --ignore tests/test_blueprints.py \ + --ignore tests/test_routes.py \ + --ignore tests/test_worker.py + ''; + + meta = with lib; { + description = "A microframework based on uvloop, httptools, and learnings of flask"; + homepage = http://github.com/channelcat/sanic/; + license = licenses.mit; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a42f9486bec8..d92c522bc525 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4641,6 +4641,8 @@ in { sandboxlib = callPackage ../development/python-modules/sandboxlib { }; + sanic = callPackage ../development/python-modules/sanic { }; + scales = callPackage ../development/python-modules/scales { }; secp256k1 = callPackage ../development/python-modules/secp256k1 { From bea2b415ec1d97d8b5c5cc08816e837ce299162e Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:54:31 -0400 Subject: [PATCH 8/9] pythonPackages.pytest-sugar: refactor fix broken build --- .../python-modules/pytest-sugar/default.nix | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/pytest-sugar/default.nix b/pkgs/development/python-modules/pytest-sugar/default.nix index e8b58acd6702..5ece578dc258 100644 --- a/pkgs/development/python-modules/pytest-sugar/default.nix +++ b/pkgs/development/python-modules/pytest-sugar/default.nix @@ -1,4 +1,10 @@ -{ stdenv, buildPythonPackage, fetchPypi, termcolor, pytest }: +{ lib +, buildPythonPackage +, fetchPypi +, termcolor +, pytest +, packaging +}: buildPythonPackage rec { pname = "pytest-sugar"; @@ -9,19 +15,16 @@ buildPythonPackage rec { sha256 = "fcd87a74b2bce5386d244b49ad60549bfbc4602527797fac167da147983f58ab"; }; - propagatedBuildInputs = [ termcolor pytest ]; + propagatedBuildInputs = [ + termcolor + pytest + packaging + ]; - checkPhase = '' - py.test - ''; - - meta = with stdenv.lib; { + meta = with lib; { description = "A plugin that changes the default look and feel of py.test"; homepage = https://github.com/Frozenball/pytest-sugar; license = licenses.bsd3; - - # incompatible with pytest 3.5 - # https://github.com/Frozenball/pytest-sugar/issues/134 - broken = true; # 2018-04-20 + maintainers = [ maintainers.costrouc ]; }; } From 8a39315484ecb98f465280c8864a679cfefd669a Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 7 May 2019 08:52:16 -0400 Subject: [PATCH 9/9] pythonPackages.datasette: init at 0.27 --- pkgs/development/python-modules/datasette/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/datasette/default.nix b/pkgs/development/python-modules/datasette/default.nix index 581571f886df..f8c66c429fe7 100644 --- a/pkgs/development/python-modules/datasette/default.nix +++ b/pkgs/development/python-modules/datasette/default.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "simonw"; repo = "datasette"; - rev = "0.27"; + rev = version; sha256 = "02k1kk6bw034rs74w0viwzapxz684lqgjvw5q5j5xgr0i4kynylp"; }; @@ -50,9 +50,9 @@ buildPythonPackage rec { --replace "click==6.7" "click" \ --replace "click-default-group==1.2" "click-default-group" \ --replace "Sanic==0.7.0" "Sanic" \ - --replace "Jinja2==2.10" "Jinja2" \ --replace "hupper==1.0" "hupper" \ - --replace "pint==0.8.1" "pint" + --replace "pint==0.8.1" "pint" \ + --replace "Jinja2==2.10" "Jinja2" ''; # many tests require network access