Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.18 wip #182

Merged
merged 89 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
ca50209
UI rearrangements
KatKatKateryna Dec 7, 2023
1665e0f
ci deployment, basic test
KatKatKateryna Jan 4, 2024
c918313
add codecov
KatKatKateryna Jan 4, 2024
5792a8a
add docker compose
KatKatKateryna Jan 4, 2024
8df1cf1
move file
KatKatKateryna Jan 4, 2024
b186733
locate tests
KatKatKateryna Jan 4, 2024
e5ca9bc
launch config pytest
KatKatKateryna Jan 4, 2024
803424c
add pytest to .toml
KatKatKateryna Jan 4, 2024
30c251d
remove unittests
KatKatKateryna Jan 5, 2024
96d1337
temporary try-except
KatKatKateryna Jan 5, 2024
d89d462
move conftest to same level
KatKatKateryna Jan 9, 2024
0cbaded
adjust dev group in poetry
KatKatKateryna Jan 11, 2024
067e0f2
cleaning, splitting modules; fix tree structure for saved layers
KatKatKateryna Jan 13, 2024
4530aab
reorg
KatKatKateryna Jan 15, 2024
9682316
splitting qgis-using functions, testing others
KatKatKateryna Jan 16, 2024
6a07792
tests fixed, running through venv
KatKatKateryna Jan 16, 2024
50186bf
switch off debug mode
KatKatKateryna Jan 16, 2024
a494cff
add pyqt to .dev dependencies
KatKatKateryna Jan 16, 2024
2a3e716
utils tested
KatKatKateryna Jan 16, 2024
6f00f66
types meshes to test
KatKatKateryna Jan 16, 2024
c2f8c07
all geometry module tested (no qgis library)
KatKatKateryna Jan 16, 2024
d743e8b
typo in type checks
KatKatKateryna Jan 17, 2024
55abee1
account token warnings fix; cancel send btn move before server send
KatKatKateryna Jan 18, 2024
d6f59fa
poetry lock before install; remove pyqt
KatKatKateryna Jan 18, 2024
1f597c8
typo
KatKatKateryna Jan 18, 2024
12f5d59
manually append sys.path in conftest
KatKatKateryna Jan 18, 2024
53cd64d
add correct directory
KatKatKateryna Jan 18, 2024
f0f9050
try with pythonpath
KatKatKateryna Jan 18, 2024
7f497ed
fixed poetry; add dummy tests to test path
KatKatKateryna Jan 18, 2024
69e0b77
wrap main __init to try/except
KatKatKateryna Jan 18, 2024
01756ca
test
KatKatKateryna Jan 18, 2024
405adbc
edit conftest
KatKatKateryna Jan 18, 2024
2ac1ce9
fix path test
KatKatKateryna Jan 18, 2024
c4757c8
get exec file path
KatKatKateryna Jan 18, 2024
8d15306
add valid path
KatKatKateryna Jan 18, 2024
8e61945
path append
KatKatKateryna Jan 18, 2024
4dcb4d7
fix module path
KatKatKateryna Jan 18, 2024
2080733
more path tests
KatKatKateryna Jan 18, 2024
55d7523
import module
KatKatKateryna Jan 18, 2024
494e89b
attach workspace for tests
KatKatKateryna Jan 18, 2024
8b91047
.
KatKatKateryna Jan 18, 2024
88755a7
proper tests with dataStorage
KatKatKateryna Jan 18, 2024
f6ac08f
restructuting
KatKatKateryna Jan 18, 2024
6182086
fix import errors
KatKatKateryna Jan 19, 2024
51308e2
run tests from osgeo shell
KatKatKateryna Jan 19, 2024
10f614b
remove unnecessary void conversion; check on points list len before c…
KatKatKateryna Jan 22, 2024
c103dcf
more clear messaging; upon send transform all arcs to polygons, apply…
KatKatKateryna Jan 23, 2024
3b702b4
remove any arcs from sending polylines
KatKatKateryna Jan 23, 2024
758c194
option to cancel background operation
KatKatKateryna Jan 25, 2024
8c0b50a
split tests to repositories
KatKatKateryna Jan 25, 2024
f53f8f2
fixes and ci step to run only non-qgis tests
KatKatKateryna Jan 29, 2024
c403097
properly remove directory
KatKatKateryna Jan 29, 2024
c5c7e9a
typings
KatKatKateryna Jan 29, 2024
93dda1f
tests
KatKatKateryna Jan 29, 2024
097cee5
remove unavailable modules
KatKatKateryna Jan 29, 2024
72f04fb
remove qgis_tests
KatKatKateryna Jan 29, 2024
1d68455
run test on PR
KatKatKateryna Jan 29, 2024
e81d719
fix
KatKatKateryna Jan 29, 2024
bff7a08
random commit
KatKatKateryna Jan 29, 2024
dc1c85b
random commit
KatKatKateryna Jan 29, 2024
700cafb
remove filters (in CI settings - run on PR)
KatKatKateryna Jan 29, 2024
7d7e5db
chnage terminology to FE2
KatKatKateryna Jan 30, 2024
6a8d6a2
add transparency to NA mesh values
KatKatKateryna Jan 31, 2024
9a26bf5
update description with unsupported data types
KatKatKateryna Jan 31, 2024
fb2ca74
logging failed Sends
KatKatKateryna Jan 31, 2024
46023d1
rename metrics
KatKatKateryna Jan 31, 2024
f82c9b3
change point reprojection algorithm
KatKatKateryna Jan 31, 2024
deaf2d7
restrict sending unsupported data providers
KatKatKateryna Jan 31, 2024
81473d1
bug with inaccessible stream
KatKatKateryna Feb 1, 2024
f572f3a
bug with sending data to correct stream (not necessarily Active stream)
KatKatKateryna Feb 1, 2024
b244961
send layers applicationID
KatKatKateryna Feb 1, 2024
70eaeb2
Revert "send layers applicationID"
KatKatKateryna Feb 1, 2024
2e79069
fix polygon conversion by passing correct xform
KatKatKateryna Feb 1, 2024
89cdd3f
random notes
KatKatKateryna Feb 5, 2024
053b090
assign applicationId to features and layers
KatKatKateryna Feb 5, 2024
49d3668
tests placeholders
KatKatKateryna Feb 5, 2024
6faa4a7
remove print
KatKatKateryna Feb 5, 2024
f459278
Merge branch '2.18' into unit_tests
KatKatKateryna Feb 5, 2024
c709e6a
fix module import
KatKatKateryna Feb 5, 2024
596ced6
fix unintentional modification of original geometry
KatKatKateryna Feb 5, 2024
e3e1edd
fake error
KatKatKateryna Feb 5, 2024
d2b6644
fix applicattionId on send
KatKatKateryna Feb 5, 2024
0967dc7
minimum supported qgis - LTR 3.28.15
KatKatKateryna Feb 5, 2024
742db67
don't save layer with unsupported providers
KatKatKateryna Feb 6, 2024
5b33f84
Revert "don't save layer with unsupported providers"
KatKatKateryna Feb 6, 2024
a6e4f0c
notify of unsupported providers both on Send and on Save selection
KatKatKateryna Feb 6, 2024
d9f60c0
fix report; account for ArcGIS commits
KatKatKateryna Feb 11, 2024
673b0bf
move UI reading to start
KatKatKateryna Feb 12, 2024
abc75ce
upgrade specklepy
KatKatKateryna Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 83 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbs:
win: circleci/[email protected]
# Upload artifacts to s3
aws-s3: circleci/[email protected]
codecov: codecov/[email protected]

