Merge staging-next into staging

This commit is contained in:
github-actions[bot]
2021-04-30 18:26:34 +00:00
committed by GitHub
37 changed files with 594 additions and 116 deletions
@@ -0,0 +1,38 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptools-scm
, importlib-metadata
, typing
, singledispatch
, python
}:
buildPythonPackage rec {
pname = "importlib-resources";
version = "3.3.1";
src = fetchPypi {
pname = "importlib_resources";
inherit version;
sha256 = "0ed250dbd291947d1a298e89f39afcc477d5a6624770503034b72588601bcc05";
};
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [
importlib-metadata
singledispatch
typing
];
checkPhase = ''
${python.interpreter} -m unittest discover
'';
meta = with lib; {
description = "Read resources from Python packages";
homepage = "https://importlib-resources.readthedocs.io/";
license = licenses.asl20;
maintainers = [ ];
};
}
@@ -1,8 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptools_scm
, toml
, setuptools-scm
, importlib-metadata
, typing ? null
, singledispatch ? null
@@ -11,15 +10,16 @@
}:
buildPythonPackage rec {
pname = "importlib_resources";
pname = "importlib-resources";
version = "5.1.2";
src = fetchPypi {
inherit pname version;
pname = "importlib_resources";
inherit version;
sha256 = "642586fc4740bd1cad7690f836b3321309402b20b332529f25617ff18e8e1370";
};
nativeBuildInputs = [ setuptools_scm toml ];
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [
importlib-metadata
] ++ lib.optional (pythonOlder "3.4") singledispatch
@@ -34,5 +34,6 @@ buildPythonPackage rec {
description = "Read resources from Python packages";
homepage = "https://importlib-resources.readthedocs.io/";
license = licenses.asl20;
maintainers = [ ];
};
}
@@ -0,0 +1,49 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pytestCheckHook
, wheel
, flask
, sanic
, fastapi
, uvicorn
, requests
}:
buildPythonPackage rec {
pname = "json-logging";
version = "1.3.0";
src = fetchFromGitHub {
owner = "bobbui";
repo = "json-logging-python";
rev = version;
hash = "sha256-0eIhOi30r3ApyVkiBdTQps5tNj7rI+q8TjNWxTnhtMQ=";
};
patches = [
# Fix tests picking up test modules instead of real packages.
(fetchpatch {
url = "https://github.com/bobbui/json-logging-python/commit/6fdb64deb42fe48b0b12bda0442fd5ac5f03107f.patch";
sha256 = "sha256-BLfARsw2FdvY22NCaFfdFgL9wTmEZyVIi3CQpB5qU0Y=";
})
];
# - Quart is not packaged for Nixpkgs.
# - FastAPI is broken, see #112701 and tiangolo/fastapi#2335.
checkInputs = [ wheel flask /*quart*/ sanic /*fastapi*/ uvicorn requests pytestCheckHook ];
disabledTests = [ "quart" "fastapi" ];
disabledTestPaths = [ "tests/test_fastapi.py" ];
# Tests spawn servers and try to connect to them.
__darwinAllowLocalNetworking = true;
meta = with lib; {
description = "Python library to emit logs in JSON format";
longDescription = ''
Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK, EFK, AWS Cloudwatch, GCP Stackdriver.
'';
homepage = "https://github.com/bobbui/json-logging-python";
license = licenses.asl20;
maintainers = with maintainers; [ AluisioASG ];
};
}
@@ -1,5 +1,5 @@
{ lib, fetchPypi, buildPythonPackage
, setuptools, six, traits
, importlib-metadata, importlib-resources, six, traits
}:
buildPythonPackage rec {
@@ -11,10 +11,12 @@ buildPythonPackage rec {
sha256 = "a7031ec4cfff034affc822e47ff5e6c1a0272e576d79465cdbbe25f721740322";
};
propagatedBuildInputs = [ setuptools six traits ];
propagatedBuildInputs = [ importlib-metadata importlib-resources six traits ];
doCheck = false; # Needs X server
pythonImportsCheck = [ "pyface" ];
meta = with lib; {
description = "Traits-capable windowing framework";
homepage = "https://github.com/enthought/pyface";
@@ -0,0 +1,41 @@
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, python
, mock
, setuptools-scm
}:
buildPythonPackage rec {
pname = "pytest-console-scripts";
version = "1.2.0";
src = fetchPypi {
inherit pname version;
sha256 = "4a2138d7d567bc581fe081b6a5975849a2a36b3925cb0f066d2380103e13741c";
};
postPatch = ''
# setuptools-scm is pinned to <6 because it dropped Python 3.5
# support. That's not something that affects us.
substituteInPlace setup.py --replace "'setuptools_scm<6'" "'setuptools_scm'"
# Patch the shebang of a script generated during test.
substituteInPlace tests/test_run_scripts.py --replace "#!/usr/bin/env python" "#!${python.interpreter}"
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [ setuptools-scm ];
checkInputs = [ mock pytestCheckHook ];
meta = with lib; {
description = "Pytest plugin for testing console scripts";
longDescription = ''
Pytest-console-scripts is a pytest plugin for running python scripts from within tests.
It's quite similar to subprocess.run(), but it also has an in-process mode, where the scripts are executed by the interpreter that's running pytest (using some amount of sandboxing).
'';
homepage = "https://github.com/kvas-it/pytest-console-scripts";
license = licenses.mit;
maintainers = with maintainers; [ AluisioASG ];
};
}
@@ -46,5 +46,9 @@ buildPythonPackage rec {
homepage = "https://github.com/yunstanford/pytest-sanic/";
license = licenses.asl20;
maintainers = [ maintainers.costrouc ];
# pytest-sanic is incompatible with Sanic 21.3, see
# https://github.com/sanic-org/sanic/issues/2095 and
# https://github.com/yunstanford/pytest-sanic/issues/50.
broken = lib.versionAtLeast sanic.version "21.3.0";
};
}
@@ -1,4 +1,4 @@
{ lib, buildPythonPackage, fetchPypi, sanic, pytestCheckHook }:
{ lib, buildPythonPackage, fetchPypi, sanic, sanic-testing, pytestCheckHook }:
buildPythonPackage rec {
pname = "Sanic-Auth";
@@ -11,7 +11,7 @@ buildPythonPackage rec {
propagatedBuildInputs = [ sanic ];
checkInputs = [ pytestCheckHook ];
checkInputs = [ pytestCheckHook sanic-testing ];
pythonImportsCheck = [ "sanic_auth" ];
@@ -0,0 +1,28 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pytest-asyncio
}:
buildPythonPackage rec {
pname = "sanic-routing";
version = "0.6.2";
src = fetchFromGitHub {
owner = "sanic-org";
repo = "sanic-routing";
rev = "v${version}";
hash = "sha256-ZMl8PB9E401pUfUJ4tW7nBx1TgPQQtx9erVni3zP+lo=";
};
checkInputs = [ pytestCheckHook pytest-asyncio ];
pythonImportsCheck = [ "sanic_routing" ];
meta = with lib; {
description = "Core routing component for the Sanic web framework";
homepage = "https://github.com/sanic-org/sanic-routing";
license = licenses.mit;
maintainers = with maintainers; [ AluisioASG ];
};
}
@@ -0,0 +1,40 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, httpcore
, httpx
, pytest-asyncio
, sanic
, websockets
}:
buildPythonPackage rec {
pname = "sanic-testing";
version = "0.3.1";
src = fetchFromGitHub {
owner = "sanic-org";
repo = "sanic-testing";
rev = "v${version}";
hash = "sha256-hBAq+/BKs0a01M89Nb8HaClqxB+W5PTfjVzef/m9SWs=";
};
propagatedBuildInputs = [ httpx sanic websockets httpcore ];
# `sanic` is explicitly set to null when building `sanic` itself
# to prevent infinite recursion. In that case we skip running
# the package at all.
doCheck = sanic != null;
dontUsePythonImportsCheck = sanic == null;
checkInputs = [ pytestCheckHook pytest-asyncio ];
pythonImportsCheck = [ "sanic_testing" ];
meta = with lib; {
description = "Core testing clients for the Sanic web framework";
homepage = "https://github.com/sanic-org/sanic-testing";
license = licenses.mit;
maintainers = with maintainers; [ AluisioASG ];
};
}
@@ -1,42 +1,44 @@
{ lib, buildPythonPackage, fetchPypi, doCheck ? true
, aiofiles, httptools, httpx, multidict, ujson, uvloop, websockets
, pytestCheckHook, beautifulsoup4, gunicorn, httpcore, uvicorn
, pytest-asyncio, pytest-benchmark, pytest-dependency, pytest-sanic, pytest-sugar, pytestcov
, aiofiles, httptools, multidict, sanic-routing, ujson, uvloop, websockets
, pytestCheckHook, beautifulsoup4, gunicorn, uvicorn, sanic-testing
, pytest-benchmark, pytest-sanic, pytest-sugar, pytestcov
}:
buildPythonPackage rec {
pname = "sanic";
version = "21.3.2";
version = "21.3.4";
src = fetchPypi {
inherit pname version;
sha256 = "84a04c5f12bf321bed3942597787f1854d15c18f157aebd7ced8c851ccc49e08";
sha256 = "1cbd12b9138b3ca69656286b0be91fff02b826e8cb72dd76a2ca8c5eb1288d8e";
};
postPatch = ''
# Loosen dependency requirements.
substituteInPlace setup.py \
--replace '"multidict==5.0.0"' '"multidict"' \
--replace '"httpx==0.15.4"' '"httpx"' \
--replace '"httpcore==0.3.0"' '"httpcore"' \
--replace '"pytest==5.2.1"' '"pytest"'
--replace '"pytest==5.2.1"' '"pytest"' \
--replace '"gunicorn==20.0.4"' '"gunicorn"' \
--replace '"pytest-sanic",' ""
# Patch a request headers test to allow brotli encoding
# (we build httpx with brotli support, upstream doesn't).
substituteInPlace tests/test_headers.py \
--replace "deflate\r\n" "deflate, br\r\n"
'';
propagatedBuildInputs = [
aiofiles httptools httpx multidict ujson uvloop websockets
sanic-routing httptools uvloop ujson aiofiles websockets multidict
];
checkInputs = [
pytestCheckHook beautifulsoup4 gunicorn httpcore uvicorn
pytest-asyncio pytest-benchmark pytest-dependency pytest-sanic pytest-sugar pytestcov
sanic-testing gunicorn pytestcov beautifulsoup4 pytest-sanic pytest-sugar
pytest-benchmark pytestCheckHook uvicorn
];
inherit doCheck;
disabledTests = [
"test_gunicorn" # No "examples" directory in pypi distribution.
"test_logo" # Fails to filter out "DEBUG asyncio:selector_events.py:59 Using selector: EpollSelector"
"test_zero_downtime" # No "examples.delayed_response.app" module in pypi distribution.
"test_reloader_live" # OSError: [Errno 98] error while attempting to bind on address ('127.0.0.1', 42104)
];
__darwinAllowLocalNetworking = true;
@@ -45,8 +47,8 @@ buildPythonPackage rec {
meta = with lib; {
description = "A microframework based on uvloop, httptools, and learnings of flask";
homepage = "https://github.com/channelcat/sanic/";
homepage = "https://github.com/sanic-org/sanic/";
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
maintainers = with maintainers; [ costrouc AluisioASG ];
};
}