Skip to content

Commit

Permalink
Merge pull request #182692 from mweinelt/uvicorn
Browse files Browse the repository at this point in the history
[staging-next] More python fixes
  • Loading branch information
mweinelt authored Jul 25, 2022
2 parents 63fdfd7 + 13981ca commit bbe7562
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 14 deletions.
13 changes: 13 additions & 0 deletions pkgs/development/python-modules/jupyterlab_server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, lib
, buildPythonPackage
, fetchPypi
, hatchling
, jsonschema
, pythonOlder
, requests
Expand All @@ -10,6 +11,7 @@
, babel
, jupyter_server
, openapi-core
, pytest-timeout
, pytest-tornasync
, ruamel-yaml
, strict-rfc3339
Expand All @@ -18,6 +20,7 @@
buildPythonPackage rec {
pname = "jupyterlab_server";
version = "2.15.0";
format = "pyproject";
disabled = pythonOlder "3.6";

src = fetchPypi {
Expand All @@ -33,11 +36,16 @@ buildPythonPackage rec {
rm -r tests/translations/
'';

nativeBuildInputs = [
hatchling
];

propagatedBuildInputs = [ requests jsonschema pyjson5 babel jupyter_server ];

checkInputs = [
openapi-core
pytestCheckHook
pytest-timeout
pytest-tornasync
ruamel-yaml
];
Expand All @@ -46,6 +54,11 @@ buildPythonPackage rec {
export HOME=$(mktemp -d)
'';

pytestFlagsArray = [
# DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
"-W ignore::DeprecationWarning"
];

__darwinAllowLocalNetworking = true;

meta = with lib; {
Expand Down
14 changes: 10 additions & 4 deletions pkgs/development/python-modules/pypdf2/default.nix
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, glibcLocales
, typing-extensions
, python
, isPy3k
}:

buildPythonPackage rec {
pname = "PyPDF2";
version = "2.5.0";
version = "2.8.0";

src = fetchPypi {
inherit pname version;
sha256 = "sha256-WAKx9A+nm+G1q57claTn9+czmVidtPDmbKgx9Ennos0=";
sha256 = "sha256-ad39ck3f4HAQ7zpWyVvxIYVT7Anig2Nuzw8HLsEZWZo=";
};

LC_ALL = "en_US.UTF-8";
buildInputs = [ glibcLocales ];

propagatedBuildInputs = lib.optionals (pythonOlder "3.10") [
typing-extensions
];

checkPhase = ''
${python.interpreter} -m unittest discover -s Tests
${python.interpreter} -m unittest discover
'';

# Tests broken on Python 3.x
doCheck = !(isPy3k);
#doCheck = !(isPy3k);

meta = with lib; {
description = "A Pure-Python library built as a PDF toolkit";
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/pyprosegur/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib
, aiofiles
, aiohttp
, backoff
, buildPythonPackage
Expand All @@ -20,6 +21,7 @@ buildPythonPackage rec {
};

propagatedBuildInputs = [
aiofiles
aiohttp
backoff
click
Expand Down
13 changes: 7 additions & 6 deletions pkgs/development/python-modules/uvicorn/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
, pyyaml
, typing-extensions
, uvloop
, watchgod
, watchfiles
, websockets
, wsproto
, pythonOlder
}:

Expand All @@ -35,15 +34,17 @@ buildPythonPackage rec {
propagatedBuildInputs = [
click
h11
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
];

passthru.optional-dependencies.standard = [
httptools
python-dotenv
pyyaml
uvloop
watchgod
watchfiles
websockets
wsproto
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
];

postInstall = ''
Expand Down
11 changes: 10 additions & 1 deletion pkgs/development/python-modules/uvicorn/tests.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{ stdenv
, buildPythonPackage
, asgiref
, uvicorn
, httpx
, pytest-asyncio
, pytestCheckHook
, pytest-mock
, requests
, trustme
, watchgod
, wsproto
}:

buildPythonPackage rec {
Expand All @@ -19,14 +22,20 @@ buildPythonPackage rec {
dontInstall = true;

checkInputs = [
asgiref
uvicorn
httpx
pytestCheckHook
pytest-asyncio
pytest-mock
requests
trustme
];

# strictly optional dependencies
watchgod
wsproto
]
++ uvicorn.optional-dependencies.standard;

doCheck = !stdenv.isDarwin;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@

python3.pkgs.buildPythonApplication rec {
pname = "dmarc-metrics-exporter";
version = "0.6.0";
version = "0.6.1";

disabled = python3.pythonOlder "3.7";

format = "pyproject";

src = python3.pkgs.fetchPypi {
inherit pname version;
sha256 = "70f39b373ead42acb8caf56040f7ebf13ab67aea505511025c09ecf4560f8b1b";
hash = "sha256-VYmSHDde3zLq7NcsX7xp1JYe6x6RKFEravpakIzW390=";
};

postPatch = ''
substituteInPlace pyproject.toml \
--replace 'uvicorn = {extras = ["standard"], version = "^0.15.0"}' 'uvicorn = {version = "^0.15.0"}' \
--replace '"^' '">='
'';

Expand All @@ -31,7 +32,8 @@ python3.pkgs.buildPythonApplication rec {
typing-extensions
uvicorn
xsdata
];
]
++ uvicorn.optional-dependencies.standard;

checkInputs = with python3.pkgs; [
aiohttp
Expand Down

0 comments on commit bbe7562

Please sign in to comment.