Skip to content

Commit

Permalink
Set Qt offscreen in jupytergis-qgis (#131)
Browse files Browse the repository at this point in the history
* Set Qt offscreen in jupytergis-qgis

This will ease user setting up jupytergis on a server

* Add comment
  • Loading branch information
martinRenou authored Sep 11, 2024
1 parent 7fac129 commit b77a0c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ jobs:
yarn=3
qgis
- name: Set QT env var
shell: bash -l {0}
run: echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@v3

Expand Down Expand Up @@ -166,10 +162,6 @@ jobs:
with:
name: extension-artifacts

- name: Set QT env var
shell: bash -l {0}
run: echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV

- name: Install the extension
shell: bash -l {0}
run: |
Expand Down
4 changes: 4 additions & 0 deletions python/jupytergis_qgis/jupytergis_qgis/qgis_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
QgsVectorTileLayer,
)

# Prevent any Qt application and event loop to spawn when
# using the QGIS Python app
os.environ["QT_QPA_PLATFORM"] = "offscreen"

QgsApplication.setPrefixPath(sys.prefix)

qgs = QgsApplication([], False)
Expand Down

0 comments on commit b77a0c0

Please sign in to comment.