diff --git a/.binder/environment.yml b/.binder/environment.yml index 1cf538e..bf4fc62 100644 --- a/.binder/environment.yml +++ b/.binder/environment.yml @@ -1,10 +1,10 @@ name: ipylab channels: -- conda-forge + - conda-forge dependencies: -- bqplot=0.12 -- ipytree=0.2 -- jupyterlab=4 -- notebook=7 -- nodejs=18 -- numpy + - bqplot=0.12 + - ipytree=0.2 + - jupyterlab=4 + - notebook=7 + - nodejs=18 + - numpy diff --git a/.copier-answers.yml b/.copier-answers.yml index 590ce15..8ef2359 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -11,4 +11,3 @@ project_short_description: Control JupyterLab from Python notebooks python_name: ipylab repository: https://github.com/jtpio/ipylab test: false - diff --git a/.github/workflows/binder-on-pr.yml b/.github/workflows/binder-on-pr.yml index dce34ef..c9ed77d 100644 --- a/.github/workflows/binder-on-pr.yml +++ b/.github/workflows/binder-on-pr.yml @@ -5,26 +5,25 @@ on: types: [opened] permissions: - pull-requests: - write + pull-requests: write jobs: binder: runs-on: ubuntu-latest steps: - - name: comment on PR with Binder link - uses: actions/github-script@v1 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO; - var PR_HEAD_REF = process.env.PR_HEAD_REF; - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=lab) :point_left: Try it on Binder (branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_)` - }) - env: - PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} - PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }} \ No newline at end of file + - name: comment on PR with Binder link + uses: actions/github-script@v1 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO; + var PR_HEAD_REF = process.env.PR_HEAD_REF; + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=lab) :point_left: Try it on Binder (branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_)` + }) + env: + PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} + PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba5940a..931e2f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: - name: Install Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' architecture: 'x64' - uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/full-release.yml b/.github/workflows/full-release.yml index 4d122dc..b585cad 100644 --- a/.github/workflows/full-release.yml +++ b/.github/workflows/full-release.yml @@ -1,26 +1,26 @@ -name: "Steps 1 + 2: Full Release" +name: 'Steps 1 + 2: Full 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 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 steps_to_skip: - description: "Comma separated list of steps to skip during Populate Release" + description: 'Comma separated list of steps to skip during Populate Release' required: false jobs: prep_release: @@ -63,7 +63,7 @@ jobs: target: ${{ github.event.inputs.target }} release_url: ${{ steps.populate-release.outputs.release_url }} - - name: "** Next Step **" + - name: '** Next Step **' if: ${{ success() }} run: | echo "Verify the final release" diff --git a/.github/workflows/prep-release.yml b/.github/workflows/prep-release.yml index 6f09281..48a0630 100644 --- a/.github/workflows/prep-release.yml +++ b/.github/workflows/prep-release.yml @@ -1,22 +1,22 @@ -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 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: @@ -36,6 +36,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 }}" diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index cf6d905..f12ec7f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -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: @@ -44,13 +44,13 @@ jobs: token: ${{ secrets.ADMIN_GITHUB_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:" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b430e9c..aea14f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,6 @@ repos: - id: check-added-large-files - id: check-case-conflict - id: check-merge-conflict - - id: check-json - id: check-toml - id: check-yaml - id: debug-statements @@ -26,6 +25,10 @@ repos: exclude: galata/.*-snapshots - id: requirements-txt-fixer - id: check-builtin-literals + - repo: https://gitlab.com/bmares/check-json5 + rev: 'v1.0.0' + hooks: + - id: check-json5 - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.28.1 hooks: diff --git a/docs/environment.yml b/docs/environment.yml index 018e5b6..aa37e19 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -9,9 +9,9 @@ dependencies: - myst-parser - ipywidgets >=8.1,<9 - jupyterlab >=4.1,<5 - - jupyterlite-core >=0.1.1,<0.2.0 - - jupyterlite-pyodide-kernel >=0.1.0,<0.2.0 - - jupyterlite-sphinx >=0.9.1,<0.10.0 + - jupyterlite-core + - jupyterlite-pyodide-kernel + - jupyterlite-sphinx - nodejs=18 - pip: - .. diff --git a/docs/jupyter_lite_config.json b/docs/jupyter_lite_config.json index 4b8e712..64f2646 100644 --- a/docs/jupyter_lite_config.json +++ b/docs/jupyter_lite_config.json @@ -2,7 +2,7 @@ "PipliteAddon": { "piplite_urls": [ "../dist", - "https://files.pythonhosted.org/packages/py3/i/ipywidgets/ipywidgets-8.1.0-py3-none-any.whl" + "https://files.pythonhosted.org/packages/py3/i/ipywidgets/ipywidgets-8.1.2-py3-none-any.whl" ] } } diff --git a/examples/generic.ipynb b/examples/generic.ipynb index d2e5194..6849794 100644 --- a/examples/generic.ipynb +++ b/examples/generic.ipynb @@ -105,7 +105,7 @@ "\n", "import inspect\n", "\n", - "print(inspect.getsource(app.shell.expandLeft))" + "str(inspect.getsource(app.shell.expandLeft))" ] }, { @@ -226,15 +226,6 @@ "source": [ "t.result()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "x" - ] } ], "metadata": { diff --git a/examples/ipytree.ipynb b/examples/ipytree.ipynb index 56922a5..548bd55 100644 --- a/examples/ipytree.ipynb +++ b/examples/ipytree.ipynb @@ -185,10 +185,10 @@ "def create_tree_widget(root, path, depth=0):\n", " node = Tree() if depth == 0 else TreeNode()\n", " for name, children in root.items():\n", - " fullpath = path + [name]\n", + " fullpath = [*path, name]\n", " if len(children) == 0:\n", " leaf = TreeNode(name)\n", - " leaf.fullpath = os.path.join(*fullpath)\n", + " leaf.fullpath = os.path.join(*fullpath) # noqa: PTH118\n", " leaf.icon = \"file\"\n", " leaf.icon_style = \"warning\"\n", " node.add_node(leaf)\n", @@ -294,16 +294,16 @@ "metadata": {}, "outputs": [], "source": [ - "def expand_tree(tree, expand=True):\n", + "def expand_tree(tree, expand=True): # noqa: FBT002\n", " for node in tree.nodes:\n", " node.opened = expand\n", "\n", "\n", - "def on_expand_click(b):\n", + "def on_expand_click(_):\n", " expand_tree(file_tree)\n", "\n", "\n", - "def on_collapse_click(b):\n", + "def on_collapse_click(_):\n", " expand_tree(file_tree, False)\n", "\n", "\n", @@ -324,7 +324,7 @@ "metadata": {}, "outputs": [], "source": [ - "def on_open_clicked(b):\n", + "def on_open_clicked(_):\n", " for node in file_tree.selected_nodes:\n", " filepath = node.fullpath\n", " if filepath:\n", diff --git a/examples/widgets.ipynb b/examples/widgets.ipynb index 7f23072..6476079 100644 --- a/examples/widgets.ipynb +++ b/examples/widgets.ipynb @@ -345,7 +345,7 @@ "outputs": [], "source": [ "app = ipylab.JupyterFrontEnd()\n", - "assert app is panel.app is split_panel.app" + "assert app is panel.app is split_panel.app # noqa: S101" ] }, { diff --git a/readthedocs.yml b/readthedocs.yml index a7c84ab..632782f 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -10,7 +10,7 @@ build: - python -m build --wheel python: install: - - method: pip - path: . + - method: pip + path: . conda: environment: docs/environment.yml