Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pep621 manager: name is optional under tool.uv.index, but Renovate considers it required #34428

Open
rarkins opened this issue Feb 24, 2025 · 0 comments · May be fixed by #34387
Open

pep621 manager: name is optional under tool.uv.index, but Renovate considers it required #34428

rarkins opened this issue Feb 24, 2025 · 0 comments · May be fixed by #34387
Labels
manager:pep621 Python pyproject.toml files priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others

Comments

@rarkins
Copy link
Collaborator

rarkins commented Feb 24, 2025

Discussed in #34360

Originally posted by aureliojargas February 20, 2025

How are you running Renovate?

Self-hosted Renovate

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

GitHub, Renovate 39.90.5

Please tell us more about your question or problem

When using uv and declaring a custom package index in pyproject.toml, using the name attribute is optional:

https://docs.astral.sh/uv/configuration/indexes/#defining-an-index

[[tool.uv.index]]
# Optional name for the index.
name = "pytorch"
# Required URL for the index.
url = "https://download.pytorch.org/whl/cpu"

However, Renovate errors out if name is missing (see Logs for the full entry):

"issues":{"tool":{"uv":{"index":{"0":{"name":"Required"}}}}}}

It looks like the related code is the following (there's no default for name):

index: z
.array(
z.object({
name: z.string(),
url: z.string(),
default: z.boolean().default(false),
explicit: z.boolean().default(false),
}),
)

Logs (if relevant)

Logs
{
  "name": "renovate",
  "hostname": "737ea14bXXXX",
  "pid": 9,
  "level": 20,
  "logContext": "vTt3XZmgrRSUVxQkXXXXX",
  "repository": "XXX/XXXXXXXXXXXXX",
  "packageFile": "pyproject.toml",
  "err": {
    "message": "Schema error",
    "stack": "ZodError: Schema error\n    at Object.get error [as error] (/usr/local/renovate/node_modules/.pnpm/[email protected]/node_modules/zod/lib/types.js:55:31)\n    at ZodObject.parse (/usr/local/renovate/node_modules/.pnpm/[email protected]/node_modules/zod/lib/types.js:131:22)\n    at parsePyProject (/usr/local/renovate/lib/modules/manager/pep621/utils.ts:132:28)\n    at Object.extractPackageFile (/usr/local/renovate/lib/modules/manager/pep621/extract.ts:25:29)\n    at extractPackageFile (/usr/local/renovate/lib/modules/manager/index.ts:75:9)\n    at getManagerPackageFiles (/usr/local/renovate/lib/workers/repository/extract/manager-files.ts:58:43)\n    at /usr/local/renovate/lib/workers/repository/extract/index.ts:57:28\n    at async Promise.all (index 3)\n    at extractAllDependencies (/usr/local/renovate/lib/workers/repository/extract/index.ts:54:26)\n    at extract (/usr/local/renovate/lib/workers/repository/process/extract-update.ts:159:28)\n    at extractDependencies (/usr/local/renovate/lib/workers/repository/process/index.ts:158:26)\n    at Object.renovateRepository (/usr/local/renovate/lib/workers/repository/index.ts:71:9)\n    at attributes.repository (/usr/local/renovate/lib/workers/global/index.ts:206:11)\n    at start (/usr/local/renovate/lib/workers/global/index.ts:191:7)\n    at /usr/local/renovate/lib/renovate.ts:19:22",
    "issues": {
      "tool": {
        "uv": {
          "index": {
            "0": {
              "name": "Required"
            }
          }
        }
      }
    }
  },
  "msg": "Failed to parse and validate pyproject file",
  "time": "2025-02-20T07:15:17.022Z",
  "v": 0
}

Setting name to .optional() should be easy, but a test should be added to verify functionality still works as expected as index.name is referenced in code.

@rarkins rarkins added manager:pep621 Python pyproject.toml files priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Feb 24, 2025
@viceice viceice linked a pull request Feb 24, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:pep621 Python pyproject.toml files priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant