Skip to content

Commit

Permalink
VT-23. Update files with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
romina1601 committed Aug 2, 2024
1 parent e2d8729 commit 382757a
Show file tree
Hide file tree
Showing 9 changed files with 1,558 additions and 153 deletions.
1 change: 0 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ project_short_description: A JupyterLab extension.
python_name: tvb_ext_ontology
repository: https://github.com/the-virtual-brain/tvb-ext-ontology
test: true

236 changes: 118 additions & 118 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,83 +15,83 @@ jobs:
runs-on: ubuntu-latest

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

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0,<5"

- name: Lint the extension
run: |
set -eux
jlpm
jlpm run lint:check
- name: Test the extension
run: |
set -eux
jlpm run test
- name: Build the extension
run: |
set -eux
python -m pip install .[test]
pytest -vv -r ap --cov tvb_ext_ontology
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "tvb_ext_ontology.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "tvb-ext-ontology.*OK"
python -m jupyterlab.browser_check
- name: Package the extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "tvb_ext_ontology" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v4
with:
name: extension-artifacts
path: dist/tvb_ext_ontology*
if-no-files-found: error
- name: Checkout
uses: actions/checkout@v4

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0,<5"

- name: Lint the extension
run: |
set -eux
jlpm
jlpm run lint:check
- name: Test the extension
run: |
set -eux
jlpm run test
- name: Build the extension
run: |
set -eux
python -m pip install .[test]
pytest -vv -r ap --cov tvb_ext_ontology
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "tvb_ext_ontology.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "tvb-ext-ontology.*OK"
python -m jupyterlab.browser_check
- name: Package the extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "tvb_ext_ontology" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v4
with:
name: extension-artifacts
path: dist/tvb_ext_ontology*
if-no-files-found: error

test_isolated:
needs: build
runs-on: ubuntu-latest

steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/download-artifact@v4
with:
name: extension-artifacts
- name: Install and Test
run: |
set -eux
# Remove NodeJS, twice to take care of system and locally installed node versions.
sudo rm -rf $(which node)
sudo rm -rf $(which node)
pip install "jupyterlab>=4.0.0,<5" tvb_ext_ontology*.whl
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "tvb_ext_ontology.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "tvb-ext-ontology.*OK"
python -m jupyterlab.browser_check --no-browser-test
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/download-artifact@v4
with:
name: extension-artifacts
- name: Install and Test
run: |
set -eux
# Remove NodeJS, twice to take care of system and locally installed node versions.
sudo rm -rf $(which node)
sudo rm -rf $(which node)
pip install "jupyterlab>=4.0.0,<5" tvb_ext_ontology*.whl
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "tvb_ext_ontology.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "tvb-ext-ontology.*OK"
python -m jupyterlab.browser_check --no-browser-test
integration-tests:
name: Integration tests
Expand All @@ -102,53 +102,53 @@ jobs:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

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

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Download extension package
uses: actions/download-artifact@v4
with:
name: extension-artifacts

- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" tvb_ext_ontology*.whl
- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests

- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v4
with:
name: tvb_ext_ontology-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
- name: Checkout
uses: actions/checkout@v4

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Download extension package
uses: actions/download-artifact@v4
with:
name: extension-artifacts

- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" tvb_ext_ontology*.whl
- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests

- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v4
with:
name: tvb_ext_ontology-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
check_links:
name: Check Links
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Check Release
on:
push:
branches: ["main"]
branches: ['main']
pull_request:
branches: ["*"]
branches: ['*']

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -20,7 +20,6 @@ jobs:
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:

token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Distributions
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: "Step 1: Prep Release"
name: 'Step 1: Prep Release'
on:
workflow_dispatch:
inputs:
version_spec:
description: "New Version Specifier"
default: "next"
description: 'New Version Specifier'
default: 'next'
required: false
branch:
description: "The branch to target"
description: 'The branch to target'
required: false
post_version_spec:
description: "Post Version Specifier"
description: 'Post Version Specifier'
required: false
# silent:
# description: "Set a placeholder in the changelog and don't publish the release."
# required: false
# type: boolean
since:
description: "Use PRs with activity since this date or git reference"
description: 'Use PRs with activity since this date or git reference'
required: false
since_last_stable:
description: "Use PRs with activity since the last stable git tag"
description: 'Use PRs with activity since the last stable git tag'
required: false
type: boolean
jobs:
Expand All @@ -43,6 +43,6 @@ jobs:
since: ${{ github.event.inputs.since }}
since_last_stable: ${{ github.event.inputs.since_last_stable }}

- name: "** Next Step **"
- name: '** Next Step **'
run: |
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"
12 changes: 6 additions & 6 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: "Step 2: Publish Release"
name: 'Step 2: Publish Release'
on:
workflow_dispatch:
inputs:
branch:
description: "The target branch"
description: 'The target branch'
required: false
release_url:
description: "The URL of the draft GitHub release"
description: 'The URL of the draft GitHub release'
required: false
steps_to_skip:
description: "Comma separated list of steps to skip"
description: 'Comma separated list of steps to skip'
required: false

jobs:
Expand Down Expand Up @@ -45,13 +45,13 @@ jobs:
token: ${{ steps.app-token.outputs.token }}
release_url: ${{ steps.populate-release.outputs.release_url }}

- name: "** Next Step **"
- name: '** Next Step **'
if: ${{ success() }}
run: |
echo "Verify the final release"
echo ${{ steps.finalize-release.outputs.release_url }}
- name: "** Failure Message **"
- name: '** Failure Message **'
if: ${{ failure() }}
run: |
echo "Failed to Publish the Draft Release Url:"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/update-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
github.event.issue.author_association == 'MEMBER'
) && github.event.issue.pull_request && contains(github.event.comment.body, 'please update snapshots')
runs-on: ubuntu-latest

steps:
- name: React to the triggering comment
run: |
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@jupyterlab/application": "^4.2.4",
"@jupyterlab/apputils": "^4.3.4",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/galata": "^5.2.4",
"@jupyterlab/launcher": "^4.2.4",
"@jupyterlab/services": "^7.0.0",
"@lumino/widgets": "^2.4.0"
Expand Down
4 changes: 3 additions & 1 deletion ui-tests/tests/tvb_ext_ontology.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ test('should emit an activation console message', async ({ page }) => {
await page.goto();

expect(
logs.filter(s => s === 'JupyterLab extension tvb-ext-ontology is activated!')
logs.filter(
s => s === 'JupyterLab extension tvb-ext-ontology is activated!'
)
).toHaveLength(1);
});
Loading

0 comments on commit 382757a

Please sign in to comment.