Skip to content

Commit 966044b

Browse files
committed
Run embedme
1 parent 94067b9 commit 966044b

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

advanced/server-extension/README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ import os
502502

503503
from jupyter_packaging import (
504504
create_cmdclass, install_npm, ensure_targets,
505-
combine_commands, get_version,
505+
combine_commands, skip_if_exists
506506
)
507507
import setuptools
508508

@@ -519,7 +519,6 @@ lab_path = os.path.join(HERE, name, "labextension")
519519

520520
# Representative files that should exist after a successful build
521521
jstargets = [
522-
os.path.join(HERE, "lib", "index.js"),
523522
os.path.join(lab_path, "package.json"),
524523
]
525524

@@ -535,19 +534,25 @@ data_files_spec = [
535534
("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"),
536535
("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"),("etc/jupyter/jupyter_server_config.d",
537536
"jupyter-config", "jlab_ext_example.json"),
538-
537+
539538
]
540539

541540
cmdclass = create_cmdclass("jsdeps",
542541
package_data_spec=package_data_spec,
543542
data_files_spec=data_files_spec
544543
)
545544

546-
cmdclass["jsdeps"] = combine_commands(
545+
js_command = combine_commands(
547546
install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
548547
ensure_targets(jstargets),
549548
)
550549

550+
is_repo = os.path.exists(os.path.join(HERE, ".git"))
551+
if is_repo:
552+
cmdclass["jsdeps"] = js_command
553+
else:
554+
cmdclass["jsdeps"] = skip_if_exists(jstargets, js_command)
555+
551556
with open("README.md", "r") as fh:
552557
long_description = fh.read()
553558

@@ -562,14 +567,14 @@ setup_args = dict(
562567
cmdclass= cmdclass,
563568
packages=setuptools.find_packages(),
564569
install_requires=[
565-
"jupyterlab>=3.0.0rc2,==3.*",
570+
"jupyterlab>=3.0.0rc15,==3.*",
566571
],
567572
zip_safe=False,
568573
include_package_data=True,
569574
python_requires=">=3.6",
570575
license="BSD-3-Clause",
571576
platforms="Linux, Mac OS X, Windows",
572-
keywords=["Jupyter", "JupyterLab"],
577+
keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
573578
classifiers=[
574579
"License :: OSI Approved :: BSD License",
575580
"Programming Language :: Python",
@@ -593,14 +598,14 @@ the frontend NPM package needs to be built and inserted in the Python package. T
593598
done using a special `cmdclass`:
594599
595600
```py
596-
# setup.py#L45-L53
601+
# setup.py#L44-L52
597602

598603
cmdclass = create_cmdclass("jsdeps",
599604
package_data_spec=package_data_spec,
600605
data_files_spec=data_files_spec
601606
)
602607

603-
cmdclass["jsdeps"] = combine_commands(
608+
js_command = combine_commands(
604609
install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
605610
ensure_targets(jstargets),
606611
)
@@ -609,18 +614,18 @@ cmdclass["jsdeps"] = combine_commands(
609614
Basically it will build the frontend NPM package:
610615
611616
```py
612-
# setup.py#L51-L51
617+
# setup.py#L50-L50
613618

614619
install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
615620
```
616621
617622
It will ensure one of the generated JS files is `lib/jlabextexample.js`:
618623
619624
```py
620-
# setup.py#L25-L28
625+
# setup.py#L24-L27
621626

627+
# Representative files that should exist after a successful build
622628
jstargets = [
623-
os.path.join(HERE, "lib", "index.js"),
624629
os.path.join(lab_path, "package.json"),
625630
]
626631
```

main-menu/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ After the execution of that command, `package.json` should list them in the
9090
"watch:src": "tsc -w"
9191
},
9292
"dependencies": {
93-
"@jupyterlab/application": "^3.0.0-rc.7",
94-
"@jupyterlab/mainmenu": "^3.0.0-rc.7",
93+
"@jupyterlab/application": "^3.0.0-rc.15",
94+
"@jupyterlab/mainmenu": "^3.0.0-rc.15",
9595
```
9696
9797
With this extension installed, a new menu _Main Menu Example_ should be present. And when

0 commit comments

Comments
 (0)