From 0dc785ebdf038dad98f8b8b4dcc5792c99f71f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Thu, 9 Nov 2023 12:24:53 +0100 Subject: [PATCH] fix: update pydantic version --- environment-dev.yml | 2 +- environment.yml | 2 +- htsinfer/htsinfer.py | 3 +-- tests/test_htsinfer.py | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/environment-dev.yml b/environment-dev.yml index 40f4f5f4..f8bcf898 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -13,7 +13,7 @@ dependencies: - pandas >=1.3.5, <1.4.0 - pip >=20.2.3 - pyahocorasick >=1.4.0 - - pydantic >=1.8.1, <2 + - pydantic >=2, <3 - pylint >=2.4.4 - pysam >=0.16.0 - pytest >=6.1.0 diff --git a/environment.yml b/environment.yml index 08e4fd28..273edbed 100644 --- a/environment.yml +++ b/environment.yml @@ -10,7 +10,7 @@ dependencies: - pandas >=1.3.5, <1.4.0 - pip >=20.2.3 - pyahocorasick >=1.4.0 - - pydantic >=1.8.1, <2 + - pydantic >=2, <3 - pysam >=0.16.0 - python >=3.8, <=3.10 - star >=2.7.6 diff --git a/htsinfer/htsinfer.py b/htsinfer/htsinfer.py index 9f2f6602..4967a4d9 100755 --- a/htsinfer/htsinfer.py +++ b/htsinfer/htsinfer.py @@ -315,8 +315,7 @@ def clean_up(self): def print(self): """Print results to STDOUT.""" sys.stdout.write( - self.config.results.json( + self.config.results.model_dump_json( indent=3, - sort_keys=False, ) + linesep ) diff --git a/tests/test_htsinfer.py b/tests/test_htsinfer.py index 0489023b..ea6e65f7 100644 --- a/tests/test_htsinfer.py +++ b/tests/test_htsinfer.py @@ -305,7 +305,7 @@ def test_clean_up_keep_none(self, tmpdir): def test_clean_up_keep_results(self, tmpdir): """Remove temporary data.""" arguments = Args(path_1=FILE_MATE_1, - out_dir=tmpdir, + out_dir=tmpdir.strpath, tmpdir=tmpdir, ) results = Results() @@ -323,8 +323,8 @@ def test_clean_up_keep_results(self, tmpdir): def test_clean_up_keep_all(self, tmpdir): """Remove no data.""" arguments = Args(path_1=FILE_MATE_1, - out_dir=tmpdir, - tmpdir=tmpdir, + out_dir=tmpdir.strpath, + tmpdir=tmpdir.strpath, ) results = Results() configs = Config(