Skip to content
Closed
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
26 changes: 22 additions & 4 deletions pkgs/development/python-modules/dataclasses-json/default.nix
Original file line number Diff line number Diff line change
@@ -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 = [
Expand All @@ -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";
Expand Down
48 changes: 38 additions & 10 deletions pkgs/development/python-modules/json-schema-for-humans/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
36 changes: 20 additions & 16 deletions pkgs/development/python-modules/libcst/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 ];
Expand Down
20 changes: 16 additions & 4 deletions pkgs/development/python-modules/typing-inspect/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, typing-extensions
, mypy-extensions
, isPy39
, pytestCheckHook
, typing-extensions
, pythonAtLeast
}:

buildPythonPackage rec {
Expand All @@ -16,16 +18,26 @@ buildPythonPackage rec {
sha256 = "1dzs9a1pr23dhbvmnvms2jv7l7jk26023g5ysf0zvnq8b791s6wg";
};

patches = lib.optional (pythonAtLeast "3.9") [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we apply this unconditionally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. I saw failures if the patch is applied to Python 3.7/3.8. Let me test again.

(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
};
}