From b75689346df2b5383eeed2aefd632c2c82f02aaa Mon Sep 17 00:00:00 2001 From: "curtis.mayberry" Date: Mon, 15 Aug 2022 13:12:41 -0700 Subject: [PATCH] add virtue plugins --- docs/source/development/index.rst | 3 +- pyproject.toml | 3 ++ ...ftworks.init.ils => softworks.cdsinit.ils} | 2 +- softworks/virtue_softworks.py | 33 +++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) rename softworks/{Softworks.init.ils => softworks.cdsinit.ils} (87%) create mode 100644 softworks/virtue_softworks.py diff --git a/docs/source/development/index.rst b/docs/source/development/index.rst index 3df5f94..8a1f438 100644 --- a/docs/source/development/index.rst +++ b/docs/source/development/index.rst @@ -7,8 +7,7 @@ Development Setup #. Setup development environment using the dev.yml file in envs/ #. Open a project using the sp command with the -p option to specify the development environment. -#. | For SKILL code development, the SKILL IDE can be opened from within Virtuoso. - | For general development it is recommended that Softworks be attached to the User's IDS PyCharm project. +#. For SKILL code development, the SKILL IDE can be opened from within Virtuoso. Note that Updates to the SKILL code can be reloaded directly from the SKILL IDE. However updates to the to any of the data.reg will require the Softworks Conda package to be rebuilt and the diff --git a/pyproject.toml b/pyproject.toml index 592bf74..32eacb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,5 +44,8 @@ dynamic = ["version", "description"] "Documentation" = "http://www.cascode-labs.org/softworks/" "Source" = "https://github.com/cascode-labs/softworks" +[project.entry-points."virtue"] +softworks = "softworks.virtue_softworks" + [tool.flit.module] name = "softworks" diff --git a/softworks/Softworks.init.ils b/softworks/softworks.cdsinit.ils similarity index 87% rename from softworks/Softworks.init.ils rename to softworks/softworks.cdsinit.ils index e85d73c..5505da7 100644 --- a/softworks/Softworks.init.ils +++ b/softworks/softworks.cdsinit.ils @@ -14,7 +14,7 @@ let((dir_path src_path packages) "/code_workspace.il" ; Create Code Workspace ) Import['Module]->LoadList(packages - ?root_path strcat(Import['Virtue]->GetCurrentFileDirectory() "/softworks")) + ?root_path Import['Virtue]->GetCurrentFileDirectory()) SdmWorkspace->init() SdmPy->init() diff --git a/softworks/virtue_softworks.py b/softworks/virtue_softworks.py new file mode 100644 index 0000000..6d0e3a3 --- /dev/null +++ b/softworks/virtue_softworks.py @@ -0,0 +1,33 @@ +from typing import Tuple +from pathlib import Path +from importlib.resources import files +import virtue +import softworks + + +@virtue.hookimpl +def virtue_python_package_name() -> str: + return "softworks" + +@virtue.hookimpl +def virtue_skill_package_name() -> str: + return "Softworks" + +@virtue.hookimpl +def virtue_skill_initialization_paths() -> Tuple[Path]: + return (files(softworks) / "softworks.cdsinit.ils"), + +@virtue.hookimpl +def virtue_cdslibmgr_paths() -> Tuple[Path]: + return (files(softworks) / "softworks.cdsLibMgr.il"), + +@virtue.hookimpl +def virtue_data_reg_paths() -> Tuple[Path]: + return ( + files(softworks) / "python" / "SdmPy.data.reg", + files(softworks) / "skill" / "SdmSkill.data.reg", + files(softworks) / "pptx" / "SdmPptx.data.reg", + files(softworks) / "xlsx" / "SdmXlsx.data.reg", + files(softworks) / "pdf" / "SdmPdf.data.reg", + files(softworks) / "html" / "SdmHtml.data.reg", + ) \ No newline at end of file