From 6723770b5d2caa3b914ce424533f81ae253b8b9a Mon Sep 17 00:00:00 2001 From: Jay Qi Date: Mon, 31 Jul 2023 11:27:54 -0400 Subject: [PATCH 1/3] Fix flake8 errors --- cloudpathlib/cloudpath.py | 2 +- tests/test_local.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudpathlib/cloudpath.py b/cloudpathlib/cloudpath.py index 898eaf0b..8fede295 100644 --- a/cloudpathlib/cloudpath.py +++ b/cloudpathlib/cloudpath.py @@ -559,7 +559,7 @@ def _patched_close_empty_cache(*args, **kwargs): return buffer def replace(self, target: Self) -> Self: - if type(self) != type(target): + if type(self) is type(target): raise TypeError( f"The target based to rename must be an instantiated class of type: {type(self)}" ) diff --git a/tests/test_local.py b/tests/test_local.py index 32b730dc..e14a8586 100644 --- a/tests/test_local.py +++ b/tests/test_local.py @@ -36,7 +36,7 @@ def test_interface(cloud_class, local_class): cloud_attr = getattr(cloud_class, attr_name) local_attr = getattr(local_class, attr_name) - assert type(cloud_attr) == type(local_attr) + assert type(cloud_attr) is type(local_attr) if callable(cloud_attr): assert signature(cloud_attr).parameters == signature(local_attr).parameters From e1c63770f3be4b67572af20ce497c9c2dd0ad75a Mon Sep 17 00:00:00 2001 From: Jay Qi Date: Mon, 31 Jul 2023 11:34:32 -0400 Subject: [PATCH 2/3] Fix wrong comparison --- cloudpathlib/cloudpath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudpathlib/cloudpath.py b/cloudpathlib/cloudpath.py index 8fede295..401f9775 100644 --- a/cloudpathlib/cloudpath.py +++ b/cloudpathlib/cloudpath.py @@ -559,7 +559,7 @@ def _patched_close_empty_cache(*args, **kwargs): return buffer def replace(self, target: Self) -> Self: - if type(self) is type(target): + if type(self) is not type(target): raise TypeError( f"The target based to rename must be an instantiated class of type: {type(self)}" ) From 8f5ed600906e29600af23b5263f2ac778943f995 Mon Sep 17 00:00:00 2001 From: Jay Qi Date: Mon, 31 Jul 2023 11:52:03 -0400 Subject: [PATCH 3/3] Bump codecov action version; add codecov token --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9feeb7c3..6918cf64 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,8 +76,9 @@ jobs: - name: Upload coverage to codecov if: matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml fail_ci_if_error: true