From 172eb99f404dda69b5648f492ac4ea02ecb824d0 Mon Sep 17 00:00:00 2001 From: balajtimate <51365402+balajtimate@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:12:15 +0100 Subject: [PATCH] fix: update Pydantic version (#146) * fix pydantic issues * fix: update pydantic version in envs * fix: pin sphinx-rtd-theme into env * fix: update readthedocs config --- .readthedocs.yaml | 2 +- environment-dev.yml | 5 +++-- environment.yml | 2 +- htsinfer/htsinfer.py | 3 +-- tests/test_htsinfer.py | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 14c41f2e..0922ec04 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -13,4 +13,4 @@ formats: - pdf - epub conda: - environment: environment.yml + environment: environment-dev.yml diff --git a/environment-dev.yml b/environment-dev.yml index 40f4f5f4..c97c611a 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -13,12 +13,13 @@ 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 - python >=3.8, <=3.10 + - python-semantic-release >=8 + - sphinx-rtd-theme - star >=2.7.6 - pip: - - python-semantic-release>=7.15.0 - -e . 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(