Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
59 changes: 49 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- master
- testci
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- master
Expand All @@ -19,20 +21,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
# Reduce matrix size - only test edge cases on all platforms
- os: macos-latest
python-version: "3.10"
- os: macos-latest
- os: macos-latest
python-version: "3.11"
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
python-version: "3.11"
- os: windows-latest
python-version: "3.12"

Expand All @@ -56,7 +58,7 @@ jobs:

- name: Verify UV installation
run: uv --version

- name: Create virtual environment
run: uv venv

Expand Down Expand Up @@ -106,8 +108,6 @@ jobs:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}



- name: Verify React build artifacts
working-directory: iris
shell: bash
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
uv run iris demo --admin-user admin --admin-password 123 &
SERVER_PID=$!
echo "Started IRIS server with PID: $SERVER_PID"

# Wait for server to be ready (max 60 seconds)
echo "Waiting for server to start..."
for i in {1..60}; do
Expand All @@ -154,16 +154,55 @@ jobs:
fi
sleep 1
done

# Run Cypress tests in headless mode (from iris/ subdirectory)
echo "Running Cypress E2E tests..."
cd iris
npm run cypress:headless || TEST_EXIT_CODE=$?

# Stop the server
echo "Stopping IRIS server..."
kill $SERVER_PID 2>/dev/null || true
wait $SERVER_PID 2>/dev/null || true

# Exit with test result
exit ${TEST_EXIT_CODE:-0}

- name: Install pypa/build & build a binary wheel and a source tarball
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: |
python -m pip install build --user
python -m build

- name: Store the distribution packages
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: actions/upload-artifact@v5
with:
name: python-package-distributions
path: dist/

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- test
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/esa-iris

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
skip-existing: true
8 changes: 0 additions & 8 deletions MANIFEST.in

This file was deleted.

1 change: 1 addition & 0 deletions demo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# dummy Python module for rearranging files for packaging
9 changes: 5 additions & 4 deletions iris/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@


def get_demo_file(example=None):
demo_file = join(
os.getcwd(), "demo", "cloud-segmentation.json"
)
demo_file_repo = Path(__file__).parent.parent / "demo" / "cloud-segmentation.json"
demo_file_installed = Path(__file__).parent / "demo" / "cloud-segmentation.json"

demo_file = demo_file_repo if demo_file_repo.exists() else demo_file_installed
return str(demo_file)
Comment on lines 21 to +26
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated get_demo_file function should have test coverage to ensure it correctly handles both development (repository) and installed package scenarios. Consider adding tests that verify the function returns the correct path in both cases.

Copilot uses AI. Check for mistakes.

return demo_file

def find_config_file(folder_path: Union[str, Path]) -> Union[Path, None]:
"""Find a suitable config file in the given folder.
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,23 @@ Repository = "https://github.com/ESA-PhiLab/iris"
[project.scripts]
iris = "iris:run_app"

[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
version = {attr = "iris.__version__"}

[tool.setuptools.packages.find]
include = ["iris*"]
where = ["."]
include = ["iris", "iris.*", "iris.demo"]
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern "iris.*" already matches all subpackages under iris, making the explicit "iris.demo" entry redundant. Consider removing "iris.demo" from the include list since it's already covered by the wildcard pattern.

Suggested change
include = ["iris", "iris.*", "iris.demo"]
include = ["iris", "iris.*"]

Copilot uses AI. Check for mistakes.

# Map the package name `iris.demo` to the *directory* `demo/`
[tool.setuptools.package-dir]
"iris.demo" = "demo"

[tool.setuptools.package-data]
iris = ["*.json", "*/templates/*", "*/static/*/*"]
"iris.demo" = ["**/*"]

[tool.black]
line-length = 120
Expand Down
Loading