Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
655c9f8
add test for gfp
joamatab Dec 2, 2025
e42d785
fix pre-commit
joamatab Dec 3, 2025
f3e4c03
fix make test
joamatab Dec 3, 2025
63d2baf
fix test
joamatab Dec 3, 2025
2a657af
Refactor GitHub Actions workflow for Python tests
nikosavola Dec 3, 2025
eb5971b
Remove gdsfactoryplus from docs dependency group
nikosavola Dec 3, 2025
6dd9349
Run GDSFactory+ from its own dependency group
nikosavola Dec 3, 2025
01ac5fd
No explicit `make install` where not needed
nikosavola Dec 3, 2025
3195d83
Merge branch 'main' into test_project_in_gfp
ThomasPluck Feb 4, 2026
22646dc
Remove gfp group requirement in gfp test
ThomasPluck Feb 4, 2026
6c3fd24
Merge remote-tracking branch 'origin/main' into test_project_in_gfp
nikosavola Feb 20, 2026
106e7ef
Try test matrix for gfp
nikosavola Feb 20, 2026
cde5a83
Add an extra for gfp
nikosavola Feb 20, 2026
e1ccba5
Require gfp extra in tests
nikosavola Feb 20, 2026
fd59a05
Initial plan
Copilot Feb 28, 2026
7b7bfb6
Add top-level [tool.gdsfactoryplus] section with name = "qpdk"
Copilot Feb 28, 2026
178b549
Fix too broad env availability
nikosavola Feb 20, 2026
9e4a5d3
Merge pull request #273 from gdsfactory/copilot/fix-gdsfactoryplus-te…
nikosavola Mar 2, 2026
26cdbdd
Merge pull request #326 from gdsfactory/main
nikosavola Mar 10, 2026
13a4928
Merge branch 'main' into test_project_in_gfp
nikosavola Apr 16, 2026
f86ce48
Merge branch 'main' into test_project_in_gfp
nikosavola Apr 20, 2026
c089531
Remove duplicate `gdsfactoryplus` key from `pyproject.toml`
nikosavola Apr 20, 2026
2bc2038
Add graphics and hfss optional dependencies and cleanup CI permissions
nikosavola Apr 20, 2026
d027f55
Filter Python versions for gdsfactoryplus tests based on PyPI availab…
nikosavola Apr 20, 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
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,54 @@ jobs:
echo "One or more test jobs failed"
exit 1
fi
filter-gdsfactoryplus-versions:
needs: get-python-versions
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.filter.outputs.python-versions }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- name: Filter versions for gdsfactoryplus
id: filter
run: |
INPUT='${{ needs.get-python-versions.outputs.python-versions }}'
echo "python-versions=$(just get-gfp-versions "$INPUT")" >> "$GITHUB_OUTPUT"
test-gdsfactoryplus:
runs-on: ${{ matrix.os }}
needs: filter-gdsfactoryplus-versions
strategy:
Comment thread
nikosavola marked this conversation as resolved.
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ${{ fromJson(needs.filter-gdsfactoryplus-versions.outputs.python-versions) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
python-version: ${{ matrix.python-version }}
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- name: Test GDSFactory+
run: just test-gfp
env:
GFP_API_KEY: ${{ secrets.GFP_API_KEY }} # zizmor: ignore[secrets-outside-env]
test-gdsfactoryplus-result:
runs-on: ubuntu-latest
name: GDSFactory+ test result
needs: test-gdsfactoryplus
if: always()
steps:
- name: Check GDSFactory+ test matrix results
run: |
if [[ "${{ needs.test-gdsfactoryplus.result }}" == "success" ]]; then
echo "All GDSFactory+ test jobs succeeded"
exit 0
else
echo "One or more GDSFactory+ test jobs failed"
exit 1
fi
code-coverage:
permissions:
contents: write
Expand Down
47 changes: 47 additions & 0 deletions tests/test.just
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,50 @@ test-models-force:
[group('test')]
test-hfss *args: check-lfs
uv run --all-extras --group dev pytest -m hfss {{ args }}

# Filter a JSON array of Python versions to only those supported by the latest version of gdsfactoryplus on PyPI
[group('test')]
[script('uv', 'run', '--script')]
get-gfp-versions versions:
import json, urllib.request, sys, re
v_in = json.loads('{{ versions }}')
try:
with urllib.request.urlopen("https://pypi.org/pypi/gdsfactoryplus/json") as r:
data = json.loads(r.read().decode())

latest = data.get("info", {}).get("version")
info = data.get("info", {})
req = info.get("requires_python", "")
rels = data.get("releases", {}).get(latest, [])

v_out = []
for v in v_in:
t = v.replace(".", "")
# Check for wheels first as they are definitive
if any(f"cp{t}" in rel.get("python_version","") or f"py{t}" in rel.get("python_version","") or v in rel.get("python_version","") for rel in rels):
v_out.append(v)
elif req:
# Fallback to parsing requires_python string for the latest version
vm = int(v.split('.')[1])
# Match major.minor patterns like >=3.11, <3.14, ~=3.12
m_ge = re.search(r'>=3\.(\d+)', req)
m_lt = re.search(r'<3\.(\d+)', req)
m_ti = re.search(r'~=3\.(\d+)', req)

is_supported = True
if m_ge and vm < int(m_ge.group(1)): is_supported = False
if m_lt and vm >= int(m_lt.group(1)): is_supported = False
if m_ti and vm != int(m_ti.group(1)): is_supported = False

if is_supported:
v_out.append(v)
# If filtering resulted in an empty list, fallback to input to avoid breaking the matrix
print(json.dumps(v_out or v_in))
except Exception:
# Fallback to input versions on any error (network, parsing, etc.)
print(json.dumps(v_in))

# Run GDSFactory+ tests
[group('test')]
test-gfp:
uv run --extra gdsfactoryplus gfp test
Loading