Skip to content
Merged
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
Binary file removed .DS_Store
Binary file not shown.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Python 3.13 on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install Linux graphics build dependency
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --yes libegl1
- name: Install layout-viewer-core
run: python -m pip install "layout-viewer-core @ git+https://github.com/OpenEngiTools/layout-viewer-core.git"
- name: Install package and development tools
run: python -m pip install -e ".[dev]"
- name: Run tests
run: python -m pytest
- name: Check lint and formatting
run: |
python -m ruff check
python -m ruff format --check
- name: Build distributions
run: python -m build
48 changes: 44 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,50 @@
.venv/
# Python bytecode
__pycache__/
*.py[cod]
*$py.class

# Virtual environments
.venv/
venv/
env/
.env/

# Packaging
build/
dist/
*.egg-info/
.eggs/
*.egg

# Tests, coverage, and analysis caches
.pytest_cache/
.ruff_cache/
.mypy_cache/
.pyre/
.hypothesis/
.tox/
.nox/
.coverage
.coverage.*
coverage.xml
htmlcov/
build/
dist/
*.egg-info/

# Local environment configuration
.env
.env.*
!.env.example

# Editor and operating-system files
.idea/
*.swp
*.swo
*~
.DS_Store
Thumbs.db
Desktop.ini

# Logs and temporary files
*.log
*.tmp
*.tmp/
*.bak
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

Notable changes to this project are documented here.

## Unreleased

- Add Python/Linux/Windows CI, reproducible development checks, and contributor
and release guidance.
- Bound supported PyEDB, layout-viewer-core, and ansys-edb-core minor versions.
- Require Python 3.13 or newer.
62 changes: 62 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Contributing

## Supported environments

The package requires Python 3.13 or newer. CI exercises Python 3.13 on Linux
and Windows; other Python versions and macOS are not currently in the automated
matrix. Runtime compatibility is bounded to PyEDB 0.87.x,
`layout-viewer-core` 0.1.x, and `ansys-edb-core` 0.3.x. The CI job installs
`layout-viewer-core` from its companion GitHub repository, installs the
current compatible dependency set, and tests the bundled EDB fixture when an
AEDT runtime is installed. That integration test is skipped otherwise.
Rendering and interactive GUI behavior still require a usable Qt/RHI runtime
and should be smoke-tested on the target machine.

## Development setup

This repository expects the sibling `layout_viewer_core` checkout for local
development:

```text
OpenEngiTools/
├── edb-layout-viewer/
└── layout_viewer_core/
```

From the repository root, create the environment and install the development
dependencies:

```bash
uv sync --extra dev
```

The `uv` source override uses the sibling checkout in editable mode. For a
non-`uv` setup, install that checkout and this project:

```bash
python -m pip install -e ../layout_viewer_core
python -m pip install -e ".[dev]"
```

## Checks

Run the same checks as CI:

```bash
uv run --extra dev pytest
uv run --extra dev ruff check
uv run --extra dev ruff format --check
uv run --extra dev python -m build
```

Add or update tests when changing public behavior, capture/conversion logic,
live-update behavior, or supported dependency interfaces. Keep the fixture
tests independent of proprietary design data.

## Release checklist

1. Update the version in `pyproject.toml` and add a dated entry to
`CHANGELOG.md`.
2. Run the checks above and review the built wheel and source distribution.
3. Have a maintainer publish the package and create a matching version tag.
Do not commit generated distribution files.
16 changes: 9 additions & 7 deletions IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,21 @@ of the caller's EDB session.

## Development checks

Install the sibling core library and test extra, then run the test suite with:
From the repository root, run the test suite with `uv` (the sibling
`layout_viewer_core` package is resolved from the local source configured in
`pyproject.toml`):

```bash
pip install -e ../layout-viewer-core
pip install -e ".[test]"
pytest
uv run --extra dev pytest
```

Check formatting and lint with Ruff:
Check lint and formatting with Ruff, then build the wheel and source
distribution:

