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/development/python-modules/datasette/default.nix b/pkgs/development/python-modules/datasette/default.nix new file mode 100644 index 000000000000..f8c66c429fe7 --- /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 = version; + 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 "hupper==1.0" "hupper" \ + --replace "pint==0.8.1" "pint" \ + --replace "Jinja2==2.10" "Jinja2" + ''; + + # 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/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/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/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/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 ]; }; } 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/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/all-packages.nix b/pkgs/top-level/all-packages.nix index dfcb33bfa207..5c55325fa700 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 { }; @@ -1335,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 21fe206501d7..2c9f6d78a5a0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -339,6 +339,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 { }; @@ -471,6 +473,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 { }; @@ -659,6 +663,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 { }; @@ -922,6 +928,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 { }; @@ -1245,6 +1253,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 { @@ -1659,6 +1669,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 { }; @@ -4646,6 +4658,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 {