Skip to content

Commit 234da44

Browse files
committed
upgrade to latest jupyterlab-blockly
1 parent 3b70bde commit 234da44

18 files changed

+7176
-26181
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ examples
1212
.eslintignore
1313
.eslintrc.js
1414
.gitignore
15+
16+
.yarn.yml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,6 @@ dmypy.json
117117

118118
# OSX files
119119
.DS_Store
120+
121+
# Yarn cache
122+
.yarn

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ node_modules
22
**/node_modules
33
**/lib
44
**/package.json
5+
!/package.json
56
jupyterlab_niryo_one
67

78
CHANGELOG.md

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2022, quantstack
3+
Copyright (c) 2024, QuantStack
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

MANIFEST.in

Lines changed: 0 additions & 29 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Docs: https://docs.niryo.com/dev/pyniryo/v1.1.2/en/index.html
2626

2727
## Requirements
2828

29-
- JupyterLab == 3.4
29+
- JupyterLab >= 4.0.0
3030

3131
## Install
3232

@@ -63,7 +63,7 @@ The `jlpm` command is JupyterLab's pinned version of
6363
`yarn` or `npm` in lieu of `jlpm` below.
6464

6565
```bash
66-
micromamba create -n niryo -c conda-forge python nodejs yarn jupyterlab==3.4 jupyter-packaging jupyterlab-language-pack-es-ES jupyterlab-language-pack-fr-FR ipykernel xeus-python xeus-lua
66+
micromamba create -n niryo -c conda-forge python nodejs yarn jupyterlab jupyterlab-language-pack-fr-FR ipykernel xeus-python xeus-lua
6767
micromamba activate niryo
6868
# Clone the repo to your local environment
6969
# Change directory to the jupyterlab_niryo_one directory

RELEASE.md

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,31 @@ The extension can be published to `PyPI` and `npm` manually or using the [Jupyte
66

77
### Python package
88

9-
This extension can be distributed as Python
10-
packages. All of the Python
11-
packaging instructions in the `pyproject.toml` file to wrap your extension in a
12-
Python package. Before generating a package, we first need to install `build`.
9+
This extension can be distributed as Python packages. All of the Python
10+
packaging instructions are in the `pyproject.toml` file to wrap your extension in a
11+
Python package. Before generating a package, you first need to install some tools:
1312

1413
```bash
15-
pip install build twine
14+
pip install build twine hatch
15+
```
16+
17+
Bump the version using `hatch`. By default this will create a tag.
18+
See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details.
19+
20+
```bash
21+
hatch version <new-version>
22+
```
23+
24+
Make sure to clean up all the development files before building the package:
25+
26+
```bash
27+
jlpm clean:all
28+
```
29+
30+
You could also clean up the local git repository:
31+
32+
```bash
33+
git clean -dfX
1634
```
1735

1836
To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
@@ -42,17 +60,49 @@ npm publish --access public
4260

4361
The extension repository should already be compatible with the Jupyter Releaser.
4462

45-
Check out the [workflow documentation](https://github.com/jupyter-server/jupyter_releaser#typical-workflow) for more information.
63+
Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html) for more information.
4664

4765
Here is a summary of the steps to cut a new release:
4866

49-
- Fork the [`jupyter-releaser` repo](https://github.com/jupyter-server/jupyter_releaser)
50-
- Add `ADMIN_GITHUB_TOKEN`, `PYPI_TOKEN` and `NPM_TOKEN` to the Github Secrets in the fork
67+
- Add tokens to the [Github Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in the repository:
68+
- `ADMIN_GITHUB_TOKEN` (with "public_repo" and "repo:status" permissions); see the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
69+
- `NPM_TOKEN` (with "automation" permission); see the [documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens)
70+
- Set up PyPI
71+
72+
<details><summary>Using PyPI trusted publisher (modern way)</summary>
73+
74+
- Set up your PyPI project by [adding a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
75+
- The _workflow name_ is `publish-release.yml` and the _environment_ should be left blank.
76+
- Ensure the publish release job as `permissions`: `id-token : write` (see the [documentation](https://docs.pypi.org/trusted-publishers/using-a-publisher/))
77+
78+
</details>
79+
80+
<details><summary>Using PyPI token (legacy way)</summary>
81+
82+
- If the repo generates PyPI release(s), create a scoped PyPI [token](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github). We recommend using a scoped token for security reasons.
83+
84+
- You can store the token as `PYPI_TOKEN` in your fork's `Secrets`.
85+
86+
- Advanced usage: if you are releasing multiple repos, you can create a secret named `PYPI_TOKEN_MAP` instead of `PYPI_TOKEN` that is formatted as follows:
87+
88+
```text
89+
owner1/repo1,token1
90+
owner2/repo2,token2
91+
```
92+
93+
If you have multiple Python packages in the same repository, you can point to them as follows:
94+
95+
```text
96+
owner1/repo1/path/to/package1,token1
97+
owner1/repo1/path/to/package2,token2
98+
```
99+
100+
</details>
101+
51102
- Go to the Actions panel
52-
- Run the "Draft Changelog" workflow
53-
- Merge the Changelog PR
54-
- Run the "Draft Release" workflow
55-
- Run the "Publish Release" workflow
103+
- Run the "Step 1: Prep Release" workflow
104+
- Check the draft changelog
105+
- Run the "Step 2: Publish Release" workflow
56106
57107
## Publishing to `conda-forge`
58108

examples/untitled.jpblockly

Whitespace-only changes.

jupyterlab_niryo_one/_version.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
1-
import json
2-
from pathlib import Path
3-
4-
__all__ = ["__version__"]
5-
6-
def _fetchVersion():
7-
HERE = Path(__file__).parent.resolve()
8-
9-
for settings in HERE.rglob("package.json"):
10-
try:
11-
with settings.open() as f:
12-
version = json.load(f)["version"]
13-
return (
14-
version.replace("-alpha.", "a")
15-
.replace("-beta.", "b")
16-
.replace("-rc.", "rc")
17-
)
18-
except FileNotFoundError:
19-
pass
20-
21-
raise FileNotFoundError(f"Could not find package.json under dir {HERE!s}")
22-
23-
__version__ = _fetchVersion()
1+
# This file is auto-generated by Hatchling. As such, do not:
2+
# - modify
3+
# - track in version control e.g. be sure to add to .gitignore
4+
__version__ = VERSION = '0.1.0a0'

0 commit comments

Comments
 (0)