Add type hints for IntegrationManager.

Review Request #12994 — Created April 27, 2023 and submitted

Information

Djblets
release-3.x

Reviewers

This adds type hints for IntegrationManager, helping ensure that code
interacting with an IntegrationManager passes around the right types.
These type hints also cover instance variables, letting IDEs and type
checkers show details on these attributes.

Unit tests, mypy, and pyright pass.

Summary ID
Add type hints for IntegrationManager.
This adds type hints for `IntegrationManager`, helping ensure that code interacting with an `IntegrationManager` passes around the right types. These type hints also cover instance variables, letting IDEs and type checkers show details on these attributes.
02a75daa37799fa446601e194e1a5fa0dbdc88fc
Description From Last Updated

'typing.Generic' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

The only thing we're using from weakref is WeakValueDictionary. Can we do a from weakref import WeakValueDictionary to make this …

daviddavid

Can we make an alias for Type[Integration]? We use it a lot.

daviddavid

undefined name 'Integration' Column: 39 Error code: F821

reviewbotreviewbot

undefined name 'Integration' Column: 10 Error code: F821

reviewbotreviewbot

undefined name 'Integration' Column: 44 Error code: F821

reviewbotreviewbot

undefined name 'Integration' Column: 10 Error code: F821

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. 
      
  2. djblets/integrations/manager.py (Diff revision 2)
     
     
     
    Show all issues

    The only thing we're using from weakref is WeakValueDictionary. Can we do a from weakref import WeakValueDictionary to make this somewhat less wordy?

  3. djblets/integrations/manager.py (Diff revision 2)
     
     
    Show all issues

    Can we make an alias for Type[Integration]? We use it a lot.

  4. 
      
chipx86
Review request changed
Change Summary:
  • Simplified an import around weakref.
  • Added an IntegrationClassType type alias.
Commits:
Summary ID
Add type hints for IntegrationManager.
This adds type hints for `IntegrationManager`, helping ensure that code interacting with an `IntegrationManager` passes around the right types. These type hints also cover instance variables, letting IDEs and type checkers show details on these attributes.
bc83879805ed79c59a5c96a41d2830fe22606391
Add type hints for IntegrationManager.
This adds type hints for `IntegrationManager`, helping ensure that code interacting with an `IntegrationManager` passes around the right types. These type hints also cover instance variables, letting IDEs and type checkers show details on these attributes.
da8306cfb039eeda2ba4106ba6c5075450084df6

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.x (623658e)