Repository navigation
emode plugin: use the renamed emode client - #805
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013E8xULgErVrUQQUaHrtjYm
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013E8xULgErVrUQQUaHrtjYm
Reviewer's GuideAPISwitch the EMode plugin’s client import to the renamed
ConfigurationUpdate the optional EMode dependency to install the renamed client at the required published version.
DocumentationUpdate the notebook’s installation note to refer to the renamed
Add the changelog entry for the client rename.
TestsMake the EMode tests check for the renamed client package and update their dependency description.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="pyproject.toml" line_range="61" />
<code_context>
]
elmer = ["jinja2", "meshwell~=2.1.1", "nest-asyncio", "pandas"]
-emode = ["emodeconnection>=1.1.11"]
+emode = ["emode>=1.1.27"]
femwell = ["femwell~=0.1.11", "meshwell~=2.1.1"]
gfviz = ["jinja2", "fastapi", "shapely", "natsort"]
</code_context>
<issue_to_address>
**Locked installs cannot use EMode**
When a caller installs with the committed lockfile in locked or frozen mode, `uv.lock` still resolves the `emode` extra to `emodeconnection` instead of `emode`, so `uv sync --locked` aborts and frozen installs leave `gplugins.emode` without the renamed module; callers cannot install or import the plugin.
Regenerate `uv.lock` to match the new `emode` dependency.
Also at `gplugins/emode/emode.py:22`.
</issue_to_address>
### Comment 2
<location path="gplugins/emode/emode.py" line_range="22" />
<code_context>
from typing import Any
-import emodeconnection as emc
+import emode as emc
import gdsfactory as gf
from gdsfactory.technology import LayerLevel, LayerStack
</code_context>
<issue_to_address>
**Existing installs fail to import plugin**
When an existing environment upgrades gplugins without reinstalling the `emode` extra, python raises `ModuleNotFoundError` on the unconditional `import emode`, so importing `gplugins.emode` fails for users who upgrade gplugins without reinstalling its optional extra and still have only the old `emodeconnection` package.
Add a compatibility import for the old client or ensure the upgrade path explicitly reinstalls the `emode` extra.
Also at `pyproject.toml:61`.
</issue_to_address>Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: pyproject.toml:61, gplugins/emode/emode.py:22
| ] | ||
| elmer = ["jinja2", "meshwell~=2.1.1", "nest-asyncio", "pandas"] | ||
| emode = ["emodeconnection>=1.1.11"] | ||
| emode = ["emode>=1.1.27"] |
There was a problem hiding this comment.
🟡 Medium · Locked installs cannot use EMode
When a caller installs with the committed lockfile in locked or frozen mode, uv.lock still resolves the emode extra to emodeconnection instead of emode, so uv sync --locked aborts and frozen installs leave gplugins.emode without the renamed module; callers cannot install or import the plugin.
Regenerate uv.lock to match the new emode dependency.
Also at gplugins/emode/emode.py:22.
Prompt for AI agents
In `pyproject.toml` at line 61:
**Locked installs cannot use EMode**
When a caller installs with the committed lockfile in locked or frozen mode, `uv.lock` still resolves the `emode` extra to `emodeconnection` instead of `emode`, so `uv sync --locked` aborts and frozen installs leave `gplugins.emode` without the renamed module; callers cannot install or import the plugin.
Regenerate `uv.lock` to match the new `emode` dependency.
Also at `gplugins/emode/emode.py:22`.| from typing import Any | ||
|
|
||
| import emodeconnection as emc | ||
| import emode as emc |
There was a problem hiding this comment.
🟡 Medium · Existing installs fail to import plugin
When an existing environment upgrades gplugins without reinstalling the emode extra, python raises ModuleNotFoundError on the unconditional import emode, so importing gplugins.emode fails for users who upgrade gplugins without reinstalling its optional extra and still have only the old emodeconnection package.
Add a compatibility import for the old client or ensure the upgrade path explicitly reinstalls the emode extra.
Also at pyproject.toml:61.
Prompt for AI agents
In `gplugins/emode/emode.py` at line 22:
**Existing installs fail to import plugin**
When an existing environment upgrades gplugins without reinstalling the `emode` extra, python raises `ModuleNotFoundError` on the unconditional `import emode`, so importing `gplugins.emode` fails for users who upgrade gplugins without reinstalling its optional extra and still have only the old `emodeconnection` package.
Add a compatibility import for the old client or ensure the upgrade path explicitly reinstalls the `emode` extra.
Also at `pyproject.toml:61`.
EMode's Python client was renamed from
emodeconnectiontoemode(pip install emode,import emode). The old name stays on PyPI as a shim that re-exportsemodeand warns, so the plugin keeps working either way, but it should import the new name.Changes:
gplugins/emode/emode.py:import emode as emc.gplugins/emode/tests/test_emode.py:importorskip('emode').pyproject.toml: theemodeextra isemode>=1.1.27.emode.emode1.1.27 is on PyPI now (andemodeconnection1.1.27 is the shim). The earlier CI failures were all the resolver not findingemode>=1.1.26before it was published. This branch merges currentmain. The plugin tests (22) pass locally againstemode1.1.27 from PyPI.Summary by Sourcery
Adopt the renamed
emodeclient for the EMode plugin and its optional dependency.Enhancements:
emodePython client throughout its imports, dependency metadata, tests, and user-facing documentation.Documentation:
emodeclient.Tests:
emodeclient is unavailable.Chores: