-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
280 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
include README.md | ||
include pyproject.toml | ||
include jupyter-config/k3d.json | ||
recursive-include k3d/static * | ||
include k3d/k3d_extension.json | ||
include setupbase.py | ||
|
||
include package.json | ||
include install.json | ||
include ts*.json | ||
include yarn.lock | ||
|
||
graft k3d/labextension | ||
|
||
# Javascript files | ||
graft lib | ||
graft style | ||
prune **/node_modules | ||
|
||
# Patterns to exclude from any directory | ||
global-exclude *~ | ||
global-exclude *.pyc | ||
global-exclude *.pyo | ||
global-exclude .git | ||
global-exclude .ipynb_checkpoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# a mybinder.org-ready environment for demoing k3d | ||
# this environment may also be used locally on Linux/MacOS/Windows, e.g. | ||
# | ||
# conda env update --file binder/environment.yml | ||
# conda activate k3d-demo | ||
# | ||
name: k3d-demo | ||
|
||
channels: | ||
- conda-forge | ||
|
||
dependencies: | ||
# runtime dependencies | ||
- python >=3.8,<3.9.0a0 | ||
- jupyterlab >=3,<4.0.0a0 | ||
# labextension build dependencies | ||
- nodejs >=14,<15 | ||
- pip | ||
- wheel | ||
# additional packages for demos | ||
# - ipywidgets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python3 | ||
""" perform a development install of k3d | ||
On Binder, this will run _after_ the environment has been fully created from | ||
the environment.yml in this directory. | ||
This script should also run locally on Linux/MacOS/Windows: | ||
python3 binder/postBuild | ||
""" | ||
import subprocess | ||
import sys | ||
from pathlib import Path | ||
|
||
|
||
ROOT = Path.cwd() | ||
|
||
def _(*args, **kwargs): | ||
""" Run a command, echoing the args | ||
fails hard if something goes wrong | ||
""" | ||
print("\n\t", " ".join(args), "\n") | ||
return_code = subprocess.call(args, **kwargs) | ||
if return_code != 0: | ||
print("\nERROR", return_code, " ".join(args)) | ||
sys.exit(return_code) | ||
|
||
# verify the environment is self-consistent before even starting | ||
_(sys.executable, "-m", "pip", "check") | ||
|
||
# install the labextension | ||
_(sys.executable, "-m", "pip", "install", "-e", ".") | ||
|
||
# verify the environment the extension didn't break anything | ||
_(sys.executable, "-m", "pip", "check") | ||
|
||
# list the extensions | ||
_("jupyter", "server", "extension", "list") | ||
|
||
# initially list installed extensions to determine if there are any surprises | ||
_("jupyter", "labextension", "list") | ||
|
||
|
||
print("JupyterLab with k3d is ready to run with:\n") | ||
print("\tjupyter lab\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"packageManager": "python", | ||
"packageName": "k3d", | ||
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package k3d" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
version_info = (2, 10, 0) | ||
__version__ = '.'.join(map(str, version_info)) | ||
import json | ||
from pathlib import Path | ||
|
||
__all__ = ["__version__"] | ||
|
||
def _fetchVersion(): | ||
HERE = Path(__file__).parent.resolve() | ||
|
||
for settings in HERE.rglob("package.json"): | ||
try: | ||
with settings.open() as f: | ||
return json.load(f)["version"] | ||
except FileNotFoundError: | ||
pass | ||
|
||
raise FileNotFoundError(f"Could not find package.json under dir {HERE!s}") | ||
|
||
__version__ = _fetchVersion() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = [ | ||
{ | ||
id: 'k3d', | ||
autoStart: true, | ||
activate: function (app) { | ||
console.log( | ||
'JupyterLab extension k3d is activated!' | ||
); | ||
console.log(app.commands); | ||
} | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "k3d", | ||
"version": "0.1.0", | ||
"description": "3D visualization library", | ||
"keywords": [ | ||
"jupyter", | ||
"jupyterlab", | ||
"jupyterlab-extension" | ||
], | ||
"homepage": "https://github.com/K3D-tools/K3D-jupyter.git", | ||
"bugs": { | ||
"url": "https://github.com/K3D-tools/K3D-jupyter.git/issues" | ||
}, | ||
"license": "BSD-3-Clause", | ||
"author": { | ||
"name": "k3d team", | ||
"email": "" | ||
}, | ||
"files": [ | ||
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", | ||
"style/**/*.{css,.js,eot,gif,html,jpg,json,png,svg,woff2,ttf}" | ||
], | ||
"main": "lib/index.js", | ||
"style": "style/index.css", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/K3D-tools/K3D-jupyter.git.git" | ||
}, | ||
"scripts": { | ||
"build": "jlpm run build:labextension:dev", | ||
"build:prod": "jlpm run build:labextension", | ||
"build:labextension": "jupyter labextension build .", | ||
"build:labextension:dev": "jupyter labextension build --development True .", | ||
"clean:labextension": "rimraf k3d/labextension", | ||
"clean:all": "jlpm run clean:labextension", | ||
"install:extension": "jupyter labextension develop --overwrite .", | ||
"prepare": "jlpm run build:prod", | ||
"prettier": "prettier --write \"**/*{.js,.jsx,.css,.json,.md}\"", | ||
"watch": "watch:labextension", | ||
"watch:labextension": "jupyter labextension watch ." | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@jupyterlab/builder": "^3.0.0", | ||
"prettier": "^2.1.1", | ||
"rimraf": "^3.0.2" | ||
}, | ||
"sideEffects": [ | ||
"style/*.css", | ||
"style/index.js" | ||
], | ||
"styleModule": "style/index.js", | ||
"jupyterlab": { | ||
"extension": true, | ||
"outputDir": "k3d/labextension" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["jupyter_packaging~=0.7.9", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"] | ||
build-backend = "setuptools.build_meta" |
Oops, something went wrong.