Skip to content

Commit

Permalink
Merge branch 'main' into #246-unified-external-file-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py authored Jan 7, 2025
2 parents ca98b29 + 3f11f6f commit f22c2d0
Show file tree
Hide file tree
Showing 14 changed files with 199 additions and 58 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'monthly'
groups:
gha-dependencies:
patterns:
- '*'
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Description

<!--
Insert Pull Request description here.
What does this PR change? Why?
-->

## Checklist

- [ ] PR has a descriptive title and content.
- [ ] PR has one of the labels: documentation, bug, enhancement, feature, maintenance
- [ ] Checks are passing.
Failing lint checks can be resolved with:
- `pre-commit run --all-files`
- `jlpm run lint`
35 changes: 16 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

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

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-name: gis
create-args: >-
Expand All @@ -28,7 +28,7 @@ jobs:
xyzservices
- name: Setup pip cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-3.9-${{ hashFiles('package.json') }}
Expand All @@ -41,7 +41,7 @@ jobs:
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Setup yarn cache
uses: actions/cache@v2
uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:

steps:
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-name: gis
create-args: >-
Expand All @@ -90,7 +90,7 @@ jobs:
qgis
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install
shell: bash -l {0}
Expand Down Expand Up @@ -144,10 +144,10 @@ jobs:

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

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.5.5-0'
environment-name: gis
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
Expand Down Expand Up @@ -216,10 +216,10 @@ jobs:

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

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-name: gis
create-args: >-
Expand All @@ -239,9 +239,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
with:
ignore_links: 'lite/'

build-docs-and-lite:
name: Build docs with JupyterLite deployment
Expand All @@ -250,10 +252,10 @@ jobs:

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

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.5.5-0'
environment-name: build-env
Expand Down Expand Up @@ -294,11 +296,6 @@ jobs:
path: ./docs/dist
retention-days: 30

- name: Save artifact data
uses: trungleduc/appsharingspace-pr-comment/.github/actions/save-artifact-link@v2
with:
artifact_link: 'https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}}/artifacts/${{ steps.upload-docs-artifact.outputs.artifact_id }}'

deploy:
needs: build-docs-and-lite
if: github.ref == 'refs/heads/main'
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/comment-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,6 @@ permissions:
pull-requests: write

jobs:
comment-preview:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Comment APSS link on workflow'
uses: trungleduc/appsharingspace-pr-comment/.github/actions/pr-comment@v2
with:
comment_prefix: '**Preview using JupyterLite:**'
github_token: ${{ secrets.github_token }}
index_path: lite/lab/index.html
comment-docs-preview:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Comment APSS link on workflow'
uses: trungleduc/appsharingspace-pr-comment/.github/actions/pr-comment@v2
with:
comment_prefix: '**Docs preview:**'
github_token: ${{ secrets.github_token }}
index_path: index.html
comment-galata:
runs-on: ubuntu-latest
if: >
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/pr-rtd-link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# The ReadTheDocs preview link is "hidden" within the GitHub "Checks"
# interface. For users who don't know this, finding the preview link may be
# very difficult or frustrating. This workflow makes the link more
# findable by updating PR descriptions to include it.
name: 'Add ReadTheDocs preview link to PR description'

on:
pull_request_target:
types:
- 'opened'

permissions:
pull-requests: 'write'

jobs:
autolink-rtd-previews:
runs-on: 'ubuntu-latest'
steps:
- uses: 'readthedocs/actions/preview@v1'
with:
project-slug: 'jupytergis'
message-template: |
---
📚 Documentation preview: {docs-pr-index-url}
💡 JupyterLite preview is available from the doc, by clicking on ![lite badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)
4 changes: 2 additions & 2 deletions .github/workflows/update_galata_references.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
fi
- name: Download extension package
uses: dawidd6/action-download-artifact@v6
uses: dawidd6/action-download-artifact@v7
with:
pr: ${{github.event.issue.number}}
workflow: 'build.yml'
Expand All @@ -79,7 +79,7 @@ jobs:
allow_forks: true

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-name: gis
create-args: >-
Expand Down
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exclude: '.*\.jgis$'
repos:
# Autoformat and linting, misc. details
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: forbid-new-submodules
- id: end-of-file-fixer
Expand All @@ -27,8 +27,14 @@ repos:

# Autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
rev: v0.8.6
hooks:
- id: ruff
args: ['--fix']
- id: ruff-format

- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.4
hooks:
- id: rstcheck
args: ['--ignore-directives=tabs,toctree,autoclass', '--report-level=warning']
53 changes: 53 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html
version: 2

build:
os: "ubuntu-24.04"
tools:
nodejs: "20"
jobs:
# Install micromamba
pre_create_environment:
# The recommended syntax in the micromamba docs is process substitution.
# RTD's default shell chokes on it, so we're doing it in multiple steps
# instead.
- curl -L micro.mamba.pm/install.sh > /tmp/micromamba-install.sh
- chmod +x /tmp/micromamba-install.sh
# For some reason, SHELL is not set. The install script requires it.
- SHELL=/bin/bash /bin/bash /tmp/micromamba-install.sh

# Override the create_environment step (undocumented feature) to create
# multiple environments.
create_environment:
# Create the env for building the docs
- /bin/bash --login -c "micromamba env create -n jupytergis-docs -f docs/environment-docs.yml"
# Create the isolated env for building JupyterGIS
- /bin/bash --login -c "micromamba create -n jupytergis-build -c conda-forge yarn=3 hatch pip python=3.10"
- /bin/bash --login -c "micromamba run -n jupytergis-build pip install -r requirements-build.txt"

# Override the install step to do nothing - we already created the envs
install:
- "echo 'Skipping! We already have the environments we need.'"

# Before building the docs, build JupyterGIS in its isolated environment,
# then install the wheels into the docs environment.
pre_build:
- /bin/bash --login -c "micromamba run -n jupytergis-build yarn install"
- /bin/bash --login -c "micromamba run -n jupytergis-build yarn dev"
- /bin/bash --login -c "micromamba run -n jupytergis-build jupyter labextension list 2>&1 | grep -ie 'jupytergis-core.*OK'"
- /bin/bash --login -c "micromamba run -n jupytergis-build jupyter labextension list 2>&1 | grep -ie 'jupytergis-lab.*OK'"
- /bin/bash --login -c "micromamba run -n jupytergis-build yarn build:packages"

- |-
/bin/bash --login -c "micromamba run -n jupytergis-docs \
python -m pip install \
$(ls ./python/jupytergis_core/dist/jupytergis*.whl) \
$(ls ./python/jupytergis_lab/dist/jupytergis*.whl) \
$(ls ./python/jupytergis_qgis/dist/jupytergis*.whl)"
build:
html:
- |-
/bin/bash --login -c "cd docs && micromamba run -n jupytergis-docs \
python -m sphinx -T -b html -d _build/doctrees -D language=en . \
$READTHEDOCS_OUTPUT/html"
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<p align="center"><img width="300" src="https://raw.githubusercontent.com/geojupyter/jupytergis/main/packages/base/style/icons/logo.svg"></p>
<h1 align="center">JupyterGIS</h1>
<h2 align="center">A JupyterLab extension for collaborative GIS</h1>
<p align="center"><img width="100" src="https://raw.githubusercontent.com/geojupyter/jupytergis/main/packages/base/style/icons/logo.svg"></p>
<h1 align="center">JupyterGIS - A JupyterLab extension for collaborative GIS</h1>

[![lite-badge]][lite] [![docs-badge]][docs]

[lite-badge]: https://jupyterlite.rtfd.io/en/latest/_static/badge.svg
[lite]: https://geojupyter.github.io/jupytergis/lite/lab/index.html?path=france_hiking.jGIS/
[docs-badge]: https://readthedocs.org/projects/jupytergis/badge/?version=latest
[docs]: https://geojupyter.github.io/jupytergis

⚠️ This extension is work in progress. Features and APIs are subject to change quickly. ⚠️

Expand Down
Loading

0 comments on commit f22c2d0

Please sign in to comment.