Skip to content

Commit 0d333ad

Browse files
committed
Small improvements
1 parent c31091b commit 0d333ad

File tree

7 files changed

+23
-56
lines changed

7 files changed

+23
-56
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ node_modules/
88
*.tsbuildinfo
99
jupyterlab_lego_boost/labextension
1010

11+
# Version file is handled by hatchling
12+
jupyterlab_lego_boost/_version.py
13+
1114
# Integration tests
1215
ui-tests/test-results/
1316
ui-tests/playwright-report/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Link: https://www.lego.com/en-de/product/boost-creative-toolbox-17101
2525
To install the extension, execute:
2626

2727
```bash
28-
micromamba create -n boost -c conda-forge python nodejs yarn jupyterlab==3.4 jupyter-packaging jupyterlab-language-pack-es-ES jupyterlab-language-pack-fr-FR ipykernel xeus-python xeus-lua
28+
micromamba create -n boost -c conda-forge python=3.9 nodejs=16 yarn jupyterlab=3.4 jupyterlab-language-pack-es-ES jupyterlab-language-pack-fr-FR ipykernel xeus-python xeus-lua
2929
micromamba activate boost
3030
pip install jupyterlab-lego-boost
3131
```
@@ -59,7 +59,7 @@ The `jlpm` command is JupyterLab's pinned version of
5959
`yarn` or `npm` in lieu of `jlpm` below.
6060

6161
```bash
62-
micromamba create -n boost -c conda-forge python nodejs yarn jupyterlab==3.4 jupyter-packaging jupyterlab-language-pack-es-ES jupyterlab-language-pack-fr-FR ipykernel xeus-python xeus-lua
62+
micromamba create -n boost -c conda-forge python=3.9 nodejs=16 yarn jupyterlab=3.4 jupyterlab-language-pack-es-ES jupyterlab-language-pack-fr-FR ipykernel xeus-python xeus-lua
6363
micromamba activate boost
6464
# Clone the repo to your local environment
6565
# Change directory to the jupyterlab-lego-boost directory

jupyterlab_lego_boost/__init__.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
import json
2-
from pathlib import Path
3-
41
from ._version import __version__
5-
6-
7-
HERE = Path(__file__).parent.resolve()
8-
9-
10-
with (HERE / "labextension" / "package.json").open() as fid:
11-
data = json.load(fid)
2+
from pathlib import Path
123

134

145
def _jupyter_labextension_paths():
156
return [{
167
"src": "labextension",
17-
"dest": data["name"]
8+
"dest": "jupyterlab_lego_boost"
189
}]
19-

jupyterlab_lego_boost/_version.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"license": "BSD-3-Clause",
1515
"author": {
1616
"name": "Denisa Checiu",
17-
"email": ""
17+
"email": "me@test.com"
1818
},
1919
"files": [
2020
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",

pyproject.toml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[build-system]
2-
requires = ["hatchling>=1.9.0", "hatch-nodejs-version", "jupyterlab~=3.4"]
2+
requires = ["hatchling>=1.4.0", "hatch-nodejs-version", "jupyterlab~=3.4"]
33
build-backend = "hatchling.build"
44

55
[project]
66
name = "jupyterlab-lego-boost"
77
readme = "README.md"
8+
license = { file = "LICENSE" }
89
requires-python = ">=3.7"
910
dependencies = ['jupyterlab-blockly>=0.2.1,<0.3']
1011
classifiers = [
@@ -23,29 +24,28 @@ classifiers = [
2324
]
2425
dynamic = ["version", "description", "authors", "urls", "keywords"]
2526

26-
[project.license]
27-
file = "LICENSE"
28-
2927
[project.optional-dependencies]
3028
env = ["bleak", "pylgbst"]
3129

32-
3330
[tool.hatch.version]
3431
source = "nodejs"
3532

3633
[tool.hatch.metadata.hooks.nodejs]
3734
fields = ["description", "authors", "urls"]
3835

39-
[tool.hatch.build]
40-
ignore-vcs = true
36+
[tool.hatch.build.targets.sdist]
37+
artifacts = ["jupyterlab_lego_boost/labextension"]
38+
exclude = [".github", "binder"]
4139

4240
[tool.hatch.build.targets.wheel.shared-data]
4341
"install.json" = "share/jupyter/labextensions/jupyterlab-lego-boost/install.json"
4442
"jupyterlab_lego_boost/labextension" = "share/jupyter/labextensions/jupyterlab-lego-boost/"
4543

44+
[tool.hatch.build.hooks.version]
45+
path = "jupyterlab_lego_boost/_version.py"
4646

4747
[tool.hatch.build.hooks.jupyter-builder]
48-
dependencies = ["hatch-jupyter-builder>=0.6.2"]
48+
dependencies = ["hatch-jupyter-builder>=0.5"]
4949
build-function = "hatch_jupyter_builder.npm_builder"
5050
ensured-targets = ["jupyterlab_lego_boost/labextension/static/style.js", "jupyterlab_lego_boost/labextension/package.json"]
5151
skip-if-exists = ["jupyterlab_lego_boost/labextension/static/style.js"]
@@ -57,18 +57,15 @@ npm = ["jlpm"]
5757
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
5858
build_cmd = "install:extension"
5959
npm = ["jlpm"]
60-
61-
62-
[tool.check-manifest]
63-
ignore = ["jupyterlab_lego_boost/labextension/**", "yarn.lock", ".*", "package-lock.json"]
64-
65-
66-
#[tool.jupyter-releaser]
67-
#skip = ["check-links"]
60+
source_dir = "src"
61+
build_dir = "jupyterlab_lego_boost/labextension"
6862

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

7266
[tool.jupyter-releaser.hooks]
73-
before-build-npm = ["python -m pip install jupyterlab~=3.4", "jlpm"]
67+
before-build-npm = ["python -m pip install jupyterlab~=3.4", "jlpm", "jlpm build:prod"]
7468
before-build-python = ["jlpm clean:all"]
69+
70+
[tool.check-wheel-contents]
71+
ignore = ["W002"]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# setup.py shim for use with applications that require it.
2-
__import__("setuptools").setup()
2+
__import__('setuptools').setup()

0 commit comments

Comments
 (0)