diff --git a/pkgs/development/python-modules/dataclasses-json/default.nix b/pkgs/development/python-modules/dataclasses-json/default.nix index 36430a29ef0f0..4a2a410c4ad5f 100644 --- a/pkgs/development/python-modules/dataclasses-json/default.nix +++ b/pkgs/development/python-modules/dataclasses-json/default.nix @@ -1,18 +1,23 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , stringcase , typing-inspect , marshmallow-enum +, hypothesis +, mypy +, pytestCheckHook }: buildPythonPackage rec { pname = "dataclasses-json"; version = "0.5.2"; - src = fetchPypi { - inherit pname version; - sha256 = "56ec931959ede74b5dedf65cf20772e6a79764d20c404794cce0111c88c085ff"; + src = fetchFromGitHub { + owner = "lidatong"; + repo = pname; + rev = "v${version}"; + sha256 = "1gcnm41rwg0jvq4vhr57vv9hyasws425zl8h4p05x2nzq86l0w1n"; }; propagatedBuildInputs = [ @@ -21,6 +26,19 @@ buildPythonPackage rec { marshmallow-enum ]; + checkInputs = [ + hypothesis + mypy + pytestCheckHook + ]; + + disabledTests = [ + # AssertionError: Type annotations check failed + "test_type_hints" + ]; + + pythonImportsCheck = [ "dataclasses_json" ]; + meta = with lib; { description = "Simple API for encoding and decoding dataclasses to and from JSON"; homepage = "https://github.com/lidatong/dataclasses-json"; diff --git a/pkgs/development/python-modules/json-schema-for-humans/default.nix b/pkgs/development/python-modules/json-schema-for-humans/default.nix index 4e762e456ceb5..085f290d5d4ce 100644 --- a/pkgs/development/python-modules/json-schema-for-humans/default.nix +++ b/pkgs/development/python-modules/json-schema-for-humans/default.nix @@ -1,35 +1,63 @@ -{ lib, buildPythonPackage, fetchFromGitHub -, pbr, click, dataclasses-json, htmlmin, jinja2, markdown2, pygments, pytz, pyyaml, requests, pytestCheckHook, beautifulsoup4, tox +{ lib +, beautifulsoup4 +, buildPythonPackage +, click +, dataclasses-json +, fetchFromGitHub +, htmlmin +, jinja2 +, markdown2 +, pbr +, pygments +, pytz +, pyyaml +, requests }: buildPythonPackage rec { pname = "json-schema-for-humans"; - version = "0.27.1"; + version = "0.31.0"; src = fetchFromGitHub { owner = "coveooss"; repo = pname; rev = "v${version}"; - sha256 = "0d2a4a2lcqssr5g9rmc76f86nkqc9grixh507vzc9fi1h3gbi765"; + sha256 = "1aj1w0qxdw8d6mf5vngk0xjgs7z8vzwc2aycahnkqg7q3cagq19n"; }; nativeBuildInputs = [ pbr ]; + propagatedBuildInputs = [ - click dataclasses-json htmlmin jinja2 markdown2 - pygments pytz pyyaml requests + click + dataclasses-json + htmlmin + jinja2 + markdown2 + pygments + pytz + pyyaml + requests ]; preBuild = '' export PBR_VERSION=0.0.1 ''; - checkInputs = [ pytestCheckHook beautifulsoup4 ]; - pytestFlagsArray = [ "--ignore tests/generate_test.py" ]; + checkInputs = [ + beautifulsoup4 + ]; + + disabledTests = [ + # Tests require network access + "test_references_url" + ]; + + pythonImportsCheck = [ "json_schema_for_humans" ]; meta = with lib; { description = "Quickly generate HTML documentation from a JSON schema"; - homepage = "https://github.com/coveooss/json-schema-for-humans"; - license = licenses.asl20; + homepage = "https://github.com/coveooss/json-schema-for-humans"; + license = licenses.asl20; maintainers = with maintainers; [ astro ]; }; } diff --git a/pkgs/development/python-modules/libcst/default.nix b/pkgs/development/python-modules/libcst/default.nix index ed6e7755bf150..643d3f2502cf9 100644 --- a/pkgs/development/python-modules/libcst/default.nix +++ b/pkgs/development/python-modules/libcst/default.nix @@ -1,21 +1,19 @@ { lib , buildPythonPackage +, dataclasses , fetchFromGitHub -, pythonOlder , hypothesis -, dataclasses -, hypothesmith , pytestCheckHook +, pythonOlder , pyyaml , typing-extensions , typing-inspect -, black -, isort }: buildPythonPackage rec { pname = "libcst"; version = "0.3.18"; + disabled = pythonOlder "3.6"; # Some files for tests missing from PyPi # https://github.com/Instagram/LibCST/issues/331 @@ -26,25 +24,31 @@ buildPythonPackage rec { sha256 = "sha256-19yGaKBLpGASSPv/aSX0kx9lh2JxKExHJDKKtuBbuqI="; }; - disabled = pythonOlder "3.6"; - - propagatedBuildInputs = [ hypothesis typing-extensions typing-inspect pyyaml ] - ++ lib.optional (pythonOlder "3.7") dataclasses; + propagatedBuildInputs = [ + hypothesis + typing-extensions + typing-inspect + pyyaml + ] ++ lib.optional (pythonOlder "3.7") dataclasses; - checkInputs = [ black hypothesmith isort pytestCheckHook ]; - - # can't run tests due to circular dependency on hypothesmith -> licst - doCheck = false; + checkInputs = [ + pytestCheckHook + ]; preCheck = '' - python -m libcst.codegen.generate visitors - python -m libcst.codegen.generate return_types + # Can't run tests due to circular dependency on hypothesmith -> libcst + rm -r {libcst/tests,libcst/codegen/tests,libcst/m*/tests} ''; + disabledTests = [ + # No files are generated + "test_codemod_formatter_error_input" + ]; + pythonImportsCheck = [ "libcst" ]; meta = with lib; { - description = "A Concrete Syntax Tree (CST) parser and serializer library for Python."; + description = "Concrete Syntax Tree (CST) parser and serializer library for Python"; homepage = "https://github.com/Instagram/libcst"; license = with licenses; [ mit asl20 psfl ]; maintainers = with maintainers; [ ruuda SuperSandro2000 ]; diff --git a/pkgs/development/python-modules/typing-inspect/default.nix b/pkgs/development/python-modules/typing-inspect/default.nix index 569096cb466c4..63a116253d89c 100644 --- a/pkgs/development/python-modules/typing-inspect/default.nix +++ b/pkgs/development/python-modules/typing-inspect/default.nix @@ -1,9 +1,11 @@ { lib , buildPythonPackage +, fetchpatch , fetchPypi -, typing-extensions , mypy-extensions -, isPy39 +, pytestCheckHook +, typing-extensions +, pythonAtLeast }: buildPythonPackage rec { @@ -16,16 +18,26 @@ buildPythonPackage rec { sha256 = "1dzs9a1pr23dhbvmnvms2jv7l7jk26023g5ysf0zvnq8b791s6wg"; }; + patches = lib.optional (pythonAtLeast "3.9") [ + (fetchpatch { + name = "fix-for-py39.patch"; + url = "https://github.com/ilevkivskyi/typing_inspect/commit/16919e21936179e53df2f376c8b59b5fc44bd2dd.patch"; + sha256 = "17gvha4z685q04lvy8r0xhddhvqh1bfk1avs5jqbwislpsd83396"; + }) + ]; + propagatedBuildInputs = [ - typing-extensions mypy-extensions + pytestCheckHook + typing-extensions ]; + pythonImportsCheck = [ "typing_inspect" ]; + meta = with lib; { description = "Runtime inspection utilities for Python typing module"; homepage = "https://github.com/ilevkivskyi/typing_inspect"; license = licenses.mit; maintainers = with maintainers; [ albakham ]; - broken = isPy39; # see https://github.com/ilevkivskyi/typing_inspect/issues/65 }; }