diff --git a/pkgs/development/python-modules/dependency-injector/default.nix b/pkgs/development/python-modules/dependency-injector/default.nix index 9c977ecc5f0..8958566070e 100644 --- a/pkgs/development/python-modules/dependency-injector/default.nix +++ b/pkgs/development/python-modules/dependency-injector/default.nix @@ -1,27 +1,53 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k, six, unittest2, pyyaml, flask }: - -let - testPath = - if isPy3k - then "test_*_py3.py" - else "test_*_py2_py3.py"; -in +{ lib +, aiohttp +, buildPythonPackage +, fastapi +, fetchFromGitHub +, flask +, httpx +, mypy-boto3-s3 +, numpy +, scipy +, pydantic +, pytestCheckHook +, pyyaml +, six +}: buildPythonPackage rec { pname = "dependency-injector"; - version = "4.31.1"; + version = "4.32.2"; - src = fetchPypi { - inherit pname version; - sha256 = "b6b28b9571f44d575367c6005ba8aaa9fd2b70310e1c15410925d6f1ee2769ad"; + src = fetchFromGitHub { + owner = "ets-labs"; + repo = "python-dependency-injector"; + rev = version; + sha256 = "1gkkka0hl2hl4axf3gfm58mzv92bg0frr5jikw8g32hd4q4aagcg"; }; - propagatedBuildInputs = [ six ]; - checkInputs = [ unittest2 pyyaml flask ]; + propagatedBuildInputs = [ + six + ]; - checkPhase = '' - unit2 discover -s tests/unit -p "${testPath}" - ''; + checkInputs = [ + aiohttp + fastapi + flask + httpx + mypy-boto3-s3 + numpy + pydantic + scipy + pytestCheckHook + pyyaml + ]; + + disabledTestPaths = [ + # There is no unique identifier to disable the one failing test + "tests/unit/ext/test_aiohttp_py35.py" + ]; + + pythonImportsCheck = [ "dependency_injector" ]; meta = with lib; { description = "Dependency injection microframework for Python"; diff --git a/pkgs/development/python-modules/fpyutils/default.nix b/pkgs/development/python-modules/fpyutils/default.nix new file mode 100644 index 00000000000..0120391aee1 --- /dev/null +++ b/pkgs/development/python-modules/fpyutils/default.nix @@ -0,0 +1,46 @@ +{ lib +, atomicwrites +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, requests +}: + +buildPythonPackage rec { + pname = "fpyutils"; + version = "2.0.0"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "frnmst"; + repo = pname; + rev = version; + sha256 = "1n15fvd6191ixxsza49fdd8j43hs0agagg8k9v6rc7by1ffqnl2b"; + }; + + propagatedBuildInputs = [ + atomicwrites + requests + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "fpyutils/tests/*.py" ]; + + disabledTests = [ + # Don't run test which requires bash + "test_execute_command_live_output" + ]; + + pythonImportsCheck = [ "fpyutils" ]; + + meta = with lib; { + description = "Collection of useful non-standard Python functions"; + homepage = "https://github.com/frnmst/fpyutils"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/md-toc/default.nix b/pkgs/development/python-modules/md-toc/default.nix new file mode 100644 index 00000000000..aaec77a9ace --- /dev/null +++ b/pkgs/development/python-modules/md-toc/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fpyutils +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "md-toc"; + version = "7.2.0"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "frnmst"; + repo = pname; + rev = version; + sha256 = "1v74iddfk5d6170frg89vzrkz9xrycl1f50g59imc7x7g50i6c2x"; + }; + + propagatedBuildInputs = [ + fpyutils + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.py --replace "fpyutils>=1.2,<1.3" "fpyutils>=1.2" + ''; + + pytestFlagsArray = [ "md_toc/tests/*.py" ]; + + pythonImportsCheck = [ "md_toc" ]; + + meta = with lib; { + description = "Table of contents generator for Markdown"; + homepage = "https://docs.franco.net.eu.org/md-toc/"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/mdformat/default.nix b/pkgs/development/python-modules/mdformat/default.nix new file mode 100644 index 00000000000..159310035b8 --- /dev/null +++ b/pkgs/development/python-modules/mdformat/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, importlib-metadata +, markdown-it-py +, poetry-core +, pytestCheckHook +, pythonOlder +, typing-extensions +}: + +buildPythonPackage rec { + pname = "mdformat"; + version = "0.7.6"; + format = "pyproject"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "executablebooks"; + repo = pname; + rev = version; + sha256 = "0mnbi3vp7zgllpcpf6vrjw9y6jas95shphn99ayr8b8wgxsaqkif"; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + markdown-it-py + ] ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ] ++ lib.optionals (pythonOlder "3.7") [ + typing-extensions + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "mdformat" ]; + + meta = with lib; { + description = "CommonMark compliant Markdown formatter"; + homepage = "https://mdformat.rtfd.io/"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/mypy-boto3-builder/default.nix b/pkgs/development/python-modules/mypy-boto3-builder/default.nix new file mode 100644 index 00000000000..860646af9c6 --- /dev/null +++ b/pkgs/development/python-modules/mypy-boto3-builder/default.nix @@ -0,0 +1,49 @@ +{ lib +, black +, boto3 +, buildPythonPackage +, fetchFromGitHub +, jinja2 +, md-toc +, isort +, mdformat +, pyparsing +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mypy-boto3-builder"; + version = "4.12.0"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "vemel"; + repo = "mypy_boto3_builder"; + rev = version; + sha256 = "09kbmrpnph5kbxlqqavpxg3l85dmk3vzmwawa4s09y9gknxxkcv9"; + }; + + propagatedBuildInputs = [ + black + boto3 + isort + jinja2 + md-toc + mdformat + pyparsing + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "mypy_boto3_builder" ]; + + meta = with lib; { + description = "Type annotations builder for boto3"; + homepage = "https://vemel.github.io/mypy_boto3_builder/"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/mypy-boto3-s3/default.nix b/pkgs/development/python-modules/mypy-boto3-s3/default.nix new file mode 100644 index 00000000000..af97c5e103f --- /dev/null +++ b/pkgs/development/python-modules/mypy-boto3-s3/default.nix @@ -0,0 +1,35 @@ +{ lib +, boto3 +, buildPythonPackage +, fetchPypi +, pythonOlder +, typing-extensions +}: + +buildPythonPackage rec { + pname = "mypy-boto3-s3"; + version = "1.17.71"; + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "0zgx3f41j80xy203jwms7j72svxy10ry5v9w3ql817ai4lcrspnn"; + }; + + propagatedBuildInputs = [ + boto3 + ] ++ lib.optionals (pythonOlder "3.8") [ + typing-extensions + ]; + + # Project has no tests + doCheck = false; + pythonImportsCheck = [ "mypy_boto3_s3" ]; + + meta = with lib; { + description = "Type annotations for boto3"; + homepage = "https://vemel.github.io/boto3_stubs_docs/mypy_boto3_s3/"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 54feeb8001f..c7d9f32ab6f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2565,6 +2565,8 @@ in { fpylll = callPackage ../development/python-modules/fpylll { }; + fpyutils = callPackage ../development/python-modules/fpyutils { }; + freebox-api = callPackage ../development/python-modules/freebox-api { }; freetype-py = callPackage ../development/python-modules/freetype-py { }; @@ -4121,8 +4123,12 @@ in { mcstatus = callPackage ../development/python-modules/mcstatus { }; + md-toc = callPackage ../development/python-modules/md-toc { }; + md2gemini = callPackage ../development/python-modules/md2gemini { }; + mdformat = callPackage ../development/python-modules/mdformat { }; + mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; MDP = callPackage ../development/python-modules/mdp { }; @@ -4367,6 +4373,10 @@ in { mypy = callPackage ../development/python-modules/mypy { }; + mypy-boto3-builder = callPackage ../development/python-modules/mypy-boto3-builder { }; + + mypy-boto3-s3 = callPackage ../development/python-modules/mypy-boto3-s3 { }; + mypy-extensions = callPackage ../development/python-modules/mypy/extensions.nix { }; mypy-protobuf = callPackage ../development/python-modules/mypy-protobuf { };