Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonPackages.connexion #52580

Merged
merged 4 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions pkgs/development/python-modules/aiohttp-swagger/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, aiohttp
, flake8
, jinja2
, pytestCheckHook
, pytest-aiohttp
, pyyaml
}:

buildPythonPackage rec {
pname = "aiohttp-swagger";
version = "1.0.5";

elohmeier marked this conversation as resolved.
Show resolved Hide resolved
src = fetchFromGitHub {
owner = "cr0hn";
repo = pname;
rev = "5a59e86f8c5672d2cc97dd35dc730c2f809d95ce"; # corresponds to 1.0.5 on PyPi, no tag on GitHub
sha256 = "1vpfk5b3f7s9qzr2q48g776f39xzqppjwm57scfzqqmbldkk5nv7";
};

propagatedBuildInputs = [ aiohttp jinja2 pyyaml ];

checkInputs = [ flake8 pytestCheckHook pytest-aiohttp ];

meta = with lib; {
description = "Swagger API Documentation builder for aiohttp";
homepage = https://github.com/cr0hn/aiohttp-swagger;
license = licenses.mit;
maintainers = with maintainers; [ elohmeier ];
};
}
28 changes: 28 additions & 0 deletions pkgs/development/python-modules/clickclick/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ stdenv, lib, buildPythonPackage, fetchFromGitHub, isPy36, flake8, click, pyyaml, six, pytestCheckHook, pytestcov }:

buildPythonPackage rec {
pname = "clickclick";
version = "1.2.2";

elohmeier marked this conversation as resolved.
Show resolved Hide resolved
src = fetchFromGitHub {
elohmeier marked this conversation as resolved.
Show resolved Hide resolved
owner = "hjacobs";
repo = "python-clickclick";
rev = version;
sha256 = "1rij9ws9nhsmagiy1vclzliiqfkxi006rf65qvrw1k3sm2s8p5g0";
};

checkInputs = [ pytestCheckHook pytestcov ];
propagatedBuildInputs = [ flake8 click pyyaml six ];

disabledTests = lib.optionals isPy36 [
"test_cli"
"test_choice_default"
];

meta = with stdenv.lib; {
description = "Click command line utilities";
homepage = https://github.com/hjacobs/python-clickclick/;
license = licenses.asl20;
maintainers = with maintainers; [ elohmeier ];
};
}
94 changes: 94 additions & 0 deletions pkgs/development/python-modules/connexion/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{ buildPythonPackage
, fetchFromGitHub
, isPy3k
, glibcLocales
, lib
, pythonOlder

, aiohttp
, aiohttp-swagger
, aiohttp-jinja2
, clickclick
, decorator
, flake8
, flask
, gevent
, inflection
, jsonschema
, mock
, openapi-spec-validator
, pathlib
, pytest
, pytest-aiohttp
, pytestcov
, pyyaml
, requests
, six
, swagger-ui-bundle
, testfixtures
, typing
, ujson
}:

buildPythonPackage rec {
pname = "connexion";
version = "2.3.0";

# we're fetching from GitHub because tests weren't distributed on PyPi
src = fetchFromGitHub {
owner = "zalando";
repo = pname;
rev = version;
sha256 = "1xdm3misxwgrl87ms0vvn0h4rjwzlmmi7kcra2ahs40iaraf33ln";
};

checkInputs = [
decorator
mock
pytest
pytestcov
testfixtures
flask
swagger-ui-bundle
]
++ lib.optionals isPy3k [ aiohttp aiohttp-jinja2 aiohttp-swagger ujson pytest-aiohttp ]
++ lib.optional (pythonOlder "3.7") glibcLocales
;
propagatedBuildInputs = [
elohmeier marked this conversation as resolved.
Show resolved Hide resolved
clickclick
jsonschema
pyyaml
requests
six
inflection
openapi-spec-validator
swagger-ui-bundle
flask
]
++ lib.optional (pythonOlder "3.4") pathlib
++ lib.optional (pythonOlder "3.6") typing
++ lib.optionals isPy3k [ aiohttp aiohttp-jinja2 aiohttp-swagger ujson ]
;

preConfigure = lib.optional (pythonOlder "3.7") ''
export LANG=en_US.UTF-8
'';

postPatch = ''
substituteInPlace setup.py --replace "'aiohttp>=2.3.10,<3.5.2'" "'aiohttp>=2.3.10'"
'';

checkPhase = if isPy3k then ''
pytest -k "not test_app_get_root_path and \
not test_verify_oauth_scopes_remote and \
not test_verify_oauth_scopes_local and \
not test_run_with_aiohttp_not_installed"''
else "pytest --ignore=tests/aiohttp";

meta = with lib; {
description = "Swagger/OpenAPI First framework on top of Flask";
homepage = https://github.com/zalando/connexion/;
license = licenses.asl20;
maintainers = with maintainers; [ elohmeier ];
};
}
29 changes: 29 additions & 0 deletions pkgs/development/python-modules/swagger-ui-bundle/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ stdenv, buildPythonPackage, fetchPypi, jinja2, flake8 }:

buildPythonPackage rec {
pname = "swagger-ui-bundle";
version = "0.0.5";

src = fetchPypi {
pname = "swagger_ui_bundle";
inherit version;
sha256 = "0v69v94mzzb63ciwpz3n8jwxqcyll3fsyx087s9k9q543zdqzbh1";
};

# patch away unused test requirements since package contains no tests
postPatch = ''
substituteInPlace setup.py --replace "setup_requires=['pytest-runner', 'flake8']" "setup_requires=[]"
'';

propagatedBuildInputs = [ jinja2 ];

# package contains no tests
doCheck = false;
elohmeier marked this conversation as resolved.
Show resolved Hide resolved

meta = with stdenv.lib; {
description = "bundled swagger-ui pip package";
homepage = https://github.com/dtkav/swagger_ui_bundle;
license = licenses.asl20;
maintainers = with maintainers; [ elohmeier ];
};
}
8 changes: 8 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,14 @@ in {

clifford = callPackage ../development/python-modules/clifford { };

clickclick = callPackage ../development/python-modules/clickclick { };

clustershell = callPackage ../development/python-modules/clustershell { };

cnvkit = callPackage ../development/python-modules/cnvkit { };

connexion = callPackage ../development/python-modules/connexion { };

cozy = callPackage ../development/python-modules/cozy { };

codespell = callPackage ../development/python-modules/codespell { };
Expand Down Expand Up @@ -1305,6 +1309,8 @@ in {

aiohttp-socks = callPackage ../development/python-modules/aiohttp-socks { };

aiohttp-swagger = callPackage ../development/python-modules/aiohttp-swagger { };

aioprocessing = callPackage ../development/python-modules/aioprocessing { };

aioresponses = callPackage ../development/python-modules/aioresponses { };
Expand Down Expand Up @@ -2816,6 +2822,8 @@ in {

starfish = callPackage ../development/python-modules/starfish { };

swagger-ui-bundle = callPackage ../development/python-modules/swagger-ui-bundle { };

multi_key_dict = callPackage ../development/python-modules/multi_key_dict { };

random2 = callPackage ../development/python-modules/random2 { };
Expand Down