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

Fix __init__.py for wheel #99

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:

pip install "jupyterlab>=4.0.0,<5" jupyterlab_vim*.whl

python -c "import jupyterlab_vim"

jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "@axlair/jupyterlab_vim.*OK"
Expand Down
20 changes: 9 additions & 11 deletions jupyterlab_vim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@

import json
from pathlib import Path

from ._version import __version__

HERE = Path(__file__).parent.resolve()

with (HERE / "labextension" / "package.json").open() as fid:
data = json.load(fid)
try:
from ._version import __version__
except ImportError:
# Fallback when using the package in dev mode without installing
# in editable mode with pip. It is highly recommended to install
# the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
import warnings
warnings.warn("Importing 'jupyterlab_vim' outside a proper installation.")
__version__ = "dev"

def _jupyter_labextension_paths():
return [{
"src": "labextension",
"dest": "@axlair/jupyterlab_vim",
}]