Skip to content

Commit e7e8ae4

Browse files
authored
Merge pull request #307 from ryantam626/rt.2.0
Refactor repo with new jupyterlab extension cookiecutter
2 parents 5e935fc + ed1518e commit e7e8ae4

File tree

163 files changed

+8073
-35502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+8073
-35502
lines changed

.dockerignore

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

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Binder Badge
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
jobs:
7+
binder:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
13+
with:
14+
15+
github_token: ${{ secrets.github_token }}
16+

.github/wip-workflows/build.yml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Base Setup
18+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
19+
20+
- name: Install dependencies
21+
run: python -m pip install -U jupyterlab~=3.1
22+
23+
- name: Lint the extension
24+
run: |
25+
set -eux
26+
jlpm
27+
jlpm run lint:check
28+
29+
- name: Test the extension
30+
run: |
31+
set -eux
32+
jlpm run test
33+
34+
- name: Build the extension
35+
run: |
36+
set -eux
37+
python -m pip install .[test]
38+
39+
pytest -vv -r ap --cov jupyterlab_code_formatter
40+
jupyter server extension list
41+
jupyter server extension list 2>&1 | grep -ie "jupyterlab_code_formatter.*OK"
42+
43+
jupyter labextension list
44+
jupyter labextension list 2>&1 | grep -ie "jupyterlab_code_formatter.*OK"
45+
python -m jupyterlab.browser_check
46+
47+
- name: Package the extension
48+
run: |
49+
set -eux
50+
51+
pip install build
52+
python -m build
53+
pip uninstall -y "jupyterlab_code_formatter" jupyterlab
54+
55+
- name: Upload extension packages
56+
uses: actions/upload-artifact@v3
57+
with:
58+
name: extension-artifacts
59+
path: dist/jupyterlab_code_formatter*
60+
if-no-files-found: error
61+
62+
test_isolated:
63+
needs: build
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v3
69+
- name: Install Python
70+
uses: actions/setup-python@v4
71+
with:
72+
python-version: '3.9'
73+
architecture: 'x64'
74+
- uses: actions/download-artifact@v3
75+
with:
76+
name: extension-artifacts
77+
- name: Install and Test
78+
run: |
79+
set -eux
80+
# Remove NodeJS, twice to take care of system and locally installed node versions.
81+
sudo rm -rf $(which node)
82+
sudo rm -rf $(which node)
83+
84+
pip install "jupyterlab~=3.1" jupyterlab_code_formatter*.whl
85+
86+
87+
jupyter server extension list
88+
jupyter server extension list 2>&1 | grep -ie "jupyterlab_code_formatter.*OK"
89+
90+
jupyter labextension list
91+
jupyter labextension list 2>&1 | grep -ie "jupyterlab_code_formatter.*OK"
92+
python -m jupyterlab.browser_check --no-chrome-test
93+
94+
integration-tests:
95+
name: Integration tests
96+
needs: build
97+
runs-on: ubuntu-latest
98+
99+
env:
100+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
101+
102+
steps:
103+
- name: Checkout
104+
uses: actions/checkout@v3
105+
106+
- name: Base Setup
107+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
108+
109+
- name: Download extension package
110+
uses: actions/download-artifact@v3
111+
with:
112+
name: extension-artifacts
113+
114+
- name: Install the extension
115+
run: |
116+
set -eux
117+
python -m pip install "jupyterlab~=3.1" jupyterlab_code_formatter*.whl
118+
119+
- name: Install dependencies
120+
working-directory: ui-tests
121+
env:
122+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
123+
run: jlpm install
124+
125+
- name: Set up browser cache
126+
uses: actions/cache@v3
127+
with:
128+
path: |
129+
${{ github.workspace }}/pw-browsers
130+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
131+
132+
- name: Install browser
133+
run: jlpm playwright install chromium
134+
working-directory: ui-tests
135+
136+
- name: Execute integration tests
137+
working-directory: ui-tests
138+
run: |
139+
jlpm playwright test
140+
141+
- name: Upload Playwright Test report
142+
if: always()
143+
uses: actions/upload-artifact@v3
144+
with:
145+
name: jupyterlab_code_formatter-playwright-tests
146+
path: |
147+
ui-tests/test-results
148+
ui-tests/playwright-report
149+
150+
check_links:
151+
name: Check Links
152+
runs-on: ubuntu-latest
153+
timeout-minutes: 15
154+
steps:
155+
- uses: actions/checkout@v3
156+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
157+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Base Setup
15+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
16+
- name: Install Dependencies
17+
run: |
18+
pip install -e .
19+
- name: Check Release
20+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
21+
with:
22+
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Upload Distributions
26+
uses: actions/upload-artifact@v3
27+
with:
28+
name: jupyterlab_code_formatter-releaser-dist-${{ github.run_number }}
29+
path: .jupyter_releaser_checkout/dist
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Update Playwright Snapshots
2+
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
13+
14+
update-snapshots:
15+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots') }}
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Configure git to use https
25+
run: git config --global hub.protocol https
26+
27+
- name: Checkout the branch from the PR that triggered the job
28+
run: hub pr checkout ${{ github.event.issue.number }}
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Base Setup
33+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
34+
35+
- name: Install dependencies
36+
run: python -m pip install -U jupyterlab~=3.1
37+
38+
- name: Install extension
39+
run: |
40+
set -eux
41+
jlpm
42+
python -m pip install .
43+
44+
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
# Playwright knows how to start JupyterLab server
48+
start_server_script: 'null'
49+
test_folder: ui-tests
50+

.github/workflows/ci.yml

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

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
**/node_modules
3+
**/lib
4+
**/package.json
5+
!/package.json
6+
jupyterlab_code_formatter

docs/_sources/changelog.md.txt renamed to CHANGELOG.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,38 @@
44

55
**General**
66

7-
None
7+
- Major refactor of repo, now based off the update jupyterlab extension cookiecutter;
8+
- Introduce an actually working dockerised dev env;
89

910
**Server extension**
1011

11-
None
12+
- Add `ruff` support - courtesy of felix-cw;
1213

1314
**Jupyterlab extension**
1415

15-
None
16+
- Add `ruff` support - courtesy of felix-cw;
17+
18+
## 1.6.1 2023-04-16
19+
20+
**Server extension**
21+
22+
- Use `importlib` instead of `pkg_resources` which is being deprecated;
23+
24+
## 1.6.0 2023-03-26
25+
26+
**Server extension**
27+
28+
- Swap importable check to something more performant - courtesy of krassowski;
29+
30+
**Jupyterlab extension**
31+
32+
- Add more isort configuration settings - courtesy of dcnadler;
33+
34+
## 1.5.3 2022-08-10
35+
36+
**Server extension**
37+
38+
- Remove implicit dependency of `which` binary - courtesy of KanchiShimono;
1639

1740
## 1.5.2 2022-08-06
1841

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2018 Hin Hong TAM
1+
Copyright 2023 Ryan TAM
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

0 commit comments

Comments
 (0)