← Back to context

Comment by simonw

5 hours ago

The thing where "uv init" now adds this to pyproject.toml is a bit surprising:

  [project.scripts]
  demo-latest = "demo_latest:main"

What's the rationale for that? My expectation is that few projects would need it.

(I have a GitHub repo that captures differences between uv versions, here's today's upgrade: https://github.com/simonw/uv-init-demos/commit/9111a2bb85741...)

It makes `uv run <project-name>` work by default, I expect most projects to need an entry point.

  • Nah. I just put a regular `main.py` with some

      if __name__ == "__main__":
          ...
    

    in my src/ folder. Done.