jobs:

Expand Down Expand Up @@ -94,7 +95,50 @@ jobs:
root: ./
paths:
- zip_build


test:
machine:
image: ubuntu-2204:2023.02.1
docker_layer_caching: false
resource_class: medium
parameters:
tag:
default: "3.11"
type: string
steps:
- checkout
- attach_workspace:
at: ./
- run:
name: Install python
command: |
pyenv install -s << parameters.tag >>
pyenv global << parameters.tag >>
- run:
name: Startup the Speckle Server
command: docker compose -f docker-compose.yml up -d
- run:
name: Install Poetry
command: |
pip install poetry
- run:
name: Install packages
command: |
poetry lock --no-update
poetry install
- run:
name: Remove qgis tests
command: |
rm -rf ./tests_qgis
- run:
name: Run tests
command: poetry run pytest --cov --cov-report xml:reports/coverage.xml --junitxml=reports/test-results.xml
- store_test_results:
path: reports
- store_artifacts:
path: reports
- codecov/upload

build-connector-win: # Reusable job for basic connectors
executor:
name: win/default # comes with python 3.7.3
Expand Down Expand Up @@ -228,7 +272,23 @@ jobs:
-o << parameters.os >> \
-a << parameters.arch >> \
-f speckle-sharp-ci-tools/Installers/qgis/<< parameters.slug >>-${SEMVER}.<< parameters.extension >>
workflows: #happens with every PR to main
workflows: # happens with every PR to main
test_on_pr: # build the installers, but don't persist to workspace for deployment
jobs:
- get-ui:
context: github-dev-bot
- get-ci-tools:
context: github-dev-bot
- package:
requires:
- get-ui
- get-ci-tools
- test:
requires:
- package
matrix:
parameters:
tag: ["3.11"]
build: # build the installers, but don't persist to workspace for deployment
jobs:
- get-ui:
Expand All @@ -246,9 +306,16 @@ workflows: #happens with every PR to main
- get-ui
- get-ci-tools
filters: *build_filters
- build-connector-win:
- test:
requires:
- package
matrix:
parameters:
tag: ["3.11"]
filters: *build_filters
- build-connector-win:
requires:
- test
filters: *build_filters
context: innosetup

Expand All @@ -257,7 +324,6 @@ workflows: #happens with every PR to main
slug: qgis-mac-arm
runtime: osx-arm64
requires:
- package
- build-connector-win
filters: *build_filters

Expand All @@ -266,11 +332,10 @@ workflows: #happens with every PR to main
slug: qgis-mac-intel
runtime: osx-x64
requires:
- package
- build-connector-win
filters: *build_filters

