symonk / python-cdp

:snake: Pythonic marshalling for the devtools protocol
https://symonk.github.io/python-cdp/
Apache License 2.0
1 stars 0 forks source link

Fix upstream protocol defects with dependencies #2

Open symonk opened 1 year ago

symonk commented 1 year ago

There are quite a few upstream defects in the protocol definitions. This issue keeps track of those and any pull requests / defects I have opened with google directly.

These bugs can be found via:

# Protocol defects where `dependencies` are not accurate based on types declared:
tox -e linting -- flake8 | grep "undefined name" | sed 's/\.py.*F821//' | sort | uniq                                                                               
python_cdp/cdp/accessibility undefined name 'page'
python_cdp/cdp/audits undefined name 'dom'
python_cdp/cdp/audits undefined name 'page'
python_cdp/cdp/audits undefined name 'runtime'
python_cdp/cdp/background_service undefined name 'network'
python_cdp/cdp/background_service undefined name 'service_worker'
python_cdp/cdp/dom undefined name 'page'
python_cdp/cdp/network undefined name 'io'
python_cdp/cdp/network undefined name 'network'
python_cdp/cdp/performance_timeline undefined name 'page'
python_cdp/cdp/preload undefined name 'dom'
python_cdp/cdp/preload undefined name 'network'
python_cdp/cdp/security undefined name 'network'
python_cdp/cdp/target undefined name 'browser'
python_cdp/cdp/target undefined name 'page'
symonk commented 1 year ago

as a workaround in the short term:

python-cdp.generate.patch_protocol(...) will patch the protocol so we can continue generating unblocked.

symonk commented 1 year ago

additional fixes required for type annotations referencing the same module the type is in, i.e network.py having a property type of Network.* as this is not available in the current namespace.