Skip to content

Commit

Permalink
widgets for apod images demo
Browse files Browse the repository at this point in the history
  • Loading branch information
MarchLiu committed Aug 19, 2024
1 parent 772b6f8 commit 91b8d30
Show file tree
Hide file tree
Showing 19 changed files with 229 additions and 73 deletions.
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ author_name: Mars Liu
has_binder: true
has_settings: true
kind: frontend
labextension_name: lichi
project_short_description: Lichi is a ai client for jupyter lab
python_name: lichi
labextension_name: litchi
project_short_description: litchi is a ai client for jupyter lab
python_name: litchi
repository: https://github.com/MarchLiu/litchi
test: true

14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
python -m pip install .[test]
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "lichi.*OK"
jupyter labextension list 2>&1 | grep -ie "litchi.*OK"
python -m jupyterlab.browser_check
- name: Package the extension
Expand All @@ -50,13 +50,13 @@ jobs:
pip install build
python -m build
pip uninstall -y "lichi" jupyterlab
pip uninstall -y "litchi" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v4
with:
name: extension-artifacts
path: dist/lichi*
path: dist/litchi*
if-no-files-found: error

test_isolated:
Expand All @@ -79,11 +79,11 @@ jobs:
sudo rm -rf $(which node)
sudo rm -rf $(which node)
pip install "jupyterlab>=4.0.0,<5" lichi*.whl
pip install "jupyterlab>=4.0.0,<5" litchi*.whl
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "lichi.*OK"
jupyter labextension list 2>&1 | grep -ie "litchi.*OK"
python -m jupyterlab.browser_check --no-browser-test
integration-tests:
Expand All @@ -109,7 +109,7 @@ jobs:
- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" lichi*.whl
python -m pip install "jupyterlab>=4.0.0,<5" litchi*.whl
- name: Install dependencies
working-directory: ui-tests
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: lichi-playwright-tests
name: litchi-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
- name: Upload Distributions
uses: actions/upload-artifact@v4
with:
name: lichi-releaser-dist-${{ github.run_number }}
name: litchi-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ node_modules/
*.egg-info/
.ipynb_checkpoints
*.tsbuildinfo
lichi/labextension
litchi/labextension
# Version file is handled by hatchling
lichi/_version.py
litchi/_version.py

# Integration tests
ui-tests/test-results/
Expand Down Expand Up @@ -123,3 +123,6 @@ dmypy.json

# Yarn cache
.yarn/

package-lock.json
yarn.lock
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
lichi
litchi
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# lichi
# litchi

