From e9a9ac7110a88e8410a80d0481040fb44f614be2 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 13 Apr 2023 09:44:52 -0400 Subject: [PATCH 1/2] Rip out codecov for now. --- .circleci/config.yml | 2 +- .circleci/populate-wheelhouse.sh | 2 +- .github/workflows/ci.yml | 2 +- newsfragments/4010.minor | 0 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 newsfragments/4010.minor diff --git a/.circleci/config.yml b/.circleci/config.yml index 77c29734d..54b2706cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,7 +260,7 @@ jobs: name: "Submit coverage results" command: | if [ -n "${UPLOAD_COVERAGE}" ]; then - /tmp/venv/bin/codecov + echo "TODO: Need a new coverage solution, see https://tahoe-lafs.org/trac/tahoe-lafs/ticket/4011" fi docker: diff --git a/.circleci/populate-wheelhouse.sh b/.circleci/populate-wheelhouse.sh index 857171979..374ca0adb 100755 --- a/.circleci/populate-wheelhouse.sh +++ b/.circleci/populate-wheelhouse.sh @@ -9,7 +9,7 @@ BASIC_DEPS="pip wheel" # Python packages we need to support the test infrastructure. *Not* packages # Tahoe-LAFS itself (implementation or test suite) need. -TEST_DEPS="tox~=3.0 codecov" +TEST_DEPS="tox~=3.0" # Python packages we need to generate test reports for CI infrastructure. # *Not* packages Tahoe-LAFS itself (implement or test suite) need. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adcf6cc5d..1bb7c9efb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: - name: Install Python packages run: | - pip install --upgrade codecov "tox<4" tox-gh-actions setuptools + pip install --upgrade "tox<4" tox-gh-actions setuptools pip list - name: Display tool versions diff --git a/newsfragments/4010.minor b/newsfragments/4010.minor new file mode 100644 index 000000000..e69de29bb From 464b47619028e9d194e660ad461467acaf8986b4 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 13 Apr 2023 13:11:17 -0400 Subject: [PATCH 2/2] Work on 3.8. --- src/allmydata/storage/http_client.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/allmydata/storage/http_client.py b/src/allmydata/storage/http_client.py index e21cfc5cc..fc165bedd 100644 --- a/src/allmydata/storage/http_client.py +++ b/src/allmydata/storage/http_client.py @@ -5,7 +5,7 @@ HTTP client that talks to the HTTP storage server. from __future__ import annotations from eliot import start_action, register_exception_extractor -from typing import Union, Optional, Sequence, Mapping, BinaryIO, cast, TypedDict +from typing import Union, Optional, Sequence, Mapping, BinaryIO, cast, TypedDict, Set from base64 import b64encode from io import BytesIO from os import SEEK_END @@ -487,14 +487,14 @@ class StorageClientGeneral(object): url = self._client.relative_url("/storage/v1/version") response = await self._client.request("GET", url) decoded_response = cast( - dict[bytes, object], + Mapping[bytes, object], await self._client.decode_cbor(response, _SCHEMAS["get_version"]), ) # Add some features we know are true because the HTTP API # specification requires them and because other parts of the storage # client implementation assumes they will be present. cast( - dict[bytes, object], + Mapping[bytes, object], decoded_response[b"http://allmydata.org/tahoe/protocols/storage/v1"], ).update( { @@ -692,7 +692,7 @@ class StorageClientImmutables(object): message_to_serialize=message, ) decoded_response = cast( - dict[str, set[int]], + Mapping[str, Set[int]], await self._client.decode_cbor(response, _SCHEMAS["allocate_buckets"]), ) return ImmutableCreateResult( @@ -774,7 +774,7 @@ class StorageClientImmutables(object): response.code, ) body = cast( - dict[str, list[dict[str, int]]], + Mapping[str, Sequence[Mapping[str, int]]], await self._client.decode_cbor( response, _SCHEMAS["immutable_write_share_chunk"] ), @@ -795,7 +795,7 @@ class StorageClientImmutables(object): ) @async_to_deferred - async def list_shares(self, storage_index: bytes) -> set[int]: + async def list_shares(self, storage_index: bytes) -> Set[int]: """ Return the set of shares for a given storage index. """ @@ -808,7 +808,7 @@ class StorageClientImmutables(object): ) if response.code == http.OK: body = cast( - set[int], + Set[int], await self._client.decode_cbor(response, _SCHEMAS["list_shares"]), ) return set(body) @@ -881,9 +881,10 @@ class ReadTestWriteResult: reads: Mapping[int, Sequence[bytes]] -# Result type for mutable read/test/write HTTP response. +# Result type for mutable read/test/write HTTP response. Can't just use +# dict[int,list[bytes]] because on Python 3.8 that will error out. MUTABLE_RTW = TypedDict( - "MUTABLE_RTW", {"success": bool, "data": dict[int, list[bytes]]} + "MUTABLE_RTW", {"success": bool, "data": Mapping[int, Sequence[bytes]]} ) @@ -958,7 +959,7 @@ class StorageClientMutables: ) @async_to_deferred - async def list_shares(self, storage_index: bytes) -> set[int]: + async def list_shares(self, storage_index: bytes) -> Set[int]: """ List the share numbers for a given storage index. """ @@ -968,7 +969,7 @@ class StorageClientMutables: response = await self._client.request("GET", url) if response.code == http.OK: return cast( - set[int], + Set[int], await self._client.decode_cbor( response, _SCHEMAS["mutable_list_shares"] ),