pyapp-kit / superqt

Missing widgets and components for Qt-python
https://pyapp-kit.github.io/superqt/
BSD 3-Clause "New" or "Revised" License
210 stars 38 forks source link

Propagate function name in `ensure_main_thread` and `ensure_object_thread` #28

Closed Czaki closed 3 years ago

Czaki commented 3 years ago

This is superqt side of the fix bug mentioned in https://github.com/napari/napari/pull/3445.

Without this fix following code will pass:

class Test(Qobject):
    @ensure_object_thread
    def test_func(self, arg1):
        pass

t = Test()

assert t.test_func.__name__ == "_func"
codecov-commenter commented 3 years ago

Codecov Report

Merging #28 (4ee441a) into main (27bcfc4) will decrease coverage by 84.51%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #28       +/-   ##
==========================================
- Coverage   84.51%   0.00%   -84.52%     
==========================================
  Files           7      15        +8     
  Lines        1027    1373      +346     
==========================================
- Hits          868       0      -868     
- Misses        159    1373     +1214     
Impacted Files Coverage Δ
superqt/__init__.py 0.00% <0.00%> (ø)
superqt/_eliding_label.py 0.00% <0.00%> (ø)
superqt/combobox/__init__.py 0.00% <0.00%> (ø)
superqt/combobox/_enum_combobox.py 0.00% <0.00%> (ø)
superqt/sliders/__init__.py 0.00% <ø> (ø)
superqt/sliders/_generic_range_slider.py 0.00% <ø> (ø)
superqt/sliders/_generic_slider.py 0.00% <0.00%> (ø)
superqt/sliders/_labeled.py 0.00% <0.00%> (ø)
superqt/sliders/_range_style.py 0.00% <ø> (ø)
superqt/sliders/_sliders.py 0.00% <ø> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5ab72a0...4ee441a. Read the comment docs.

Czaki commented 3 years ago

I do not understand this coverage report.

Czaki commented 3 years ago

Where release with this will be released? lack of this breaks connection to signal function which consume less arguments than signal propagate (may affect psygnal)

tlambert03 commented 3 years ago

Where release with this will be released?

I can create a new release soon

lack of this breaks connection to signal function which consume less arguments than signal propagate (may affect psygnal)

how would this affect psygnal? (which doesn't use this package at all)... you mean if someone connected to a function decorated with this?

Czaki commented 3 years ago

how would this affect psygnal? (which doesn't use this package at all)... you mean if someone connected to a function decorated with this?

yes. tomorrow I could try to reproduce it with separated code.

tlambert03 commented 3 years ago

s'ok... no need. I believe you, just didn't see the connection at first. Will release in the next day or two