Skip to content

Commit

Permalink
gf version shows versions of all plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Mar 2, 2023
1 parent 3a5e116 commit 18b70dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Or you can install only the ones you need.
* Eigenmode Expansion (EME)
- [MEOW](https://gdsfactory.github.io/gdsfactory/notebooks/eme/01_meow.html)
* [Electromagnetic Wave Solvers using Finite Difference Time Domain (FDTD)](https://gdsfactory.github.io/gdsfactory/plugins_fdtd.html)
- [tid3d](https://gdsfactory.github.io/gdsfactory/notebooks/tidy3d/00_tidy3d.html)
- [tidy3d](https://gdsfactory.github.io/gdsfactory/notebooks/tidy3d/00_tidy3d.html)
- [MEEP](https://gdsfactory.github.io/gdsfactory/notebooks/meep/001_meep_sparameters.html)
- [Ansys Lumerical FDTD](https://gdsfactory.github.io/gdsfactory/notebooks/lumerical/1_fdtd_sparameters.html)
* [S-Parameter Circuit Solvers](https://gdsfactory.github.io/gdsfactory/plugins_circuits.html)
Expand Down
22 changes: 18 additions & 4 deletions gdsfactory/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,30 @@
LAYER_LABEL = LAYER.LABEL


plugins = ["ray", "femwell", "devsim", "tidy3d", "meep", "meow", "lumapi", "sax"]


def print_version(ctx: Context, param: Option, value: bool) -> None:
"""Prints the version."""
if not value or ctx.resilient_parsing:
return
click.echo(VERSION)
click.echo(f"gdsfactory {VERSION}")
for plugin in plugins:
try:
import importlib

m = importlib.import_module(plugin)
try:
click.echo(f"{plugin} {m.__version__}")
except AttributeError:
click.echo(f"{plugin} installed")
except ImportError:
click.echo(f"{plugin} not installed")

ctx.exit()


# TOOL


@click.group()
def tool() -> None:
"""Commands working with gdsfactory tool."""
Expand Down Expand Up @@ -178,4 +191,5 @@ def cli(name="gf") -> None:


if __name__ == "__main__":
cli()
# cli()
print_version()

0 comments on commit 18b70dd

Please sign in to comment.