Is Python making Poetry REDUNDANT?!

  Рет қаралды 7,771

Carberra

Carberra

Күн бұрын

Python's taking inspiration from Poetry in a new proposal aimed at getting rid of requirements.txt files! And you know what, I prefer it to Poetry's way.
0:00 - Intro
1:14 - PEP 735 [1]
3:06 - Dependency groups
4:38 - Editable installs
4:57 - Using dependency groups
6:40 - Closing thoughts
8:43 - Outro
[1] peps.python.org/pep-0735/
-
If you enjoy my content, consider supporting me on Patreon or becoming a member!
patreon.carberra.xyz
join.carberra.xyz
If you need help with anything, feel free to join the Discord server:
discord.carberra.xyz
I get a lot of people asking, so here's my Visual Studio Code setup!
• My Visual Studio Code ...
-
If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.
#python #coding #howto

Пікірлер: 49
@knolljo
@knolljo 4 ай бұрын
python packaging is still a mess, sometimes i wish python had something similar to cargo as a standard
@Carberra
@Carberra 4 ай бұрын
Yeah same honestly. Poetry's probably the closest to that but it's a bit of a mess imo. Would be nice to have something as standard.
@muream
@muream 4 ай бұрын
​@@CarberraI tested Rye this week and it seems to be a good replacement for pyenv, pipx, poetry, etc And it's an actual executable so you don't need python to install it
@knolljo
@knolljo 4 ай бұрын
I didn’t enjoy using poetry either, I’m still thinking if python could have something better than venvs
@Carberra
@Carberra 4 ай бұрын
I looked it up after someone else commented about it, and it honestly seems really good! Will have to give it a try, though I'm wary about it conflicting with Pyenv in some way. I'm not sure it would but we use Pyenv at work and would rather it not interfere.
@Carberra
@Carberra 4 ай бұрын
@knolljo Well, this Rye could be the answer if it's as good as people say. I think it still uses venvs under the hood but honestly Pyenv has been good to me and that abstracts it all away from you.
@pythonlibrarian224
@pythonlibrarian224 4 ай бұрын
That is not why people use poetry. This is like saying pip will have a cleaner `--version` switch, which is wonderful, but not like a reason for changing anything, to use a bad metaphor. Early pip used to let every project uninstall the dependencies of deps installed just seconds ago, leading to nondeterministic venv creation. That led to both pipenv, poetry, which have incredibly complex solver and lock file creation algos. Pip has been playing catchup and the PEPs, which are well meaning, are going off in some other random direction to ensure that the landscape remains balkanized for at least another decade.
@JaumeSabater
@JaumeSabater 4 ай бұрын
We may argue whether the syntax is more or less convenient for this and that, but having a unified way of managing dependencies which can be improved over time is going to be a big win for use Pythoneers.
@jhonyortiz5
@jhonyortiz5 Ай бұрын
I love the simplicity of conda. A more modern version like pixi seems awesome, its not feature complete yet. But I love that its a single binary and can manage other languages as well. Its also great thag it can now somewhat manage pypi packages not just conda packages. I also really love the ability to install global packages. I really dont like Python project managers that rely on python to work. Poetry for example needs soooooooooooooooooo many libraries.
@putnam120
@putnam120 4 ай бұрын
Thoughts on rye for package and python version management?
@Carberra
@Carberra 4 ай бұрын
Having just looked it up, it actually looks really cool! Might have to give it a whirl.
@sillybuttons925
@sillybuttons925 4 ай бұрын
I like these pep videos
@hazemkhairy
@hazemkhairy 4 ай бұрын
I wonder how this differs from poetry. I've been using poetry over the last year, and it pretty much handles all these cases, including dependency groups (you can create arbitrary groups), editable install, and it handles them well. I guess poetry in the past only had "dev" dependencies, but this was in an older version. I know that because it shows that this command is deprecated. To be honest though, in my experience for some packages, the dependency resolver can be a bit slow with specific packages, like apache beam.
@Carberra
@Carberra 4 ай бұрын
As far as I can tell it's just cleaner. Back when I last used Poetry it only had required and dev, it's added groups since (imo somewhat messily).
@pisse3000
@pisse3000 2 ай бұрын
@@Carberra Could you elaborate a bit on what you mean when you say 'cleaner'? No offence at all, just curious :)
@Carberra
@Carberra 2 ай бұрын
Poetry's implementation of dependency groups is pretty horrible in my opinion, definitely feels bolted on. This PEP feels a lot less arbitrary, though that's probably down to personal opinion rather than objective fact.
@stonemannerie
@stonemannerie 3 ай бұрын
Let‘s hope they include syntax for environment markers. Otherwise this will just be garbage again for any project, which should be developed on multiple platforms. I want proper lock files with hashes and environment markers. I’m going insane otherwise.
@AmazedAkai
@AmazedAkai 4 ай бұрын
Nice!!
@teluial
@teluial 4 ай бұрын
Not sure about the include syntax. You can already do this with the “extras” syntax. If your project.name is “analytics-workspace”, you can define project.optional-dependencies.docs and include it from project.optional-dependencies.dev with “analytics-workspace[docs]”, as though it were a published package. I guess the include is there because these specifically aren’t published, but it seems a little silly. Also, AFAIK pdm and poetry and everyone else in every other language tool chain calls these “dev dependencies”. “Dependency groups” is what optional dependencies already do. So, this name seems easy for PEP authors and confusing for end users.
@Carberra
@Carberra 4 ай бұрын
I think it's supposed to be an all-in-one solution to put everything under a single category, which I like tbf. I think Poetry uses both iirc -- they have their dev dependencies syntax, then a separate dependency groups syntax. Can't comment on other package managers though.
@bennyyouknow
@bennyyouknow 4 ай бұрын
pip.pypa.io/en/stable/cli/pip_install/ for some more references. Note …[…,…] is viable as well. Can se the value of allowing {include=…}. But please keep to the current path with optional-dependencies imgs.xkcd.com/comics/standards_2x.png
@Carberra
@Carberra 4 ай бұрын
I think they'll keep that standard for backwards compatibility. Or at least deprecated it, which will give you 2 years to swap if it's anything like Python version deprecation.
@clauseclause6640
@clauseclause6640 4 ай бұрын
I prefer pdm
@Carberra
@Carberra 4 ай бұрын
Never tried it but seems alright. May give it a shot someday.
@psadi_
@psadi_ 4 ай бұрын
i use pdm as well, fast and hasse-free +1
@BosonCollider
@BosonCollider 4 ай бұрын
The python community still has no standard lockfile format, and the comments here suggesting more alternatives to poetry make me want to run away from Python as fast as I can. I've been pushing for Go and Rust at work and using have been using Go as much as possible for standalone applications/scripts where python would have been used otherwise. For the python packages I've had to write, I've been using protocols/duck typing and DI to avoid explicitly importing third party dependencies as much as possible, and I'm maximally conservative about the APIs I use to maximize the version ranges of the libraries that it may work with. That way, injecting a Pydantic model, a dbapi compliant connection object, or a callback that the user defines is something I let the user do, and I avoid the dependency mess as much as possible myself since I don't want to touch that ****.
@maksimon519
@maksimon519 4 ай бұрын
2024 but still using config files instead of code as config
@knolljo
@knolljo 4 ай бұрын
setup.py is the predecessor to pyproject.toml, you can still use it but imo declarative configs are a bit less of a hassle
@maksimon519
@maksimon519 3 ай бұрын
@@squishy-tomatothen create another dsl, lol
@Ldmp807
@Ldmp807 4 ай бұрын
poetry has been going downhill for a while now
@Carberra
@Carberra 4 ай бұрын
Maybe this is the final nail in the coffin! I used Poetry for a while a few years ago but moved away from it cos it took them forever to support 3.10, and just never went back.
@_nikolanenadovic
@_nikolanenadovic 4 ай бұрын
from 00:00 all I hear is bla bla bla... man you need to work on how you sound.
@mrc1500
@mrc1500 4 ай бұрын
Poetry just makes me swear, a lot. Good riddance, hopefully.
@NostraDavid2
@NostraDavid2 24 күн бұрын
I'm trying out uv and have gotten this to work: ```toml [project.optional-dependencies] linting = ["jupyter-black"] testing = ["tox"] formatting = ["ruff"] dev = ["sql_pg[linting]", "sql_pg[testing]", "sql_pg[formatting]"] ``` $ uv pip compile pyproject.toml --extra dev > requirements.txt Soooooo nice!
@NostraDavid2
@NostraDavid2 24 күн бұрын
The build-system I use is setuptools BTW.
@Carberra
@Carberra 24 күн бұрын
You could probably set up an alias of some sort if you were to pipe the output of the compile through xargs (maybe `| xargs -L1`? I'm trying to get better with it but still not sure what everything does).
@Sebastian-xf8je
@Sebastian-xf8je 4 ай бұрын
environment.yaml 😎
@knolljo
@knolljo 4 ай бұрын
whats that?
Is "uv" the FUTURE of Python package management?
13:28
Carberra
Рет қаралды 6 М.
Modern Python logging
21:32
mCoding
Рет қаралды 150 М.
Miracle Doctor Saves Blind Girl ❤️
00:59
Alan Chikin Chow
Рет қаралды 68 МЛН
Learn How to Design Jotter - Tutorial
16:47
Gloriousclick
Рет қаралды 2
Multithreading is possible in Python 3.12 ( with speed test )
9:18
Mastering Python
Рет қаралды 1,2 М.
Asynchronous Web Apps in Python
15:30
mCoding
Рет қаралды 27 М.
Deques can be FASTER than lists in Python
12:17
Carberra
Рет қаралды 25 М.
Your Python code NEEDS these 5 EASY optimisations
14:22
Carberra
Рет қаралды 4,3 М.
why I will never use python-poetry
9:09
anthonywritescode
Рет қаралды 53 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 355 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 360 М.
Miracle Doctor Saves Blind Girl ❤️
00:59
Alan Chikin Chow
Рет қаралды 68 МЛН