Skip to content

Commit d654a6e

Browse files
brichetjtpio
andauthored
Create the labextension and a first version of the puller (#4)
* Create the labextension * Git puller implementation * Fix ui-test * prettier * Fix jupyterlab version at build, and fix some node dependencies * Start version at 0.0.1 and fix links * rename the plugin Co-authored-by: Jeremy Tuloup <[email protected]> * Avoid checking mybinder link * Try regex for ignore_links --------- Co-authored-by: Jeremy Tuloup <[email protected]>
1 parent b111f5d commit d654a6e

32 files changed

+9883
-2
lines changed

.github/workflows/binder-on-pr.yml

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/workflows/build.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
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+
jupyter labextension list
40+
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/litegitpuller.*OK"
41+
python -m jupyterlab.browser_check
42+
43+
- name: Package the extension
44+
run: |
45+
set -eux
46+
47+
pip install build
48+
python -m build
49+
pip uninstall -y "litegitpuller" jupyterlab
50+
51+
- name: Upload extension packages
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: extension-artifacts
55+
path: dist/litegitpuller*
56+
if-no-files-found: error
57+
58+
test_isolated:
59+
needs: build
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v3
65+
- name: Install Python
66+
uses: actions/setup-python@v4
67+
with:
68+
python-version: '3.9'
69+
architecture: 'x64'
70+
- uses: actions/download-artifact@v3
71+
with:
72+
name: extension-artifacts
73+
- name: Install and Test
74+
run: |
75+
set -eux
76+
# Remove NodeJS, twice to take care of system and locally installed node versions.
77+
sudo rm -rf $(which node)
78+
sudo rm -rf $(which node)
79+
80+
pip install "jupyterlab~=3.1" litegitpuller*.whl
81+
82+
83+
jupyter labextension list
84+
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/litegitpuller.*OK"
85+
python -m jupyterlab.browser_check --no-chrome-test
86+
87+
integration-tests:
88+
name: Integration tests
89+
needs: build
90+
runs-on: ubuntu-latest
91+
92+
env:
93+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
94+
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v3
98+
99+
- name: Base Setup
100+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
101+
102+
- name: Download extension package
103+
uses: actions/download-artifact@v3
104+
with:
105+
name: extension-artifacts
106+
107+
- name: Install the extension
108+
run: |
109+
set -eux
110+
python -m pip install "jupyterlab~=3.1" litegitpuller*.whl
111+
112+
- name: Install dependencies
113+
working-directory: ui-tests
114+
env:
115+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
116+
run: jlpm install
117+
118+
- name: Set up browser cache
119+
uses: actions/cache@v3
120+
with:
121+
path: |
122+
${{ github.workspace }}/pw-browsers
123+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
124+
125+
- name: Install browser
126+
run: jlpm playwright install chromium
127+
working-directory: ui-tests
128+
129+
- name: Execute integration tests
130+
working-directory: ui-tests
131+
run: |
132+
jlpm playwright test
133+
134+
- name: Upload Playwright Test report
135+
if: always()
136+
uses: actions/upload-artifact@v3
137+
with:
138+
name: litegitpuller-playwright-tests
139+
path: |
140+
ui-tests/test-results
141+
ui-tests/playwright-report
142+
143+
check_links:
144+
name: Check Links
145+
runs-on: ubuntu-latest
146+
timeout-minutes: 15
147+
steps:
148+
- uses: actions/checkout@v3
149+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
150+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
151+
with:
152+
ignore_links: "https://playwright.dev/docs/intro/ https://mybinder.org/v2/gh/jupyterlite/litegitpuller/main.*"
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: litegitpuller-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+

.gitignore

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
*.bundle.*
2+
lib/
3+
node_modules/
4+
*.log
5+
.eslintcache
6+
.stylelintcache
7+
*.egg-info/
8+
.ipynb_checkpoints
9+
*.tsbuildinfo
10+
litegitpuller/labextension
11+
# Version file is handled by hatchling
12+
litegitpuller/_version.py
13+
14+
# Integration tests
15+
ui-tests/test-results/
16+
ui-tests/playwright-report/
17+
18+
# Created by https://www.gitignore.io/api/python
19+
# Edit at https://www.gitignore.io/?templates=python
20+
21+
### Python ###
22+
# Byte-compiled / optimized / DLL files
23+
__pycache__/
24+
*.py[cod]
25+
*$py.class
26+
27+
# C extensions
28+
*.so
29+
30+
# Distribution / packaging
31+
.Python
32+
build/
33+
develop-eggs/
34+
dist/
35+
downloads/
36+
eggs/
37+
.eggs/
38+
lib/
39+
lib64/
40+
parts/
41+
sdist/
42+
var/
43+
wheels/
44+
pip-wheel-metadata/
45+
share/python-wheels/
46+
.installed.cfg
47+
*.egg
48+
MANIFEST
49+
50+
# PyInstaller
51+
# Usually these files are written by a python script from a template
52+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
53+
*.manifest
54+
*.spec
55+
56+
# Installer logs
57+
pip-log.txt
58+
pip-delete-this-directory.txt
59+
60+
# Unit test / coverage reports
61+
htmlcov/
62+
.tox/
63+
.nox/
64+
.coverage
65+
.coverage.*
66+
.cache
67+
nosetests.xml
68+
coverage/
69+
coverage.xml
70+
*.cover
71+
.hypothesis/
72+
.pytest_cache/
73+
74+
# Translations
75+
*.mo
76+
*.pot
77+
78+
# Scrapy stuff:
79+
.scrapy
80+
81+
# Sphinx documentation
82+
docs/_build/
83+
84+
# PyBuilder
85+
target/
86+
87+
# pyenv
88+
.python-version
89+
90+
# celery beat schedule file
91+
celerybeat-schedule
92+
93+
# SageMath parsed files
94+
*.sage.py
95+
96+
# Spyder project settings
97+
.spyderproject
98+
.spyproject
99+
100+
# Rope project settings
101+
.ropeproject
102+
103+
# Mr Developer
104+
.mr.developer.cfg
105+
.project
106+
.pydevproject
107+
108+
# mkdocs documentation
109+
/site
110+
111+
# mypy
112+
.mypy_cache/
113+
.dmypy.json
114+
dmypy.json
115+
116+
# Pyre type checker
117+
.pyre/
118+
119+
# End of https://www.gitignore.io/api/python
120+
121+
# OSX files
122+
.DS_Store

.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+
litegitpuller

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
<!-- <START NEW CHANGELOG ENTRY> -->
4+
5+
<!-- <END NEW CHANGELOG ENTRY> -->

0 commit comments

Comments
 (0)