Hacker News new | ask | show | jobs
by simonw 11 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...)

1 comments

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.