Skip to content

Commit 6a8b002

Browse files
hbcarlosfcollonval
andauthored
Releaser (#90)
* Update workflows * Adds bump version script * Build JS package * Adds work around for building JS package * Uses hatch-nodejs-version and hatchling version * Clean up * Review * Include package.json * Apply suggestions from code review * Exclude `javascript` from Python package * Keep including package.json Co-authored-by: Frédéric Collonval <[email protected]>
1 parent b7bf137 commit 6a8b002

File tree

7 files changed

+119
-106
lines changed

7 files changed

+119
-106
lines changed

.github/workflows/check-release.yml

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,27 @@ jobs:
1414
strategy:
1515
matrix:
1616
group: [check_release, link_check]
17+
python-version: ["3.9"]
18+
node-version: ["14.x"]
1719
steps:
1820
- name: Checkout
1921
uses: actions/checkout@v2
20-
- name: Install Python
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: 3.9
24-
architecture: "x64"
25-
- name: Install node
26-
uses: actions/setup-node@v2
27-
with:
28-
node-version: "14.x"
29-
- name: Get pip cache dir
30-
id: pip-cache
31-
run: |
32-
echo "::set-output name=dir::$(pip cache dir)"
33-
- name: Cache pip
34-
uses: actions/cache@v1
35-
with:
36-
path: ${{ steps.pip-cache.outputs.dir }}
37-
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
38-
restore-keys: |
39-
${{ runner.os }}-pip-
40-
${{ runner.os }}-pip-
41-
- name: Cache checked links
42-
if: ${{ matrix.group == 'link_check' }}
43-
uses: actions/cache@v2
44-
with:
45-
path: ~/.cache/pytest-link-check
46-
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md', '**/*.rst') }}-md-links
47-
restore-keys: |
48-
${{ runner.os }}-linkcheck-
49-
- name: Upgrade packaging dependencies
50-
run: |
51-
pip install --upgrade pip setuptools wheel --user
22+
- name: Base Setup
23+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
5224
- name: Install Dependencies
5325
run: |
54-
pip install .
26+
pip install -e .
27+
- name: Check Links
28+
if: ${{ matrix.group == 'link_check' }}
29+
uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1
5530
- name: Check Release
5631
if: ${{ matrix.group == 'check_release' }}
57-
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
32+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
5833
with:
5934
token: ${{ secrets.GITHUB_TOKEN }}
60-
- name: Check Links
61-
if: ${{ matrix.group == 'link_check' }}
62-
uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1
35+
- name: Upload Distributions
36+
if: ${{ matrix.group == 'check_release' }}
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: jupyter-releaser-dist-${{ github.run_number }}
40+
path: .jupyter_releaser_checkout/dist
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Enforce PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
7+
jobs:
8+
enforce-label:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- name: enforce-triage-label
14+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,4 @@ tests/package-lock.json
133133
javascript/tsconfig.tsbuildinfo
134134
javascript/.eslintcache
135135
javascript/coverage/
136+
jupyter_ydoc/_version.py

javascript/package.json

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
{
2-
"name": "@jupyter-notebook/ydoc",
3-
"version": "0.2.0",
4-
"type": "module",
5-
"description": "Jupyter document structures for collaborative editing using YJS",
6-
"homepage": "https://github.com/jupyter-server/jupyter_ydoc",
7-
"bugs": {
8-
"url": "https://github.com/jupyter-server/jupyter_ydoc/issues"
9-
},
10-
"repository": {
11-
"type": "git",
12-
"url": "https://github.com/jupyter-server/jupyter_ydoc.git"
13-
},
14-
"license": "BSD-3-Clause",
15-
"author": "Project Jupyter",
16-
"main": "lib/index.js",
17-
"types": "lib/index.d.ts",
18-
"directories": {
19-
"lib": "lib/"
20-
},
21-
"files": [
22-
"lib/**/*.{d.ts,js,js.map,json}"
23-
],
24-
"scripts": {
25-
"build": "tsc -b",
26-
"build:test": "tsc --build tsconfig.test.json",
27-
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
28-
"docs": "typedoc src",
29-
"eslint": "eslint --ext .js,.jsx,.ts,.tsx --cache --fix .",
30-
"eslint:check": "eslint --ext .js,.jsx,.ts,.tsx --cache .",
31-
"lint": "yarn prettier && yarn eslint",
32-
"lint:check": "yarn prettier:check && yarn eslint:check",
33-
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json}\"",
34-
"prettier:check": "prettier --check \"**/*{.ts,.tsx,.js,.jsx,.css,.json}\"",
35-
"test": "jest",
36-
"test:cov": "jest --collect-coverage",
37-
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
38-
"test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch",
39-
"watch": "tsc -b --watch"
40-
},
41-
"dependencies": {
42-
"@jupyterlab/nbformat": "^3.0.0 || ^4.0.0-alpha.15",
43-
"@lumino/coreutils": "^1.11.0 || ^2.0.0-alpha.6",
44-
"@lumino/disposable": "^1.10.0 || ^2.0.0-alpha.6",
45-
"@lumino/signaling": "^1.10.0 || ^2.0.0-alpha.6",
46-
"y-protocols": "^1.0.5",
47-
"yjs": "^13.5.40"
48-
},
49-
"devDependencies": {
50-
"@types/jest": "^29.0.0",
2+
"name": "@jupyter-notebook/ydoc",
3+
"version": "0.2.2",
4+
"type": "module",
5+
"description": "Jupyter document structures for collaborative editing using YJS",
6+
"homepage": "https://github.com/jupyter-server/jupyter_ydoc",
7+
"bugs": {
8+
"url": "https://github.com/jupyter-server/jupyter_ydoc/issues"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/jupyter-server/jupyter_ydoc.git"
13+
},
14+
"license": "BSD-3-Clause",
15+
"author": "Project Jupyter",
16+
"main": "lib/index.js",
17+
"types": "lib/index.d.ts",
18+
"directories": {
19+
"lib": "lib/"
20+
},
21+
"files": [
22+
"lib/**/*.{d.ts,js,js.map,json}"
23+
],
24+
"scripts": {
25+
"build": "tsc -b",
26+
"build:test": "tsc --build tsconfig.test.json",
27+
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
28+
"docs": "typedoc src",
29+
"eslint": "eslint --ext .js,.jsx,.ts,.tsx --cache --fix .",
30+
"eslint:check": "eslint --ext .js,.jsx,.ts,.tsx --cache .",
31+
"lint": "yarn prettier && yarn eslint",
32+
"lint:check": "yarn prettier:check && yarn eslint:check",
33+
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json}\"",
34+
"prettier:check": "prettier --check \"**/*{.ts,.tsx,.js,.jsx,.css,.json}\"",
35+
"test": "jest",
36+
"test:cov": "jest --collect-coverage",
37+
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
38+
"test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch",
39+
"watch": "tsc -b --watch"
40+
},
41+
"dependencies": {
42+
"@jupyterlab/nbformat": "^3.0.0 || ^4.0.0-alpha.15",
43+
"@lumino/coreutils": "^1.11.0 || ^2.0.0-alpha.6",
44+
"@lumino/disposable": "^1.10.0 || ^2.0.0-alpha.6",
45+
"@lumino/signaling": "^1.10.0 || ^2.0.0-alpha.6",
46+
"y-protocols": "^1.0.5",
47+
"yjs": "^13.5.40"
48+
},
49+
"devDependencies": {
50+
"@types/jest": "^29.0.0",
5151
"@typescript-eslint/eslint-plugin": "^5.36.0",
5252
"@typescript-eslint/parser": "^5.36.0",
5353
"eslint": "^8.17.0",
@@ -58,8 +58,8 @@
5858
"prettier": "^2.6.0",
5959
"rimraf": "^3.0.0",
6060
"typescript": "^4.8.0"
61-
},
62-
"publishConfig": {
63-
"access": "public"
64-
}
61+
},
62+
"publishConfig": {
63+
"access": "public"
64+
}
6565
}

