Skip to content

Commit

Permalink
Fix failing tests/local installation with hatch
Browse files Browse the repository at this point in the history
CI: remove unused `[test]`, bump jupyterlab version

Add missing setup.py

Remove unused manifest file

Remove unused travis config

Fix incomplete migration to hatch versioning

Update lab version in pyproject

Make the python package importable
  • Loading branch information
krassowski committed Dec 19, 2023
1 parent 6ad817a commit b05fb78
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0b0,<5"
run: python -m pip install -U "jupyterlab>=4.1.0a4,<5"

- name: Lint the extension
run: |
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Build the extension
run: |
set -eux
python -m pip install .[test]
python -m pip install .
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-skip-traceback.*OK"
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ node_modules
**/lib
**/package.json
!/package.json
jupyterlab-skip-traceback
jupyterlab_skip_traceback
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions MANIFEST.in

This file was deleted.

13 changes: 0 additions & 13 deletions jupyterlab-skip-traceback/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions jupyterlab-skip-traceback/_version.py

This file was deleted.

13 changes: 13 additions & 0 deletions jupyterlab_skip_traceback/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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_skip_traceback' outside a proper installation.")
__version__ = "dev"


def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": "jupyterlab_skip_traceback"}]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"jupyterlab": {
"extension": true,
"schemaDir": "schema",
"outputDir": "jupyterlab-skip-traceback/labextension"
"outputDir": "jupyterlab_skip_traceback/labextension"
},
"scripts": {
"build": "jlpm build:lib && jlpm build:labextension:dev",
Expand All @@ -42,7 +42,7 @@
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
"clean": "jlpm clean:lib",
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
"clean:labextension": "rimraf jupyterlab-skip-traceback/labextension jupyterlab-skip-traceback/_version.py",
"clean:labextension": "rimraf jupyterlab_skip_traceback/labextension jupyterlab_skip_traceback/_version.py",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:lintcache": "rimraf .eslintcache .stylelintcache",
"eslint": "jlpm eslint:check --fix",
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version"]
requires = ["hatchling>=1.5.0", "jupyterlab>=4.1.0a4,<5", "hatch-nodejs-version>=0.3.2"]
build-backend = "hatchling.build"

[project]
Expand Down Expand Up @@ -32,24 +32,24 @@ source = "nodejs"
fields = ["description", "authors", "urls"]

[tool.hatch.build.targets.sdist]
artifacts = ["jupyterlab-skip-traceback/labextension"]
artifacts = ["jupyterlab_skipNtraceback/labextension"]
exclude = [".github", "binder"]

[tool.hatch.build.targets.wheel.shared-data]
"jupyterlab-skip-traceback/labextension" = "share/jupyter/labextensions/jupyterlab-skip-traceback"
"jupyterlab_skip_traceback/labextension" = "share/jupyter/labextensions/jupyterlab-skip-traceback"
"install.json" = "share/jupyter/labextensions/jupyterlab-skip-traceback/install.json"

[tool.hatch.build.hooks.version]
path = "jupyterlab-skip-traceback/_version.py"
path = "jupyterlab_skip_traceback/_version.py"

[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder>=0.5"]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = [
"jupyterlab-skip-traceback/labextension/static/style.js",
"jupyterlab-skip-traceback/labextension/package.json",
"jupyterlab_skip_traceback/labextension/static/style.js",
"jupyterlab_skip_traceback/labextension/package.json",
]
skip-if-exists = ["jupyterlab-skip-traceback/labextension/static/style.js"]
skip-if-exists = ["jupyterlab_skip_traceback/labextension/static/style.js"]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
Expand All @@ -59,14 +59,14 @@ npm = ["jlpm"]
build_cmd = "install:extension"
npm = ["jlpm"]
source_dir = "src"
build_dir = "jupyterlab-skip-traceback/labextension"
build_dir = "jupyterlab_skip_traceback/labextension"

[tool.jupyter-releaser.options]
version_cmd = "hatch version"

[tool.jupyter-releaser.hooks]
before-build-npm = [
"python -m pip install 'jupyterlab>=4.0.0b0,<5'",
"python -m pip install 'jupyterlab>=4.1.0a4,<5'",
"jlpm",
"jlpm build:prod"
]
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__("setuptools").setup()

0 comments on commit b05fb78

Please sign in to comment.