From 3862c1c962108404aa4915480990b68a13b3d735 Mon Sep 17 00:00:00 2001 From: Aaron Coburn Date: Tue, 1 Mar 2022 19:11:42 -0500 Subject: [PATCH 1/8] Use more recent python versions --- .github/workflows/ci-config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-config.yml b/.github/workflows/ci-config.yml index 738294f..1028058 100644 --- a/.github/workflows/ci-config.yml +++ b/.github/workflows/ci-config.yml @@ -13,12 +13,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.4, 3.5, 3.6, 3.7, 3.8] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} From bf0b8b39f997ed26187d2314c2ebe8a960a4772b Mon Sep 17 00:00:00 2001 From: Aaron Coburn Date: Tue, 1 Mar 2022 19:14:25 -0500 Subject: [PATCH 2/8] Update matrix values --- .github/workflows/ci-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-config.yml b/.github/workflows/ci-config.yml index 1028058..29ecde0 100644 --- a/.github/workflows/ci-config.yml +++ b/.github/workflows/ci-config.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 From 63eea0b1d292b1eadda7c1e525e223e34d3035e9 Mon Sep 17 00:00:00 2001 From: Aaron Coburn Date: Tue, 1 Mar 2022 19:16:38 -0500 Subject: [PATCH 3/8] Update version matrix --- .github/workflows/ci-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-config.yml b/.github/workflows/ci-config.yml index 29ecde0..294dc84 100644 --- a/.github/workflows/ci-config.yml +++ b/.github/workflows/ci-config.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v3 From 67d35707a26aa691134535ade3cff24ba0415572 Mon Sep 17 00:00:00 2001 From: Aaron Coburn Date: Tue, 1 Mar 2022 19:26:01 -0500 Subject: [PATCH 4/8] limit version range --- .github/workflows/ci-config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-config.yml b/.github/workflows/ci-config.yml index 294dc84..6dca4db 100644 --- a/.github/workflows/ci-config.yml +++ b/.github/workflows/ci-config.yml @@ -13,12 +13,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.8'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} From e51bd1ecb218afcc761aa93a6c32b8dd54f4d0db Mon Sep 17 00:00:00 2001 From: Aaron Coburn Date: Tue, 1 Mar 2022 19:34:21 -0500 Subject: [PATCH 5/8] Fix deprecation warnings --- tests/test_consumer.py | 8 ++++---- tests/test_sender.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_consumer.py b/tests/test_consumer.py index ecd395b..eb8fa80 100644 --- a/tests/test_consumer.py +++ b/tests/test_consumer.py @@ -91,11 +91,11 @@ def test_notification_turtle(self, mock_get): notification = Consumer().notification("http://example.org/inbox/1") self.assertTrue(1, len(notification)) self.assertTrue("@id" in notification[0]) - self.assertEquals("http://example.org/inbox/1", notification[0]["@id"]) + self.assertEqual("http://example.org/inbox/1", notification[0]["@id"]) prefLabel = "http://www.w3.org/2004/02/skos/core#prefLabel" self.assertTrue(prefLabel in notification[0]) - self.assertEquals("First notification", + self.assertEqual("First notification", notification[0][prefLabel][0]["@value"]) @patch('requests.get') @@ -111,7 +111,7 @@ def test_notification_jsonld(self, mock_get): notification = Consumer().notification("http://example.org/inbox/1") self.assertTrue(1, len(notification)) self.assertTrue("@id" in notification[0]) - self.assertEquals("http://example.org/inbox/1", notification[0]["@id"]) + self.assertEqual("http://example.org/inbox/1", notification[0]["@id"]) self.assertTrue("creator" in notification[0]) - self.assertEquals("http://example.org/user", + self.assertEqual("http://example.org/user", notification[0]["creator"]) diff --git a/tests/test_sender.py b/tests/test_sender.py index 5583255..b0edf34 100644 --- a/tests/test_sender.py +++ b/tests/test_sender.py @@ -18,7 +18,7 @@ def test_send_string(self, mock_post): data = f.read() Sender().send(self.INBOX, data) - self.assertEquals(str, type(data)) + self.assertEqual(str, type(data)) mock_post.assert_called_once_with(self.INBOX, data=data, headers=self.HEADERS) @@ -29,7 +29,7 @@ def test_send_dict(self, mock_post): data = json.loads(f.read()) Sender().send(self.INBOX, data) - self.assertEquals(dict, type(data)) + self.assertEqual(dict, type(data)) mock_post.assert_called_once_with(self.INBOX, data=json.dumps(data), headers=self.HEADERS) @@ -40,7 +40,7 @@ def test_send_list(self, mock_post): data = json.loads("[" + f.read() + "]") Sender().send(self.INBOX, data) - self.assertEquals(list, type(data)) + self.assertEqual(list, type(data)) mock_post.assert_called_once_with(self.INBOX, data=json.dumps(data), headers=self.HEADERS) @@ -49,6 +49,6 @@ def test_send_graph(self, mock_post): data = Graph().parse("tests/notification.nt", format="ntriples") Sender().send(self.INBOX, data) - self.assertEquals(Graph, type(data)) + self.assertEqual(Graph, type(data)) mock_post.assert_called_once_with(self.INBOX, data=data.serialize( format="application/ld+json"), headers=self.HEADERS) From 8c57856be53eff5b811a293e879b2f32121becc8 Mon Sep 17 00:00:00 2001 From: Aaron Coburn Date: Tue, 1 Mar 2022 19:36:27 -0500 Subject: [PATCH 6/8] Formatting --- tests/test_consumer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_consumer.py b/tests/test_consumer.py index eb8fa80..375cd6b 100644 --- a/tests/test_consumer.py +++ b/tests/test_consumer.py @@ -96,7 +96,7 @@ def test_notification_turtle(self, mock_get): prefLabel = "http://www.w3.org/2004/02/skos/core#prefLabel" self.assertTrue(prefLabel in notification[0]) self.assertEqual("First notification", - notification[0][prefLabel][0]["@value"]) + notification[0][prefLabel][0]["@value"]) @patch('requests.get') def test_notification_jsonld(self, mock_get): @@ -114,4 +114,4 @@ def test_notification_jsonld(self, mock_get): self.assertEqual("http://example.org/inbox/1", notification[0]["@id"]) self.assertTrue("creator" in notification[0]) self.assertEqual("http://example.org/user", - notification[0]["creator"]) + notification[0]["creator"]) From 351fa3fb384096c95b3ffcab5e6ee7fe26379d2b Mon Sep 17 00:00:00 2001 From: Aaron Coburn Date: Tue, 1 Mar 2022 19:53:14 -0500 Subject: [PATCH 7/8] fix string decoding --- ldnlib/consumer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldnlib/consumer.py b/ldnlib/consumer.py index 5acaea1..5a8fcf9 100644 --- a/ldnlib/consumer.py +++ b/ldnlib/consumer.py @@ -40,4 +40,4 @@ def notification(self, iri, **kwargs): return r.json() else: g = Graph().parse(data=r.text, format=mime_type) - return json.loads(str(g.serialize(format="json-ld"), 'utf-8')) + return json.loads(g.serialize(format="json-ld")) From 9311d2686c538925f2fc2c6605e8dd9ad3130d66 Mon Sep 17 00:00:00 2001 From: Aaron Coburn Date: Tue, 1 Mar 2022 20:04:06 -0500 Subject: [PATCH 8/8] Expand version matrix --- .github/workflows/ci-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-config.yml b/.github/workflows/ci-config.yml index 6dca4db..e81e378 100644 --- a/.github/workflows/ci-config.yml +++ b/.github/workflows/ci-config.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8'] + python-version: ['3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2