```bash
ruff check
ruff format --check
uv run --extra dev ruff check
uv run --extra dev ruff format --check
uv run --extra dev python -m build
```

Full EDB capture and Qt rendering checks require the project dependencies and a
Expand Down
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ an actionable `ImportError` if `layout-viewer-core` is not installed.
## Installation

```bash
python -m pip install -e ../layout-viewer-core
python -m pip install -e ".[test]"
python -m pip install -e ../layout_viewer_core
python -m pip install -e ".[dev]"
```

## Usage
Expand All @@ -28,11 +28,36 @@ edb = Edb("my_design.aedb", edbversion="2025.1")
launch_viewer(edb)
```

### Command line

After installation, open a design directly from the shell:

```bash
edb-layout-viewer my_design.aedb --edbversion 2025.1 --layers TOP BOTTOM --nets VCC GND
python -m edb_layout_viewer my_design.aedb
```

Omit the design path to open a file dialog and select the design's `edb.def` file:

```bash
edb-layout-viewer
python -m edb_layout_viewer
```

The viewer opens the selected file's containing directory. Cancelling the dialog
exits without opening an EDB session.

Run `edb-layout-viewer --help` for all options (`--backend`, `--debug`, `--live [true|false]`, default false).

## Implementation

See [IMPLEMENTATION.md](IMPLEMENTATION.md) for the package structure, capture
and update flows, error behavior, and development checks.

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, supported
environments, checks, and release guidance. Changes are recorded in
[CHANGELOG.md](CHANGELOG.md).

## License

Apache-2.0. See `LICENSE`.
79 changes: 46 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,46 @@
[build-system]
requires = ["flit_core>=3.11,<5"]
build-backend = "flit_core.buildapi"

[project]
name = "edb-viewer-adapter"
version = "0.1.0"
description = "EDB integration for the layout viewer."
readme = "README.md"
requires-python = ">=3.10,<4"
license = "Apache-2.0"
license-files = ["LICENSE"]
authors = [{name = "OpenEngiTools"}]
dependencies = ["pyedb", "layout-viewer-core>=0.1.0", "ansys-edb-core>=0.3.3"]

[project.optional-dependencies]
test = ["pytest>=8.0"]

[tool.flit.module]
name = "edb_layout_viewer"

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]

[tool.ruff]
line-length = 120
fix = true

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
[build-system]
requires = ["flit_core>=3.11,<5"]
build-backend = "flit_core.buildapi"

[project]
name = "edb-viewer-adapter"
version = "0.1.0"
description = "EDB integration for the layout viewer."
readme = "README.md"
requires-python = ">=3.13,<4"
license = "Apache-2.0"
license-files = ["LICENSE"]
authors = [{ name = "OpenEngiTools" }]
dependencies = [
"pyedb>=0.87.0,<0.88",
"layout-viewer-core @ git+https://github.com/OpenEngiTools/layout-viewer-core.git",
# "layout-viewer-core>=0.1.0,<0.2",
"ansys-edb-core>=0.3.3,<0.4",
]

[project.scripts]
edb-layout-viewer = "edb_layout_viewer.cli:main"

[project.optional-dependencies]
test = ["pytest>=8.0"]
dev = ["pytest>=8.0", "ruff>=0.11", "build>=1.2"]

[tool.flit.module]
name = "edb_layout_viewer"

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]

[tool.ruff]
line-length = 120
target-version = "py313"
fix = false

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true

[tool.uv.sources]
layout-viewer-core = { path = "../layout_viewer_core", editable = true }
Binary file removed src/.DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions src/edb_layout_viewer/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2023 - 2026 Contributors.
# SPDX-License-Identifier: Apache-2.0

"""Allow ``python -m edb_layout_viewer``."""

from __future__ import annotations

import sys

from edb_layout_viewer.cli import main

if __name__ == "__main__":
sys.exit(main())
Loading
Loading