[![Github Actions Status](https://github.com/MarchLiu/litchi/workflows/Build/badge.svg)](https://github.com/MarchLiu/litchi/actions/workflows/build.yml)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/MarchLiu/litchi/main?urlpath=lab)


Lichi is a ai client for jupyter lab
litchi is a ai client for jupyter lab

## Requirements

Expand All @@ -15,15 +15,15 @@ Lichi is a ai client for jupyter lab
To install the extension, execute:

```bash
pip install lichi
pip install litchi
```

## Uninstall

To remove the extension, execute:

```bash
pip uninstall lichi
pip uninstall litchi
```

## Contributing
Expand All @@ -38,7 +38,7 @@ The `jlpm` command is JupyterLab's pinned version of

```bash
# Clone the repo to your local environment
# Change directory to the lichi directory
# Change directory to the litchi directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
Expand Down Expand Up @@ -67,12 +67,12 @@ jupyter lab build --minimize=False
### Development uninstall

```bash
pip uninstall lichi
pip uninstall litchi
```

In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
folder is located. Then you can remove the symlink named `lichi` within that folder.
folder is located. Then you can remove the symlink named `litchi` within that folder.

### Testing the extension

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Making a new release of lichi
# Making a new release of litchi

The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).

Expand Down
6 changes: 3 additions & 3 deletions binder/environment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# a mybinder.org-ready environment for demoing lichi
# a mybinder.org-ready environment for demoing litchi
# this environment may also be used locally on Linux/MacOS/Windows, e.g.
#
# conda env update --file binder/environment.yml
# conda activate lichi-demo
# conda activate litchi-demo
#
name: lichi-demo
name: litchi-demo

channels:
- conda-forge
Expand Down
4 changes: 2 additions & 2 deletions binder/postBuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
""" perform a development install of lichi
""" perform a development install of litchi
On Binder, this will run _after_ the environment has been fully created from
the environment.yml in this directory.
Expand Down Expand Up @@ -43,5 +43,5 @@ _("jupyter", "server", "extension", "list")
_("jupyter", "labextension", "list")


print("JupyterLab with lichi is ready to run with:\n")
print("JupyterLab with litchi is ready to run with:\n")
print("\tjupyter lab\n")
4 changes: 2 additions & 2 deletions install.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packageManager": "python",
"packageName": "lichi",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package lichi"
"packageName": "litchi",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package litchi"
}
4 changes: 2 additions & 2 deletions lichi/__init__.py → litchi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# 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 'lichi' outside a proper installation.")
warnings.warn("Importing 'litchi' outside a proper installation.")
__version__ = "dev"


def _jupyter_labextension_paths():
return [{
"src": "labextension",
"dest": "lichi"
"dest": "litchi"
}]
22 changes: 15 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "lichi",
"name": "litchi",
"version": "0.1.0",
"description": "Lichi is a ai client for jupyter lab",
"description": "litchi is a ai client for jupyter lab",
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
"jupyterlab-extension",
"ai",
"ollama"
],
"homepage": "https://github.com/MarchLiu/litchi",
"bugs": {
Expand Down Expand Up @@ -39,7 +41,7 @@
"clean": "jlpm clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:lintcache": "rimraf .eslintcache .stylelintcache",
"clean:labextension": "rimraf lichi/labextension lichi/_version.py",
"clean:labextension": "rimraf litchi/labextension litchi/_version.py",
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
"eslint": "jlpm eslint:check --fix",
"eslint:check": "eslint . --cache --ext .ts,.tsx",
Expand All @@ -57,12 +59,18 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/settingregistry": "^4.0.0"
"@jupyterlab/application": "^4.2.4",
"@jupyterlab/apputils": "^4.3.4",
"@jupyterlab/settingregistry": "^4.0.0",
"@lumino/widgets": "^2.5.0"
},
"devDependencies": {
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/docregistry": "^4.2.4",
"@jupyterlab/notebook": "^4.2.4",
"@jupyterlab/testutils": "^4.0.0",
"@jupyterlab/ui-components": "^4.2.4",
"@lumino/disposable": "^2.1.3",
"@types/jest": "^29.2.0",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.0.26",
Expand Down Expand Up @@ -97,7 +105,7 @@
},
"jupyterlab": {
"extension": true,
"outputDir": "lichi/labextension",
"outputDir": "litchi/labextension",
"schemaDir": "schema"
},
"eslintIgnore": [
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version>=0
build-backend = "hatchling.build"

[project]
name = "lichi"
name = "litchi"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.8"
Expand Down Expand Up @@ -33,24 +33,24 @@ source = "nodejs"
fields = ["description", "authors", "urls", "keywords"]

[tool.hatch.build.targets.sdist]
artifacts = ["lichi/labextension"]
artifacts = ["litchi/labextension"]
exclude = [".github", "binder"]

[tool.hatch.build.targets.wheel.shared-data]
"lichi/labextension" = "share/jupyter/labextensions/lichi"
"install.json" = "share/jupyter/labextensions/lichi/install.json"
"litchi/labextension" = "share/jupyter/labextensions/litchi"
"install.json" = "share/jupyter/labextensions/litchi/install.json"

[tool.hatch.build.hooks.version]
path = "lichi/_version.py"
path = "litchi/_version.py"

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

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
Expand All @@ -60,7 +60,7 @@ npm = ["jlpm"]
build_cmd = "install:extension"
npm = ["jlpm"]
source_dir = "src"
build_dir = "lichi/labextension"
build_dir = "litchi/labextension"

[tool.jupyter-releaser.options]
version_cmd = "hatch version"
Expand Down
4 changes: 2 additions & 2 deletions schema/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"jupyter.lab.shortcuts": [],
"title": "lichi",
"description": "lichi settings.",
"title": "litchi",
"description": "litchi settings.",
"type": "object",
"properties": {},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Example of [Jest](https://jestjs.io/docs/getting-started) unit tests
*/

describe('lichi', () => {
describe('litchi', () => {
it('should be tested', () => {
expect(1 + 1).toEqual(2);
});
Expand Down
Loading

0 comments on commit 91b8d30

Please sign in to comment.