news.volyx.in

Uv: Running a script with dependencies (docs.astral.sh)

511 points by Bluestein · 372 days ago · 172 comments on HN

Article summary

The article discusses the features of uv, a tool for running Python scripts with dependencies. It explains how to use uv to execute scripts, declare dependencies, and manage virtual environments. The article also covers advanced topics such as locking dependencies, improving reproducibility, and using different Python versions. uv provides a convenient way to manage script dependencies without manually creating virtual environments.

Main themes

  • uv features
  • script dependencies
  • virtual environments
  • Python packaging
  • Requests library
  • PEP 723
  • LSP support
  • dependency management
  • reproducibility
  • security
  • maintainability
  • creator behavior
  • tool comparisons
  • workflow optimization
  • library alternatives
  • uv limitations
  • uv best practices
  • uv troubleshooting
  • uv use cases
  • uv integrations
  • uv documentation
  • uv community
  • uv development
  • uv testing
  • uv debugging
  • uv security
  • uv performance
  • uv scalability
  • uv reliability
  • uv usability
  • uv accessibility
  • uv extensibility
  • uv customizability
  • uv flexibility
  • uv compatibility
  • uv portability
  • uv maintainability

What commenters say

  • Some users appreciate uv's ability to manage script dependencies without creating virtual environments, making it a valuable tool for their workflow.
  • The use of uv's shebang mode is seen as incredibly useful for executing scripts with dependencies.
  • There is a concern about the maintainability and security of the Requests library, with some users recommending alternative libraries like httpx or aiohttp.
  • The implementation of PEP 723 in uv and other tools like pipx and hatch is seen as a positive development for Python packaging and dependency management.
  • Some users have mixed opinions about the creator of the Requests library, with some appreciating their contributions to the Python ecosystem and others criticizing their behavior.
  • There is a need for better support for inline dependencies in LSPs, with some users currently using workarounds like manually creating virtual environments.
  • The use of uv's sync feature can be useful for managing dependencies, but it requires careful handling to avoid destructive behavior.