Skip to content

Commit

Permalink
Improve autocompletion for lazy module (#6174)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Apr 6, 2024
1 parent 4208e73 commit bf4592e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,6 @@ jobs:
envs: "-o tests_core -o tests_ci"
cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }}
id: install
- uses: actions/checkout@v3
if: needs.setup.outputs.code_change == 'true'
with:
fetch-depth: "100"
- name: Fetch unshallow
if: needs.setup.outputs.code_change == 'true'
run: git fetch --prune --tags --unshallow -f
- name: install
if: needs.setup.outputs.code_change == 'true'
run: |
python -m pip install -ve '.[tests_core, tests_ci]'
- name: Download data
if: needs.setup.outputs.code_change == 'true'
run: |
Expand Down
12 changes: 11 additions & 1 deletion holoviews/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,22 @@ def help(obj, visualization=True, ansi=True, backend=None,
pydoc.help(obj)


del os, rcfile, warnings

def __getattr__(name):
if name == "annotate":
# Lazy loading Panel
from .annotators import annotate
return annotate
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

__all__ = [k for k in locals() if not k.startswith('_')]
__all__ += ['annotate', '__version__']

del os, rcfile, warnings
def __dir__():
return __all__

from typing import TYPE_CHECKING

if TYPE_CHECKING:
from .annotators import annotate
4 changes: 0 additions & 4 deletions holoviews/tests/plotting/bokeh/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,6 @@ def test_rangexy_framewise_reset(self):
self.assertEqual(stream.y_range, None)

def test_rangexy_framewise_not_reset_if_triggering(self):
import panel as pn
from packaging.version import Version
if Version(pn.__version__) == Version("1.4.0rc3"):
raise SkipTest('This test fails with Panel 1.4.0rc3')
stream = RangeXY(x_range=(0, 2), y_range=(0, 1))
curve = DynamicMap(lambda z, x_range, y_range: Curve([1, 2, z]),
kdims=['z'], streams=[stream]).redim.range(z=(0, 3))
Expand Down

0 comments on commit bf4592e

Please sign in to comment.