From d93ba52a1a2e4aaac1e5806aabe617a5903f69bb Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 2 Oct 2024 08:56:28 -0400 Subject: [PATCH 1/5] update pre-commit hooks --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc1c51042..cee4abede 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: text-unicode-replacement-char - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell args: ["--write-changes"] @@ -43,22 +43,22 @@ repos: exclude: "asdf/(extern||_jsonschema)/.*" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.3.5' + rev: 'v0.6.8' hooks: - id: ruff args: ["--fix"] - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: '1.16.0' + rev: '1.18.0' hooks: - id: blacken-docs - repo: https://github.com/abravalheri/validate-pyproject - rev: "v0.16" + rev: "v0.20.2" hooks: - id: validate-pyproject From c93a8552f008708c99d5ed6d24f39264f1756461 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 2 Oct 2024 08:57:24 -0400 Subject: [PATCH 2/5] fix spelling --- asdf/extension/_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asdf/extension/_manager.py b/asdf/extension/_manager.py index cb6a10d2c..d02b35600 100644 --- a/asdf/extension/_manager.py +++ b/asdf/extension/_manager.py @@ -82,7 +82,7 @@ def __init__(self, extensions): # imported. We don't want to do this unnecessarily and since # class instances do not contain the public class path # we adopt a strategy of checking class paths and only - # registering those that have already been imported. Thiss + # registering those that have already been imported. This # is ok because asdf will only use the converter type # when attempting to serialize an object in memory (so the # public class path will already be imported at the time From dff7d56df64d72b4694d19b5b4c2d72a2ba95414 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 2 Oct 2024 08:59:06 -0400 Subject: [PATCH 3/5] remove unused variable --- asdf/_tests/test_file_format.py | 1 - 1 file changed, 1 deletion(-) diff --git a/asdf/_tests/test_file_format.py b/asdf/_tests/test_file_format.py index 954da0721..16f0aad48 100644 --- a/asdf/_tests/test_file_format.py +++ b/asdf/_tests/test_file_format.py @@ -22,7 +22,6 @@ def test_no_yaml_end_marker(tmp_path): pass buff.seek(0) - fd = generic_io.InputStream(buff, "r") with pytest.raises(ValueError, match=r"End of YAML marker not found"), asdf.open(buff): pass From 0dc5836605e17d76e6e06f8ee21bdd53aa7f520b Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 2 Oct 2024 09:02:12 -0400 Subject: [PATCH 4/5] switch type comparisons to is --- asdf/_tests/test_lazy_nodes.py | 2 +- asdf/_tests/test_tagged.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/asdf/_tests/test_lazy_nodes.py b/asdf/_tests/test_lazy_nodes.py index fa8a9fd60..6d242d121 100644 --- a/asdf/_tests/test_lazy_nodes.py +++ b/asdf/_tests/test_lazy_nodes.py @@ -119,7 +119,7 @@ def test_node_inheritance(NodeClass, data, base): ) def test_node_empty_init(NodeClass, base): node = NodeClass() - assert type(node.tagged) == base + assert type(node.tagged) is base @pytest.mark.parametrize( diff --git a/asdf/_tests/test_tagged.py b/asdf/_tests/test_tagged.py index a98de2790..9c8298b32 100644 --- a/asdf/_tests/test_tagged.py +++ b/asdf/_tests/test_tagged.py @@ -43,7 +43,7 @@ def test_tagged_list_base(): assert isinstance(value.base, list) assert not isinstance(value.base, TaggedList) - assert value.base.__class__ == list + assert value.base.__class__ is list def test_tagged_dict_deepcopy(): @@ -83,7 +83,7 @@ def test_tagged_dict_base(): assert isinstance(value.base, dict) assert not isinstance(value.base, TaggedDict) - assert value.base.__class__ == dict + assert value.base.__class__ is dict def test_tagged_string_deepcopy(): @@ -116,7 +116,7 @@ def test_tagged_string_base(): assert isinstance(value.base, str) assert not isinstance(value.base, TaggedString) - assert value.base.__class__ == str + assert value.base.__class__ is str ASDF_UNIT_TAG = "stsci.edu:asdf/unit/unit-1.0.0" From e83643689f933c184a3b1807ef6f9f3230e8e365 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 2 Oct 2024 09:12:09 -0400 Subject: [PATCH 5/5] drop scipy dev dep --- requirements-dev.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b9fdd75fb..1ddb3871d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,3 @@ git+https://github.com/yaml/pyyaml.git git+https://github.com/python-attrs/attrs numpy>=0.0.dev0 -# although we don't use scipy, we include it here so that any dependency -# that uses it during these tests will use the development version -# which is more likely to work with the above development version of numpy -scipy>=0.0.dev0