diff options
author | Martin Weinelt <hexa@darmstadt.ccc.de> | 2022-03-05 20:53:04 +0100 |
---|---|---|
committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2022-03-14 00:29:05 +0100 |
commit | f4328208135ae44533b3f69a5dce571c7e850447 (patch) | |
tree | 7d16912732349c6b18d8bdf4211c6421ea85ba5b | |
parent | 98d4760be86d775e8c9665b2446d9080f3a7a381 (diff) |
python3Packages.tomli: 1.2.2 -> 2.0.1
https://github.com/hukkin/tomli/blob/2.0.1/CHANGELOG.md#201
3 files changed, 9 insertions, 62 deletions
diff --git a/pkgs/development/python-modules/tomli/default.nix b/pkgs/development/python-modules/tomli/default.nix index 551655eebf0d0..c9c9cb46b2c75 100644 --- a/pkgs/development/python-modules/tomli/default.nix +++ b/pkgs/development/python-modules/tomli/default.nix @@ -3,6 +3,7 @@ , callPackage , fetchFromGitHub , flit-core +, python # important downstream dependencies , flit @@ -13,40 +14,28 @@ buildPythonPackage rec { pname = "tomli"; - version = "1.2.2"; + version = "2.0.1"; format = "pyproject"; - outputs = [ - "out" - "testsout" - ]; - src = fetchFromGitHub { owner = "hukkin"; repo = pname; rev = version; - sha256 = "sha256-oDjpNzWxTaCC1+WyBKrkR6kp90ZomcZQfyW+xKddDoM="; + sha256 = "sha256-v0ZMrHIIaGeORwD4JiBeLthmnKZODK5odZVL0SY4etA="; }; - patches = [ - # required for mypy - ./fix-backwards-compatibility-load.patch - ]; - nativeBuildInputs = [ flit-core ]; - postInstall = '' - mkdir $testsout - cp -R benchmark/ pyproject.toml tests/ $testsout/ - ''; - pythonImportsCheck = [ "tomli" ]; - # check in passthru.tests.pytest to escape infinite recursion with setuptools-scm - doCheck = false; + checkPhase = '' + runHook preCheck + ${python.interpreter} -m unittest discover + runHook postCheck + ''; passthru.tests = { - pytest = callPackage ./tests.nix { }; + # test downstream dependencies inherit flit black mypy setuptools-scm; }; diff --git a/pkgs/development/python-modules/tomli/fix-backwards-compatibility-load.patch b/pkgs/development/python-modules/tomli/fix-backwards-compatibility-load.patch deleted file mode 100644 index edfc2f3834956..0000000000000 --- a/pkgs/development/python-modules/tomli/fix-backwards-compatibility-load.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/tomli/_parser.py b/tomli/_parser.py -index 89e81c3..6fb1bfd 100644 ---- a/tomli/_parser.py -+++ b/tomli/_parser.py -@@ -1,6 +1,6 @@ - import string - from types import MappingProxyType --from typing import Any, BinaryIO, Dict, FrozenSet, Iterable, NamedTuple, Optional, Tuple -+from typing import IO, Union, Any, BinaryIO, Dict, FrozenSet, Iterable, NamedTuple, Optional, Tuple - import warnings - - from tomli._re import ( -@@ -48,7 +48,7 @@ class TOMLDecodeError(ValueError): - """An error raised if a document is not valid TOML.""" - - --def load(fp: BinaryIO, *, parse_float: ParseFloat = float) -> Dict[str, Any]: -+def load(fp: Union[IO, BinaryIO], *, parse_float: ParseFloat = float) -> Dict[str, Any]: - """Parse TOML from a binary file object.""" - s_bytes = fp.read() - try: diff --git a/pkgs/development/python-modules/tomli/tests.nix b/pkgs/development/python-modules/tomli/tests.nix deleted file mode 100644 index 5d3d67dbd128c..0000000000000 --- a/pkgs/development/python-modules/tomli/tests.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ buildPythonPackage -, tomli -, pytestCheckHook -, python-dateutil -}: - -buildPythonPackage rec { - pname = "tomli-tests"; - inherit (tomli) version; - - src = tomli.testsout; - - dontBuild = true; - dontInstall = true; - - checkInputs = [ - pytestCheckHook - python-dateutil - tomli - ]; -} |