Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
79e05e7
- updated invalid columnspan to colspan attribute
doublebyte1 Dec 8, 2025
985c155
- added layout and scrollable area to top level widget
doublebyte1 Dec 8, 2025
a12de62
- put back connections
doublebyte1 Dec 8, 2025
a69ed6f
- introduced server radio
doublebyte1 Dec 8, 2025
49b80e5
- added server config dialog
doublebyte1 Dec 8, 2025
fbaf594
- added option to specify server protocol
doublebyte1 Dec 8, 2025
76e795b
- added support for pushing and pulling configiration from a pygeoapi…
doublebyte1 Dec 8, 2025
3bc869a
- added another radio for local file option
doublebyte1 Dec 15, 2025
93ba679
- added server_config_dialog.ui to pb_tool configuration
doublebyte1 Dec 15, 2025
b1cc03f
- added more expressive error messages
doublebyte1 Dec 15, 2025
17f09ad
remove redundant data import functionality; make sure to check diff o…
KatKatKateryna Dec 17, 2025
9bd10af
remove redundant datetime conversion
KatKatKateryna Dec 17, 2025
602cf2a
centralize stringifying datetime strings for Diff and Save
KatKatKateryna Dec 18, 2025
33e379d
accept +0000 format datetime (comes from requests)
KatKatKateryna Dec 19, 2025
e68ee93
ignore datetime diffs for different datetime formats
KatKatKateryna Dec 19, 2025
7c7ffc8
consider case where datetime was parsed from the beginning (was never…
KatKatKateryna Dec 19, 2025
0797389
bring back yaml representer removing string quotes from datetime objects
KatKatKateryna Dec 19, 2025
a5f584a
ensure utf-8 encoding on push_to_server
KatKatKateryna Dec 19, 2025
280df83
typo
KatKatKateryna Dec 19, 2025
375338d
- set test plattform to Windows
doublebyte1 Dec 29, 2025
b70e111
- added unit test for server push and pull
doublebyte1 Dec 29, 2025
5b1ed99
- Added GitHub action to test the server round trip
doublebyte1 Dec 29, 2025
292e445
use default language for Metadata and Resources dict
KatKatKateryna Dec 31, 2025
bec3a7d
confirm before deleting resource
KatKatKateryna Jan 2, 2026
7ea1acc
Merge pull request #9 from byteroad/server-tests
KatKatKateryna Jan 2, 2026
af61c2b
Merge pull request #12 from KatKatKateryna/kate/server_connection_fixes
doublebyte1 Jan 5, 2026
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
39 changes: 38 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- master
jobs:
test-on-pr:
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -18,12 +18,49 @@ jobs:
with:
python-version: '3.12'

- name: Start pygeoapi container
run: |
docker run --rm -d \
-p 5000:80 \
--rm --name=pygeoapi \
geopython/pygeoapi:latest run-with-hot-reload

- name: Wait for service to be ready
run: |
# This gives the container a few seconds to initialize
timeout 60s bash -c 'until curl -s localhost:5000 > /dev/null; do sleep 2; done'
echo "pygeoapi is up and running"

- name: Enable admin api
run: |
docker exec pygeoapi sed -i 's/admin: .*/admin: true/' /pygeoapi/local.config.yml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_dev.txt

- name: Install GUI dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgl1 \
libegl1 \
libglx-mesa0 \
libglib2.0-0t64 \
libdbus-1-3 \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxcb-xfixes0 \
libxcb-shape0

- name: Run unit tests (headless PyQt)
env:
QT_QPA_PLATFORM: offscreen
Expand Down
13 changes: 3 additions & 10 deletions models/ConfigData.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass, field, fields, is_dataclass
from datetime import datetime, timezone
from datetime import datetime
from enum import Enum

from .utils import update_dataclass_from_dict
Expand All @@ -9,6 +9,7 @@
MetadataConfig,
ResourceConfigTemplate,
)
from ..utils.helper_functions import datetime_to_string
from .top_level.utils import InlineList
from .top_level.providers import ProviderTemplate
from .top_level.providers.records import ProviderTypes
Expand Down Expand Up @@ -141,14 +142,6 @@ def all_missing_props(self):
return self._all_missing_props
return []

def datetime_to_string(self, data: datetime):
# normalize to UTC and format with Z
if data.tzinfo is None:
data = data.replace(tzinfo=timezone.utc)
else:
data = data.astimezone(timezone.utc)
return data.strftime("%Y-%m-%dT%H:%M:%SZ")

def asdict_enum_safe(self, obj, datetime_to_str=False):
"""Overwriting dataclass 'asdict' fuction to replace Enums with strings."""
if is_dataclass(obj):
Expand Down Expand Up @@ -177,7 +170,7 @@ def asdict_enum_safe(self, obj, datetime_to_str=False):
}
else:
if isinstance(obj, datetime) and datetime_to_str:
return self.datetime_to_string(obj)
return datetime_to_string(obj)
else:
return obj

Expand Down
14 changes: 0 additions & 14 deletions models/top_level/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,3 @@ def bbox_from_list(raw_bbox_list: list):
)

return InlineList(list_bbox_val)


def to_iso8601(dt: datetime) -> str:
"""
Convert datetime to UTC ISO 8601 string, for both naive and aware datetimes.
"""
if dt.tzinfo is None:
# Treat naive datetime as UTC
dt = dt.replace(tzinfo=timezone.utc)
else:
# Convert to UTC
dt = dt.astimezone(timezone.utc)

return dt.strftime("%Y-%m-%dT%H:%M:%SZ")
20 changes: 9 additions & 11 deletions models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
from types import UnionType
from typing import Any, get_origin, get_args, Union, get_type_hints

from .top_level.utils import InlineList, get_enum_value_from_string
from .top_level.utils import (
InlineList,
get_enum_value_from_string,
)
from ..utils.helper_functions import datetime_from_string


def update_dataclass_from_dict(
Expand Down Expand Up @@ -67,12 +71,7 @@ def update_dataclass_from_dict(
if (datetime in args or expected_type is datetime) and isinstance(
new_value, str
):
try:
new_value = datetime.strptime(
new_value, "%Y-%m-%dT%H:%M:%SZ"
)
except:
pass
new_value = datetime_from_string(new_value)

# Exception: remap str to Enum
elif isinstance(expected_type, type) and issubclass(
Expand Down Expand Up @@ -294,11 +293,10 @@ def _is_instance_of_type(value, expected_type) -> bool:

# Exception: try cast str to datetime manually
if expected_type is datetime:
try:
datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ")
if datetime_from_string(value) is not None:
return True
except:
pass
else:
return False

# Fallback for normal types
return isinstance(value, expected_type)
Expand Down
2 changes: 1 addition & 1 deletion pb_tool.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ python_files: __init__.py pygeoapi_config.py pygeoapi_config_dialog.py
main_dialog: pygeoapi_config_dialog_base.ui

# Other ui files for dialogs you create (these will be compiled)
compiled_ui_files:
compiled_ui_files: server_config_dialog.ui

# Resource file(s) that will be compiled
resource_files: resources.qrc
Expand Down
1 change: 1 addition & 0 deletions pygeoapi_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

# Import the code for the dialog
from .pygeoapi_config_dialog import PygeoapiConfigDialog

import os.path


Expand Down
Loading