altendky / qtrio

QTrio - a library bringing Qt GUIs together with async and await via Trio
https://qtrio.readthedocs.io/
Other
40 stars 4 forks source link

Update to trio-typing ~= 0.7.0 #273

Closed altendky closed 2 years ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #273 (e5d3cb4) into main (43c7ff2) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #273   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           35        35           
  Lines         2036      2038    +2     
  Branches       139       139           
=========================================
+ Hits          2036      2038    +2     
Impacted Files Coverage Δ
qtrio/_core.py 100.00% <ø> (ø)
qtrio/_exceptions.py 100.00% <100.00%> (ø)
qtrio/_qt.py 100.00% <100.00%> (ø)
qtrio/_tests/examples/test_download.py 100.00% <100.00%> (ø)
qtrio/examples/download.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

vxgmichel commented 2 years ago

Looks good, it seems like the mypy errors can easily be fixed:

diff --git a/qtrio/_tests/examples/test_download.py b/qtrio/_tests/examples/test_download.py
index 4befe9d..4c0f62f 100644
--- a/qtrio/_tests/examples/test_download.py
+++ b/qtrio/_tests/examples/test_download.py
@@ -206,7 +206,7 @@ async def test_main(
         widget.get_dialog.message_box.accept_button.click()

     async with await destination.open("rb") as written_file:
-        written = await written_file.read()  # type: ignore[attr-defined]
+        written = await written_file.read()

     assert written == data

@@ -244,7 +244,7 @@ async def test_get_dialog(
         widget.message_box.accept_button.click()

     async with await destination.open("rb") as written_file:
-        written = await written_file.read()  # type: ignore[attr-defined]
+        written = await written_file.read()

     assert written == data

@@ -304,7 +304,7 @@ async def test_get(
         progresses.append(progress)

     async with await destination.open("rb") as written_file:
-        written = await written_file.read()  # type: ignore[attr-defined]
+        written = await written_file.read()

     assert written == data
     assert all(progress.total == content_length for progress in progresses)
diff --git a/qtrio/examples/download.py b/qtrio/examples/download.py
index 5175710..44aac16 100644
--- a/qtrio/examples/download.py
+++ b/qtrio/examples/download.py
@@ -272,7 +272,7 @@ async def get(
             async with (await destination.open("wb")) as file:
                 async for chunk in response.aiter_raw():
                     downloaded += len(chunk)
-                    await file.write(chunk)  # type: ignore[attr-defined]
+                    await file.write(chunk)

                     if clock() - last_update > update_period:
                         progress = attr.evolve(progress, downloaded=downloaded)

I don't know about those failing tests though:

FAILED ..\_tests\examples\test_emissions.py::test_main[no hold] - qtrio._exce...
FAILED ..\_tests\examples\test_emissions.py::test_main[hold] - qtrio._excepti...
vxgmichel commented 2 years ago

For information, the following errors in the CI:

FAILED ../_tests/examples/test_emissions.py::test_main[no hold] - qtrio._exce...
FAILED ../_tests/examples/test_emissions.py::test_main[hold] - qtrio._excepti...

seem to be related to the CI using PySide2==5.15.2.1, even though it shoudn't since PySide2==5.12.2 is explicitly disabled in setup.cfg. Note this trace from the CI:

 Collecting pyside2!=5.15.2,~=5.15
  Downloading PySide2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-abi3-manylinux1_x86_64.whl (164.3 MB)
vxgmichel commented 2 years ago

Is there something more I can do to help this issue move forward? Sorry for the bump :)

altendky commented 2 years ago

Sorry... :[ Maybe bump me again in a few days. Right at the moment I have some other stuff to complete.

vxgmichel commented 2 years ago

Maybe bump me again in a few days. Right at the moment I have some other stuff to complete.

No problem, here's another bump :)

altendky commented 2 years ago

You want to try this out? I might merge without fixing the docs, but I'm trying to at least add ignores for now.

altendky commented 2 years ago

:tada:

vxgmichel commented 2 years ago

Great! :tada:

Could you also make a new qtrio release once this PR is merged?

Thank you for your time and effort :)

altendky commented 2 years ago

Did you get a chance to check this and make sure it is working at least a little for you? But yeah, I figured there could be a release. I'll have to figure out how that all went again...

vxgmichel commented 2 years ago

Did you get a chance to check this and make sure it is working at least a little for you?

I ran a quick check by updating the qtrio dependency to this branch and I've been able to update trio-typing and other mypy dependencies as I wanted. The tests also run fine, so it should be all good :+1:

vxgmichel commented 2 years ago

Hi @altendky, would it be possible to get a new qtrio release now that this PR is merged? It would be much appreciated :)