deploy: # build installers and deploy
deploy: # build installers and deploy
jobs:
- get-ui:
context: github-dev-bot
Expand All @@ -295,11 +360,22 @@ workflows: #happens with every PR to main
requires:
- get-ui
- get-ci-tools
- test:
requires:
- package
matrix:
parameters:
tag: ["3.11"]
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- build-connector-win:
slug: qgis
installer: true
requires:
- package
- test
filters: &deploy_filters
tags:
only: /([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w+)?$/
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
./idea/
/.vscode/
/speckle_qgis_dialog_base.ui.autosave

# Byte-compiled / optimized / DLL files
Expand Down Expand Up @@ -118,6 +117,9 @@ zip_build
.qt_for_python
speckle-sharp-ci-tools*
zip-build*
*.dbf
*.shp
*.shx

/typings/*
*.csv
Expand Down
39 changes: 39 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "pytest",
"type": "python",
"request": "launch",
"module": "pytest",
"justMyCode": true
},
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"env": {
"PYTHONPATH": "C:/Users/katri/AppData/Roaming/Python/Python39"
}
},
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}
]
}
]
}
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@ This repo contains the QGIS plugin for Speckle 2.0. It is written in `python` an
> The following geometry types are supported for now:
>
> - Point
> - Multipoint
> - MultiPoint
> - Polyline (LineString)
> - MultiLineString
> - Polygon
> - MultiPolygon
> - **More to come!!**
>
> Data types currently not supported for sending:
> - Layers depending on the server connection (WMS, WFC, WCS etc.)
> - Scenes
> - Mesh Vector layers
> - Pointclouds
>
> If you have questions, you can always find us at our [Community forum](https://speckle.community)

## Installation
Expand Down Expand Up @@ -140,7 +146,7 @@ YOUR_PYTHON_EXECUTABLE -m pip install pb_tool

For a better development experience in your editor, we recommend creating a virtual environment. In the venv, you'll just need to install `specklepy`. You will also need to copy over the `qgis` module into the `{venv}/Lib/site-packages`. You can find the `qgis` module in your QGIS install directory:

- Windows: `C:\Program Files\QGIS 3.20.1\apps\qgis\python`
- Windows: `C:\Program Files\QGIS 3.28.15\apps\qgis\python`
- MacOS: `/Applications/QGIS.app/Contents/Resources/python`

![qgis dependency for venv](https://user-images.githubusercontent.com/7717434/129324330-1744cc1e-8657-4ef1-90eb-d1ffb2b0229e.png)
Expand Down
70 changes: 35 additions & 35 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,49 @@
if path not in sys.path:
sys.path.insert(0, path)

from plugin_utils.installer import ensure_dependencies, startDebugger
from speckle.utils.panel_logging import logger
try:
from plugin_utils.installer import ensure_dependencies, startDebugger
from speckle.utils.panel_logging import logger

from qgis.core import Qgis
from qgis.core import Qgis

# noinspection PyPep8Naming
def classFactory(iface): # pylint: disable=invalid-name
"""Load SpeckleQGIS class from file SpeckleQGIS.

# noinspection PyPep8Naming
def classFactory(iface): # pylint: disable=invalid-name
"""Load SpeckleQGIS class from file SpeckleQGIS.
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""

:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
# Set qgisInterface to enable logToUser notifications
logger.qgisInterface = iface
iface.pluginToolBar().setVisible(True)

# Set qgisInterface to enable logToUser notifications
logger.qgisInterface = iface
iface.pluginToolBar().setVisible(True)
# Ensure dependencies are installed in the machine
startDebugger()
ensure_dependencies("QGIS")

# Ensure dependencies are installed in the machine
# from speckle.utils import enable_remote_debugging
# enable_remote_debugging()
startDebugger()
ensure_dependencies("QGIS")
from speckle_qgis import SpeckleQGIS
from specklepy.logging import metrics

from speckle_qgis import SpeckleQGIS
from specklepy.logging import metrics
version = (
Qgis.QGIS_VERSION.encode("iso-8859-1", errors="ignore")
.decode("utf-8")
.split(".")[0]
)
metrics.set_host_app("QGIS", f"QGIS{version}")
return SpeckleQGIS(iface)

version = (
Qgis.QGIS_VERSION.encode("iso-8859-1", errors="ignore")
.decode("utf-8")
.split(".")[0]
)
metrics.set_host_app("QGIS", f"QGIS{version}")
return SpeckleQGIS(iface)
class EmptyClass:
# https://docs.qgis.org/3.28/en/docs/pyqgis_developer_cookbook/plugins/plugins.html#mainplugin-py
def __init__(self, iface):
pass

def initGui(self):
pass

class EmptyClass:
# https://docs.qgis.org/3.28/en/docs/pyqgis_developer_cookbook/plugins/plugins.html#mainplugin-py
def __init__(self, iface):
pass
def unload(self):
pass

def initGui(self):
pass

def unload(self):
pass
except ModuleNotFoundError:
pass
Loading