From fef633ae8959fbaf7d778c64b4b5d463d6be3201 Mon Sep 17 00:00:00 2001 From: Duc Trung Le Date: Wed, 20 Nov 2024 10:33:42 +0100 Subject: [PATCH] Update workflow --- .github/workflows/build.yml | 104 +++++++++++----------- .github/workflows/check-release.yml | 2 +- .github/workflows/deploy.yml | 47 ---------- .prettierignore | 3 + lerna.json | 5 +- package.json | 4 +- python/jupyter_suggestions/pyproject.toml | 6 +- tsconfig.eslint.json | 4 + 8 files changed, 67 insertions(+), 108 deletions(-) delete mode 100644 .github/workflows/deploy.yml create mode 100644 tsconfig.eslint.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2b3476..f5fa07f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,72 +15,72 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - 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: 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: Lint the extension + run: | + set -eux + jlpm + jlpm run lint:check - - name: Build the extension - run: | - set -eux - python -m pip install .[test] + - name: Build the extension + run: | + set -eux + jlpm dev - jupyter labextension list - jupyter labextension list 2>&1 | grep -ie "jupyter-suggestions.*OK" - python -m jupyterlab.browser_check + jupyter labextension list + jupyter labextension list 2>&1 | grep -ie "jupyter-suggestions.*OK" + python -m jupyterlab.browser_check - - name: Package the extension - run: | - set -eux + - name: Package the extension + run: | + set -eux - pip install build - python -m build - pip uninstall -y "jupyterlab_suggestions" jupyterlab + pip install hatch + yarn build:packages - - name: Upload extension packages - uses: actions/upload-artifact@v4 - with: - name: extension-artifacts - path: dist/jupyterlab_suggestions* - if-no-files-found: error + - name: Upload extension packages + uses: actions/upload-artifact@v4 + with: + name: extension-artifacts + path: | + python/*/dist/jupyter_suggestions* + 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" jupyterlab_suggestions*.whl - - - jupyter labextension list - jupyter labextension list 2>&1 | grep -ie "jupyter-suggestions.*OK" - python -m jupyterlab.browser_check --no-browser-test - + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + 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) + + cp ./jupyter_suggestions_core/dist/jupyter_suggestions*.whl . + pip install "jupyterlab>=4.0.0,<5" jupyter_suggestions*.whl + + + jupyter labextension list + jupyter labextension list 2>&1 | grep -ie "jupyter-suggestions.*OK" + python -m jupyterlab.browser_check --no-browser-test check_links: name: Check Links diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 107107d..26ef946 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -20,7 +20,7 @@ jobs: - name: Check Release uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 with: - + version_spec: next token: ${{ secrets.GITHUB_TOKEN }} - name: Upload Distributions diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 6bf879a..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Build and Deploy - -on: - push: - branches: - - main - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - name: Install the dependencies - run: | - python -m pip install jupyterlite-core jupyterlite-pyodide-kernel . - - name: Build the JupyterLite site - run: | - jupyter lite build --output-dir dist - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ./dist - - deploy: - needs: build - if: github.ref == 'refs/heads/main' - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.prettierignore b/.prettierignore index 500a6f1..a0d4a70 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,3 +4,6 @@ node_modules **/package.json !/package.json jupyterlab_suggestions +**/*.js +**/*.d.ts +**/labextension/* \ No newline at end of file diff --git a/lerna.json b/lerna.json index a344539..4a456ac 100644 --- a/lerna.json +++ b/lerna.json @@ -2,8 +2,5 @@ "npmClient": "yarn", "version": "independent", "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "packages": [ - "packages/*", - "python/jupyter_suggestions_core" - ] + "packages": ["packages/*", "python/jupyter_suggestions_core"] } diff --git a/package.json b/package.json index f9a9cff..5f4241c 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"", "prettier:check": "jlpm prettier:base --check", "stylelint": "jlpm stylelint:check --fix", - "stylelint:check": "stylelint --cache \"style/**/*.css\"" + "stylelint:check": "stylelint --cache \"**/style/**/*.css\"" }, "devDependencies": { "@jupyterlab/builder": "^4.0.0", @@ -91,7 +91,7 @@ ], "parser": "@typescript-eslint/parser", "parserOptions": { - "project": "tsconfig.json", + "project": "tsconfig.eslint.json", "sourceType": "module" }, "plugins": [ diff --git a/python/jupyter_suggestions/pyproject.toml b/python/jupyter_suggestions/pyproject.toml index 3882034..09cd628 100644 --- a/python/jupyter_suggestions/pyproject.toml +++ b/python/jupyter_suggestions/pyproject.toml @@ -17,10 +17,12 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", ] -dependencies = [] +dependencies = [ + "jupyter_suggestions_core==0.1.0" +] dynamic = ["version", "description", "authors", "urls", "keywords"] license = {file = "LICENSE"} -name = "jupyterlab_suggestions" +name = "jupyter_suggestions" readme = "README.md" requires-python = ">=3.9" diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 0000000..5a1dece --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfigbase", + "include": ["packages/**/*", "python/**/*"] +}