mirror of
https://github.com/astral-sh/ruff-action.git
synced 2026-05-12 20:50:14 +02:00
feat: support reading Ruff version from tools.poetry.dependencies (#177)
While Poetry does now support PEP 508, it's still common to use `tool.poetry.dependencies` - we for example still use it because Renovate does not support doing lockfile updates for Poetry when using PEP 508. This modifies the version finder logic to support determining the Ruff version from `pyproject.toml` files that use ``tool.poetry.dependencies`
This commit is contained in:
+5
-1
@@ -31943,7 +31943,11 @@ function parsePyproject(pyprojectContent) {
|
||||
function getRuffVersionFromPoetryGroups(pyproject) {
|
||||
// Special handling for Poetry until it supports PEP 735
|
||||
// See: <https://github.com/python-poetry/poetry/issues/9751>
|
||||
const poetryGroups = Object.values(pyproject?.tool?.poetry?.group || {});
|
||||
const poetry = pyproject?.tool?.poetry || {};
|
||||
const poetryGroups = Object.values(poetry.group || {});
|
||||
if (poetry.dependencies) {
|
||||
poetryGroups.unshift({ dependencies: poetry.dependencies });
|
||||
}
|
||||
return poetryGroups
|
||||
.flatMap((group) => Object.entries(group.dependencies))
|
||||
.map(([name, spec]) => {
|
||||
|
||||
Reference in New Issue
Block a user