-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Restrict static & runtime top-level imports (#3482)
* feat: generate an `__all__` for `channels.py` This missing is the main source of unpredictable imports. I've explicitly not included the `Mixin` classes, side effect imports (e.g. `Undefined`, `parse_shorthand`, `@overload`) and `@with_property_setters` * build: run `generate-schema-wrapper` * refactor: change the sources for some import in `api` * refactor: add explicit import for `utils.parse_shorthand` This was the only side-effect import that I imagine was useful * build: run `update-init-file` * chore(ruff): replace blanket `noqa` with specific rules * refactor: add explicit imports in `v5.__init__.py` Previously imported in `api` -> here * feat: define an `__all__` for `api.py` manually Currently not included deprecations, but will probably have to revert later * refactor: add explicit imports for `Optional`, `Undefined` * build: run `update-init-file` Dropped from top-level: `DataType`, `TOPLEVEL_ONLY_KEYS`, `mixins` * test: use explicit import for `Undefined` * test: use explicit import for `AltairDeprecationWarning` * fix: add deprecations to `api.py`s `__all__` * revert: Include `mixins`, `DataType`, `TOPLEVEL_ONLY_KEYS` in `api.__all__` #3482 (comment) * chore: remove TODO * revert: include channels mixins and `with_property_setters` in `channels.__all__` * build: run `generate-schema-wrapper` * build: run `update-init-file`
- Loading branch information
1 parent
3f96b74
commit 2b2f0b8
Showing
9 changed files
with
237 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# ruff: noqa | ||
# ruff: noqa: F403 | ||
from .v5 import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Altair schema wrappers""" | ||
|
||
# ruff: noqa | ||
# ruff: noqa: F403 | ||
from .v5.schema import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.