amoghrajesh commented on PR #32495:
URL: https://github.com/apache/airflow/pull/32495#issuecomment-1631878848
> One more fix needed. There is a static check failing with missing
"jsonschema" and for a very good reason.
>
> Here is one special thing to fix that is not obvious. You need make the
`jsonschema` imports local and not at the top of the file, The main reason is
`click`. Long story short - we need to have very minimal set of dependencies
needed to "parse" all files that contain `@click` annotation, because
effectively those command files are parsed every time when `<TAB>` is used to
autocomplete Breeze (and this is done witthout entering breeze's virtualenv) -
so error here indicates, that you need to make sure that jsonschema package is
imported locally when needed and not at the top of the files that are imported
by any of the breeze commands.
With the recent commit, I made the `jsonschema` import at the function level
when needed. Still i am unable to resolve that issue:
```
Traceback (most recent call last):
File
"/home/runner/work/airflow/airflow/dev/breeze/src/airflow_breeze/breeze.py",
line 36, in <module>
from airflow_breeze.commands.release_management_commands import
release_management # noqa
File
"/home/runner/work/airflow/airflow/dev/breeze/src/airflow_breeze/commands/release_management_commands.py",
line 107, in <module>
from airflow_breeze.utils.publish_docs_builder import PublishDocsBuilder
File
"/home/runner/work/airflow/airflow/dev/breeze/src/airflow_breeze/utils/publish_docs_builder.py",
line 29, in <module>
from airflow_breeze.utils.docs_errors import DocBuildError,
parse_sphinx_warnings
File
"/home/runner/work/airflow/airflow/dev/breeze/src/airflow_breeze/utils/docs_errors.py",
line 26, in <module>
from airflow_breeze.utils.publish_docs_helpers import
prepare_code_snippet
File
"/home/runner/work/airflow/airflow/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py",
line 85, in <module>
ALL_PROVIDER_YAMLS = load_package_data()
File
"/home/runner/work/airflow/airflow/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py",
line 64, in load_package_data
import jsonschema
ModuleNotFoundError: No module named 'jsonschema'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]