Skip to content

Commit

Permalink
Fix build workflow and add a root README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Mar 22, 2024
1 parent e159521 commit 05f081e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 82 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ jobs:
set -eux
jlpm run test
- name: Build packages
run: jlpm build

- name: Package the extension
working-directory: packages/jupyter-chat-extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "jupyter_chat_extension" jupyterlab
Expand Down
95 changes: 14 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,95 +2,28 @@

[![Github Actions Status](https://github.com/QuantStack/jupyter-chat/workflows/Build/badge.svg)](https://github.com/QuantStack/jupyter-chat/actions/workflows/build.yml)

A chat extension for Jupyterlab
A chat package for Jupyterlab extension, but also an extension for Jupyterab.

This package is composed of a Python package named `jupyter_chat`
for the server side and a NPM package named `@jupyter/chat`
for the frontend side.
## Composition

## Requirements
### Typescript package

- JupyterLab >= 4.0.0
The typescript package is located in *packages/jupyter-chat* and build an NPM
package named `@jupyter/chat`.

## Install
This package provides a frontend library (using react), and is intended to be
used by a jupyterlab extension.

To install the package, execute:
### Jupyterab extension

```bash
pip install jupyter_chat
```
The Jupyterlab extension is located in *packages/jupyter-chat-extension*.

## Uninstall
It is composed of a Python package named `jupyter_chat_extension`
for the server side and a NPM package named `@jupyter/chat-extension`.

To remove the package, execute:

```bash
pip uninstall jupyter_chat
```
This extension is an implementation of the `@jupyter/chat` package, relying on
websocket for the communication between server and front end.

## Contributing

### Development install

Note: You will need NodeJS to build the extension package.

The `jlpm` command is JupyterLab's pinned version of
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.

```bash
# Clone the repo to your local environment
# Change directory to the jupyter_chat directory
# Install package in development mode
pip install -e ".[test]"
# Rebuild Typescript source after making changes
jlpm build
```

By default, the `jlpm build` command generates the source maps for this package to make it easier to debug using the browser dev tools.

### Development uninstall

```bash
pip uninstall jupyter_chat
```

### Testing the package

#### Server tests

This extension is using [Pytest](https://docs.pytest.org/) for Python code testing.

Install test dependencies (needed only once):

```sh
pip install -e ".[test]"
```

To execute them, run:

```sh
pytest -vv -r ap --cov jupyter_chat
```

#### Frontend tests

This extension is using [Jest](https://jestjs.io/) for JavaScript code testing.

To execute them, execute:

```sh
jlpm
jlpm test
```

#### Integration tests

This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.

More information are provided within the [ui-tests](./ui-tests/README.md) README.

### Packaging the extension

See [RELEASE](RELEASE.md)
See the contributing part of each package for details.

0 comments on commit 05f081e

Please sign in to comment.