Skip to content

nbdev_export modifies irrelevant items in pyproject.toml #1519

Open
@ifsheldon

Description

@ifsheldon

Provide a minimally reproducible example

You can clone my repo and initialize the environment with uv sync. The code in the repo is not relevant, but I'm sure that you can reproduce this issue in 5mins.

From line 43 - line 51 in my pyproject.toml, I setup sources of torch for uv to resolve.

[[tool.uv.index]]
name="torch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[[tool.uv.index]]
name="torch-gpu"
url = "https://download.pytorch.org/whl/cu128"
explicit = true

https://github.com/ifsheldon/tensor-network-notes/blob/b675c068899e29c0c5324e7e7557ed41a1e9216a/pyproject.toml#L43

When I run uv run nbdev_export, nbdev_export keeps overwriting the name fields to the project name, which is really annoying, like below

[[tool.uv.index]]
name="tensor-network-code" # my project name
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[[tool.uv.index]]
name="tensor-network-code" # my project name
url = "https://download.pytorch.org/whl/cu128"
explicit = true

Did you just do the plain string replacement when processing pyproject.toml instead of parsing it correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions