Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #411

Merged
merged 4 commits into from
Oct 4, 2023
Merged

Conversation

updates:
- [github.com/python-jsonschema/check-jsonschema: 0.26.3 → 0.27.0](python-jsonschema/check-jsonschema@0.26.3...0.27.0)
- [github.com/psf/black: 23.7.0 → 23.9.1](psf/black@23.7.0...23.9.1)
- [github.com/astral-sh/ruff-pre-commit: v0.0.287 → v0.0.292](astral-sh/ruff-pre-commit@v0.0.287...v0.0.292)
@fcollonval
Copy link
Member

Let's see if traitlets 5.11.1 reduces the number of errors.

@fcollonval
Copy link
Member

@blink1073 would you have time to provide advice on how to fix the issues related to the new traitlets typing?

jupyterlab_server/licenses_handler.py:55: error: Item "None" of "Any | None"
has no attribute "labextensions_path"  [union-attr]
                    self.parent.labextensions_path,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jupyterlab_server/licenses_handler.py:56: error: Item "None" of "Any | None"
has no attribute "extra_labextensions_path"  [union-attr]
                    self.parent.extra_labextensions_path,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jupyterlab_server/licenses_handler.py: note: In member "app_static_info" of class "LicensesManager":
jupyterlab_server/licenses_handler.py:203: error: Item "None" of "Any | None"
has no attribute "static_dir"  [union-attr]
            path = Path(self.parent.static_dir)
                        ^~~~~~~~~~~~~~~~~~~~~~
jupyterlab_server/licenses_handler.py: note: In member "get" of class "LicensesHandler":
jupyterlab_server/licenses_handler.py:258: error: Item "None" of "Any | None"
has no attribute "app_name"  [union-attr]
                    self.manager.parent.app_name.lower(), mimetypes.guess_...
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
jupyterlab_server/process_app.py: note: In class "ProcessApp":
jupyterlab_server/process_app.py:20: error: Incompatible types in assignment
(expression has type "bool", base class "ExtensionApp" defined the type as
"Bool[bool, bool | int]")  [assignment]
        open_browser = False
                       ^~~~~
jupyterlab_server/app.py: note: In class "LabServerApp":
jupyterlab_server/app.py:22: error: Incompatible types in assignment
(expression has type "str", base class "LabConfig" defined the type as
"Unicode[str, str | bytes]")  [assignment]
        app_name = "JupyterLab Server Application"

@bollwyvl
Copy link
Contributor

bollwyvl commented Oct 3, 2023

  • for all the handlers, parent is an HasTraits
    • needs to be refined to e.g. LabApp
      • this can be done in a `if TYPE_CHECKING: assert isinstance(parent, LabApp)
  • app_name and open_browser
    • this pattern has always been kinda annoying, as it breaks configurability
    • could be either
      • re-defined as e.g Unicode("JupyterLab Server Application").tag(config=True)
      • or with a @default value further down

@blink1073 blink1073 merged commit 6704acc into main Oct 4, 2023
27 checks passed
@blink1073 blink1073 deleted the pre-commit-ci-update-config branch October 4, 2023 02:55
@fcollonval
Copy link
Member

Thanks @bollwyvl and @blink1073 for finishing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants