Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Align repo with the extension template (Backport #168) #191

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v4.2.1
_src_path: https://github.com/jupyterlab/extension-template
author_email: ''
author_name: JupyterLite Contributors
data_format: string
file_extension: ''
has_binder: false
has_settings: false
kind: frontend
labextension_name: '@jupyterlite/xeus-python-kernel'
mimetype: ''
mimetype_name: ''
project_short_description: A Python kernel for JupyterLite, powered by Xeus
python_name: jupyterlite-xeus-python
repository: https://github.com/jupyterlite/xeus-python-kernel
test: false
viewer_name: ''

16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -80,12 +80,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/download-artifact@v2
with:
name: jupyterlite-xeus-python-sdist

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
Expand All @@ -111,12 +111,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/download-artifact@v2
with:
name: jupyterlite-xeus-python-sdist

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
Expand All @@ -137,7 +137,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/download-artifact@v2
with:
Expand All @@ -163,7 +163,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/download-artifact@v2
with:
Expand Down
47 changes: 8 additions & 39 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,26 @@
name: Check Release
on:
push:
branches:
- main
branches: ["main"]
pull_request:
branches:
- main

permissions:
contents: write
branches: ["*"]

jobs:
check_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
architecture: 'x64'
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache checked links
uses: actions/cache@v2
with:
path: ~/.cache/pytest-link-check
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
restore-keys: |
${{ runner.os }}-linkcheck-
- name: Upgrade packaging dependencies
run: |
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:

token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Distributions
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: jupyterlite-xeus-python-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ src/worker.ts
src/web_worker_kernel.ts

# Labextension
share
jupyterlite_xeus_python/labextension

# Version file is handled by hatchling
jupyterlite_xeus_python/_version.py

# venv
.venv
Expand Down
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
jupyterlite_xeus_python
/_output
_output
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

18 changes: 9 additions & 9 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
BSD 3-Clause License

Copyright (c) 2021, Thorsten Beier
Copyright (c) 2021, JupyterLite Contributors
Copyright (c) 2021-2023, JupyterLite Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Then you only need to build JupyterLite:
jupyter lite build
```

You can also pick another name for that environment file (*e.g.* `custom.yml`), by doing so, you will need to specify that name to xeus-python:
You can also pick another name for that environment file (_e.g._ `custom.yml`), by doing so, you will need to specify that name to xeus-python:

```bash
jupyter lite build --XeusPythonEnv.environment_file=custom.yml
Expand All @@ -74,7 +74,7 @@ The `jlpm` command is JupyterLab's pinned version of

```bash
# Clone the repo to your local environment
# Change directory to the jupyterlite_xeus_python directory
# Change directory to the jupyterlite-xeus-python directory
# Install package in development mode
python -m pip install -e .

Expand All @@ -99,7 +99,7 @@ With the watch command running, every saved change will immediately be built loc
### Development uninstall

```bash
pip uninstall jupyterlite_xeus_python
pip uninstall jupyterlite-xeus-python
```

In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
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 jupyterlite_xeus_python
# Making a new release of `jupyterlite-xeus-python`

The recommended way to make a release is to use [`jupyter_releaser`](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html).

Expand Down
7 changes: 4 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Then you only need to build JupyterLite:
jupyter lite build
```

You can also pick another name for that environment file (*e.g.* `custom.yml`), by doing so, you will need to specify that name to xeus-python:
You can also pick another name for that environment file (_e.g._ `custom.yml`), by doing so, you will need to specify that name to xeus-python:

```
jupyter lite build --XeusPythonEnv.environment_file=custom.yml
Expand Down Expand Up @@ -62,6 +62,7 @@ Then those packages are usable directly:
`xeus-python` provides a way to install packages with pip.

There are a couple of limitations that you should be aware of:

- it can **only** install **pure Python packages** (Python code + data files)
- it **does not install the package dependencies**, you should make sure to install them yourself using conda-forge/emscripten-forge.
- it does not work (yet?) using `-r requirements.txt` in your environment file
Expand All @@ -78,7 +79,7 @@ dependencies:
- pillow
- ipywidgets
- pip:
- ipycanvas
- ipycanvas
```

You can also install a local Python package, this is very practical if you want to embed
Expand All @@ -91,7 +92,7 @@ channels:
- https://repo.mamba.pm/conda-forge
dependencies:
- pip:
- ..
- ..
```

## Advanced Configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## On Github Pages

In order to make your own JupyterLite deployment, you can use the [xeus-python-demo repository template](https://github.com/jupyterlite/xeus-python-demo)
In order to make your own JupyterLite deployment, you can use the [xeus-python-demo repository template](https://github.com/jupyterlite/xeus-python-demo)
that allows you to easily make a JupyteLite deployment on Github pages with xeus-python as default kernel.

This template repository contains an `environment.yml` file where you can specify the packages you need. You can also add Notebooks to the `content` folder.
Expand Down
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": "jupyterlite_xeus_python",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlite_xeus_python"
"packageName": "jupyterlite-xeus-python",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlite-xeus-python"
}
43 changes: 13 additions & 30 deletions jupyterlite_xeus_python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,16 @@
import sys
import json
from pathlib import Path

from ._version import __version__

HERE = Path(__file__).parent.resolve()
try:
from ._version import __version__
except ImportError:
# Fallback when using the package in dev mode without installing
# 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 'jupyterlite-xeus-python' outside a proper installation.")
__version__ = "dev"


def _jupyter_labextension_paths():
prefix = sys.prefix
# For when in dev mode
if (
HERE.parent
/ "share"
/ "jupyter"
/ "labextensions"
/ "@jupyterlite"
/ "xeus-python-kernel"
).parent.exists():
prefix = HERE.parent

return [
{
"src": prefix
/ "share"
/ "jupyter"
/ "labextensions"
/ "@jupyterlite"
/ "xeus-python-kernel",
"dest": "@jupyterlite/xeus-python-kernel",
}
]
return [{
"src": "labextension",
"dest": "@jupyterlite/xeus-python-kernel"
}]
21 changes: 0 additions & 21 deletions jupyterlite_xeus_python/_version.py

This file was deleted.

Loading
Loading