anatoly-scherbakov / anatoly-scherbakov/jeeves-yeti-pyproject

Declare Poetry as a dependency

未关闭
#175 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
1
派生
0
平均合并
8 小时 35 分钟
30 天内合并 PR
9

描述

## Problem

Installing `jeeves-yeti-pyproject` into a fresh venv and running `j fmt` can fail during plugin import if the `poetry` executable is not installed in the environment.

Observed with `jeeves-yeti-pyproject==1.0.3` on Python 3.13:

```text
ImportError: cannot import name 'poetry' from 'sh' (.../site-packages/sh/__init__.py)
```

The import path is:

```text
jeeves_yeti_pyproject/__init__.py
jeeves_yeti_pyproject/jeeves.py
jeeves_yeti_pyproject/mypy.py
```

and `mypy.py` imports:

```python
from sh import ErrorReturnCode_1, poetry
```

After installing `poetry` into the same venv, the plugin imports and `j fmt` gets past that failure.

## Expected

A user installing `jeeves-yeti-pyproject` should get all runtime tools needed for the plugin import path, or the package should avoid importing optional command wrappers at module import time.

## Possible fix

Add `poetry` to package dependencies, or lazy-load the `sh.poetry` command only inside code paths that actually need Poetry.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。