Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
codeinabox ( codeinabox@programming.dev )  to Python@programming.devEnglish · 11 months ago

uv is the best thing to happen to the Python ecosystem in a decade

emily.space

external-link
message-square
12
link
fedilink
51
external-link

uv is the best thing to happen to the Python ecosystem in a decade

emily.space

codeinabox ( codeinabox@programming.dev )  to Python@programming.devEnglish · 11 months ago
message-square
12
link
fedilink
uv is the best thing to happen to the Python ecosystem in a decade - Blog - Dr. Emily L. Hunt
emily.space
external-link
Released in 2024, uv is hands-down the best tool for managing Python installations and dependencies. Here's why.
alert-triangle
You must log in or # to comment.
  • beeng ( beeng@discuss.tchncs.de ) 
    link
    fedilink
    arrow-up
    15
    ·
    11 months ago

    Using the UV hashbang and a few doc strings for dependencies so you can run full on python scripts as executables is fucking crack.

    • synae[he/him] ( synae@lemmy.sdf.org ) 
      link
      fedilink
      English
      arrow-up
      4
      ·
      11 months ago

      I have an idea of what this might look like, but do you have any examples I can crib from?

      • rainwall ( rainwall@piefed.social ) 
        link
        fedilink
        English
        arrow-up
        5
        ·
        11 months ago

        This article looks like it explains the process:

        https://mathspp.com/blog/til/standalone-executable-python-scripts-with-uv

        • synae[he/him] ( synae@lemmy.sdf.org ) 
          link
          fedilink
          English
          arrow-up
          1
          ·
          11 months ago

          Thank you, this goes to the top of my reading pile for tomorrow! We’ve been doing a lot of uv conversions at work and I have a specific personal use for this as well

  • solrize ( solrize@lemmy.ml ) 
    link
    fedilink
    arrow-up
    13
    ·
    11 months ago

    And it isn’t even written in Python!

    • witty_username ( witty_username@feddit.nl ) 
      link
      fedilink
      arrow-up
      11
      ·
      11 months ago

      This page said it’s written in Rust. Is this the same UV?

    • logging_strict ( logging_strict@programming.dev ) 
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      That means it can’t be maintained by the community it’s serving. For those skilled in both Rust and Python can understand why it would appear as the best thing since sliced bread.

      What about for those not skilled in Rust? Should we also learn 15 other coding languages while we are at it?

      wreck is written in Python and manages dependencies. via hierarchy of requirements files, not TOML. It’s venv aware. For Python package authors.

  • just another dev ( admin@lemmy.my-box.dev ) 
    link
    fedilink
    English
    arrow-up
    6
    ·
    11 months ago

    Does it allow differentiating between dependencies and dev dependencies though? I couldn’t gather that from the article.

    • logging_strict ( logging_strict@programming.dev ) 
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      wreck can. It’s venv aware. Takes full advantage of hierarchical requirement files. Is intuitive. The learning curve is minimal. Written in Python.

      [[tool.wreck.venvs]]
      venv_base_path = '.venv'
      reqs = [
          'requirements/pip',
          'requirements/pip-tools',
          'requirements/prod',
          'requirements/dev',
          'requirements/manage',
          'requirements/kit',
          'requirements/mypy',
          'requirements/tox',
      ]
      [[tool.wreck.venvs]]
      venv_base_path = '.doc/.venv'
      reqs = [
          'docs/requirements',
          'docs/pip-tools',
      ]
      
      [tool.setuptools.dynamic]
      dependencies = { file = ['requirements/prod.unlock'] }
      optional-dependencies.pip = { file = ['requirements/pip.lock'] }
      optional-dependencies.pip_tools = { file = ['requirements/pip-tools.lock'] }
      optional-dependencies.dev = { file = ['requirements/dev.lock'] }
      optional-dependencies.manage = { file = ['requirements/manage.lock'] }
      optional-dependencies.docs = { file = ['docs/requirements.lock'] }
      

      reqs fix --venv-relpath='.venv'

      reqs fix --venv-relpath='.doc/.venv'

      From *.in requirements files would produce *.unlock and *.lock files for venv .venv. Package versions are sync’ed within all requirements files within that venv.

  • Unsealed9041 ( Unsealed9041@lemmy.ca ) 
    link
    fedilink
    arrow-up
    2
    ·
    11 months ago

    They kind of lost me at piping a script to sh. Is this the official way? Get your shit packaged into the popular distros. DevOps isn’t that hard.

  • PlanterTree ( PlanterTree@discuss.tchncs.de ) 
    link
    fedilink
    English
    arrow-up
    2
    ·
    11 months ago

    example of using uv to install a python tool:

    uv tool install harlequin
    

    nice! It just works (harlequin.sh is a python program that allows to interact with databases using SQL qury langues, you can also load csv and json data)

    • Vulwsztyn ( Vulwsztyn@programming.dev ) 
      link
      fedilink
      arrow-up
      2
      ·
      11 months ago

      I know it’s not the point of this comment, but I’ll check harlequin out

Python@programming.dev

python@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !python@programming.dev

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events
Past

November 2023

  • PyCon Ireland 2023, 11-12th
  • PyData Tel Aviv 2023 14th

October 2023

  • PyConES Canarias 2023, 6-8th
  • DjangoCon US 2023, 16-20th (!django 💬)

July 2023

  • PyDelhi Meetup, 2nd
  • PyCon Israel, 4-5th
  • DFW Pythoneers, 6th
  • Django Girls Abraka, 6-7th
  • SciPy 2023 10-16th, Austin
  • IndyPy, 11th
  • Leipzig Python User Group, 11th
  • Austin Python, 12th
  • EuroPython 2023, 17-23rd
  • Austin Python: Evening of Coding, 18th
  • PyHEP.dev 2023 - “Python in HEP” Developer’s Workshop, 25th

August 2023

  • PyLadies Dublin, 15th
  • EuroSciPy 2023, 14-18th

September 2023

  • PyData Amsterdam, 14-16th
  • PyCon UK, 22nd - 25th
🐍 Python project:
  • Python
  • Documentation
  • News & Blog
  • Python Planet blog aggregator
💓 Python Community:
  • #python IRC for general questions
  • #python-dev IRC for CPython developers
  • PySlackers Slack channel
  • Python Discord server
  • Python Weekly newsletters
  • Mailing lists
  • Forum
✨ Python Ecosystem:
  • pyvideo
  • Awesome Python
  • PyCon US 2023 and videos!
🌌 Fediverse
Communities
  • #python on Mastodon
  • c/django on programming.dev
  • c/pythorhead on lemmy.dbzer0.com
Projects
  • Pythörhead: a Python library for interacting with Lemmy
  • Plemmy: a Python package for accessing the Lemmy API
  • pylemmy pylemmy enables simple access to Lemmy’s API with Python
  • mastodon.py, a Python wrapper for the Mastodon API
Feeds
  • Active c/Python posts
  • New c/Python posts
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 7 users / day
  • 88 users / week
  • 103 users / month
  • 287 users / 6 months
  • 104 local subscribers
  • 8.06K subscribers
  • 632 Posts
  • 1.96K Comments
  • Modlog
  • mods:
  • Erlingur ( erlingur@programming.dev ) 
  • Jason Novinger ( jnovinger@programming.dev ) 
  • Luis Norambuena ( norambna@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code