this post was submitted on 29 Oct 2025
71 points (98.6% liked)

Python

7580 readers
7 users here now

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

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
top 13 comments
sorted by: hot top controversial new old
[–] beeng@discuss.tchncs.de 20 points 3 weeks ago* (last edited 3 weeks ago) (1 children)

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@lemmy.sdf.org 5 points 3 weeks ago (1 children)

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

[–] rainwall@piefed.social 5 points 3 weeks ago (2 children)
[–] CannonFodder@lemmy.world 4 points 3 weeks ago (1 children)

Cool. But for God's sake don't run python code from the internet, that's such a huge security risk,

[–] rainwall@piefed.social 3 points 2 weeks ago

Dont worry, I just vibe run it.

[–] synae@lemmy.sdf.org 1 points 3 weeks 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

[–] admin@lemmy.my-box.dev 7 points 3 weeks ago (3 children)

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

[–] eager_eagle@lemmy.world 16 points 3 weeks ago* (last edited 3 weeks ago)
[–] _stranger_@lemmy.world 10 points 3 weeks ago

UV has a shitload of features. I've only ever really used it for making virtualemvs for easier cross platform compatibility, but even just for that, there's tons of options related to which packages, from where, etc.

tl:dr probably, although differentiating between "deploy" and "dev" installs is the task of the package config which UV doesn't (to my knowledge) replace in any way.

[–] logging_strict@programming.dev 0 points 2 weeks ago* (last edited 2 weeks 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.

[–] PlanterTree@discuss.tchncs.de 2 points 1 week ago* (last edited 1 week ago) (1 children)

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@programming.dev 3 points 6 days ago* (last edited 6 days ago)

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

[–] Unsealed9041@lemmy.ca -1 points 3 weeks 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.