uv icon indicating copy to clipboard operation
uv copied to clipboard

Support dotted function paths for script entrypoints

Open markmmm opened this issue 1 year ago • 0 comments

Summary

Some projects define an script entrypoint with a path separated by ..

For example in Invoke...

    entry_points={
        "console_scripts": [
            "invoke = invoke.main:program.run",
            "inv = invoke.main:program.run",
        ]
    },

Before this change uv tried to import 'program.run' but this is not valid, and only up to the first dot should be imported (as pip does).

Resolves: #1573

Test Plan

  • Added a unit test in script.rs to validate that the import_name is set correctly when the function path is dotted.
  • Ran the unit tests (cargo test)

markmmm avatar Feb 18 '24 02:02 markmmm