jupyter_ydoc/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22

3+
from ._version import __version__ # noqa
34
from .ydoc import YFile, YNotebook # noqa
45

56
# See compatibility note on `group` keyword in
@@ -10,5 +11,3 @@
1011
from importlib.metadata import entry_points
1112

1213
ydocs = {ep.name: ep.load() for ep in entry_points(group="jupyter_ydoc")}
13-
14-
__version__ = "0.2.2"

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@jupyter-notebook/ydoc-top-repo",
3+
"version": "0.0.1",
4+
"private": true,
5+
"files": [],
6+
"workspaces": {
7+
"packages": [
8+
"javascript"
9+
]
10+
}
11+
}

pyproject.toml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
[build-system]
2-
requires = [
3-
"hatchling>=1.10.0",
4-
]
2+
requires = ["hatchling>=1.10.0", "hatch-nodejs-version"]
53
build-backend = "hatchling.build"
64

75
[project]
86
name = "jupyter-ydoc"
9-
dynamic = [
10-
"version",
11-
]
7+
dynamic = ["version"]
128
description = "Document structures for collaborative editing using Ypy"
139
requires-python = ">=3.7"
14-
keywords = [
15-
"jupyter",
16-
"ypy",
17-
]
10+
keywords = ["jupyter", "ypy"]
1811
dependencies = [
1912
"importlib_metadata >=3.6; python_version<\"3.10\"",
2013
"y-py >=0.5.3,<0.6.0",
@@ -32,6 +25,10 @@ test = [
3225
"websockets >=10.0",
3326
"ypy-websocket >=0.3.1,<0.4.0",
3427
]
28+
dev = [
29+
"click",
30+
"jupyter_releaser"
31+
]
3532

3633
[project.entry-points.jupyter_ydoc]
3734
file = "jupyter_ydoc.ydoc:YFile"
@@ -46,20 +43,33 @@ text = "BSD 3-Clause License"
4643

4744
[project.urls]
4845
Homepage = "https://jupyter.org"
46+
Source = "https://github.com/jupyter-server/jupyter_ydoc"
4947

5048
[tool.hatch.version]
51-
path = "jupyter_ydoc/__init__.py"
49+
source = "nodejs"
50+
path = "javascript/package.json"
51+
52+
[tool.hatch.build]
53+
exclude = ["javascript", "!javascript/package.json"]
54+
55+
[tool.hatch.build.hooks.version]
56+
path = "jupyter_ydoc/_version.py"
5257

5358
[tool.check-manifest]
54-
ignore = [
55-
".*",
56-
]
59+
ignore = [".*"]
5760

5861
[tool.jupyter-releaser]
5962
skip = [
6063
"check-links",
6164
"check-manifest",
6265
]
6366

67+
[tool.jupyter-releaser.hooks]
68+
before-build-npm = ["cd javascript && yarn && yarn build"]
69+
before-bump-version = ["pip install -e .[dev]"]
70+
71+
[tool.jupyter-releaser.options]
72+
version_cmd = "hatch version"
73+
6474
[tool.flake8]
6575
max-line-length = 100

0 commit comments

Comments
 (0)