Тёмный

How to Use Poetry in Python to avoid Dependency Hell 

Earthly
Подписаться 3,1 тыс.
Просмотров 11 тыс.
50% 1

Earthly ➤ earthly.dev
Today, let's discuss Python dependency, virtual environments and the use of Poetry, an all-in-one tool for virtual environments, dependency management, packaging, and distribution in Python projects.
I'll explain how Poetry helps manage dependencies, set up virtual environments, and package projects for distribution.
I'll also mention the limitations of Poetry when dealing with non-Python dependencies or C-based dependencies, recommending the use of containers in such cases.
➡️ Earthly: earthly.dev/
📒 Links 📒
Article version of this tutorial:
earthly.dev/blog/python-poetry/
Python Poetry Website
python-poetry.org/
📒 About Earthly 📒
Earthly is a command line tool that simplifies build processes, especially for complex projects involving multiple programming languages. It helps manage communication between different languages, making builds easier to manage. If you want to streamline your build processes and work with multiple languages, Earthly can help.
Website: earthly.dev/
Follow us on Twitter: / earthlytech
Subscribe: www.youtube.com/@EarthlyTech?...

Наука

Опубликовано:

 

16 окт 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@jdavid82
@jdavid82 6 месяцев назад
this video helped me with 80% of getting there, now I need to look for where to add the hello world code and how to run it
@jonron3805
@jonron3805 7 месяцев назад
The explanation of Poetry and comparing it with other virtual environments has been like none I have seen before. Its a wonderful explanation. The only thing I would have liked to see in addition to what you showed was an EXAMPLE where there is a dependency conflict in some modules and how introducing poetry will resolve the issue.
@EarthlyTech
@EarthlyTech 7 месяцев назад
Hey, Thanks for watching! That is good feedback. I'm not sure I'll be making another video on Poetry, but if I do I try to cover a specfic dependency conflict.
@kristiannn
@kristiannn 5 месяцев назад
this is one of the best videos on youtube about dependency management in python
@EarthlyTech
@EarthlyTech 4 месяца назад
Thank you so much for your kind words! I'm glad you found the video helpful.
@jeffg4686
@jeffg4686 2 месяца назад
Nice. I like the choice of toml - aligns with Rust - my other language.
@eugeneL_N1E104
@eugeneL_N1E104 4 месяца назад
as to future potential topics, python typing looks not very clear when I write class methods for non-builtin classes. also wondering since which python3.* does this typing has really performance improvements (or "dev acceleration" as IDE use them)
@alexv2401
@alexv2401 4 месяца назад
Thank you for your content. Your contributions to the RU-vid Python Hive mind do not go unnoticed. Sincerely, A passionate Pythonista
@EarthlyTech
@EarthlyTech 4 месяца назад
Wow, thank you
@AghilSoi
@AghilSoi 5 дней назад
'poetry' is not recognized as an internal or external command, operable program or batch file. facing this error
@OmPrasadKoirala
@OmPrasadKoirala 20 дней назад
great job
@AghilSoi
@AghilSoi 5 дней назад
'poetry' is not recognized as an internal or external command, operable program or batch file. help me with this error
@harshitmishra3318
@harshitmishra3318 21 день назад
At 8:25 what he is actually tell about the git commit ??? I didn't get that, can any one helps me to understand that ??
@hazard_111
@hazard_111 7 месяцев назад
Great video. Can you please do one on Pants build system as well?
@EarthlyTech
@EarthlyTech 6 месяцев назад
Thanks. Pants video may come. I do have this interview with Pants creator: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mEx8NWm4830.html
@NamasenITN
@NamasenITN 5 месяцев назад
Can I install poetry with poetry? Or will it cause an anomaly in the space time continuum?
@EarthlyTech
@EarthlyTech 5 месяцев назад
An anomaly for sure! The universe will be replaced with another universe where Python packaging is even more complex.
@BryanChance
@BryanChance 6 месяцев назад
I don't know which is worse python or nodejs
@thygrrr
@thygrrr 5 месяцев назад
Node. It's not even a competition.
@julians.2597
@julians.2597 3 месяца назад
@@thygrrr yeah, but it's bad enough
@JevKuznetsov
@JevKuznetsov 3 месяца назад
To go one step further - devcontainers are an even better solution. Build once - reproduce on any system.
@EarthlyTech
@EarthlyTech 3 месяца назад
Do you use the dev container support in VS Code? I find that is pretty nice.
@2002budokan
@2002budokan 5 месяцев назад
1. What if I don't want to publish my package on pypi but use it on my own local machine as a single executable? For example on Windows machine as an .exe file, how can I build this file? 2. And in this video it is not clear, how poetry breaks the diamond that you show us at the beginning of your video. What if we need two different version of the same package, for two libraries we need in our project, how poetry breaks the diamond and put two different versions of the same library in venv?
@EarthlyTech
@EarthlyTech 5 месяцев назад
Poetry doesn't break the diamond problem. It lessens its scope, as all virtual envs in python do. within a single projects its still not possible to depend on two version of something, unless the new version is published with a different name.
@downloadpcgamesdirectlinkb7590
@downloadpcgamesdirectlinkb7590 7 месяцев назад
This happens to me, it was shit I spend whole day trying to work it out I notice the problem is different dependency on different python version ugh
@EarthlyTech
@EarthlyTech 7 месяцев назад
yeah, we've all been burnt by this I think
@intelligenceservices
@intelligenceservices Месяц назад
Python is supposed to be so clever terse and elegant. If it was an apartment, it would be as spotless as patrick bateman's, but they have such a pile of garbage outside you need a Shai-Hulud to get to the door. Just a little poetry there.
@cerkal726
@cerkal726 Месяц назад
Explanation was nice. But I think you have missed main part of video that is how to avoid dependency hell. Like when installing two packages which use different versions of same depended package is still resulting in error. Which you explained in the earlier section of the video but didn't actually explain if it could be solved or not using peotry.
@EarthlyTech
@EarthlyTech Месяц назад
Yes, you are right! Poetry only solves when you use two separate venvs. Otherwise, it will attempt to find a version that is compatible with both and otherwise raise an error. At that point you need to find a singular version that works for both yourself or try otherwise adjust deps so that there is a singular version that works with your use case.
@LodeNachtergaele
@LodeNachtergaele 5 месяцев назад
What do you think about Pixi ?
@EarthlyTech
@EarthlyTech 5 месяцев назад
I'm not familiar with it. Do you like it?
@2002budokan
@2002budokan 5 месяцев назад
cargo4python => poetry
@EarthlyTech
@EarthlyTech 5 месяцев назад
Exactly
@mumk
@mumk 2 месяца назад
Use Nix instead
@windowsrefund
@windowsrefund Месяц назад
How?
@windowsrefund
@windowsrefund Месяц назад
I LOVE this video but please make the Internet a better place and stop referring to directories as "folders". Thumbs up! Also, the term "open source" is totally lame. The proper term is "Free Software".
@EarthlyTech
@EarthlyTech Месяц назад
I grew up on windows. Some habits die hard.
Далее
Python for Beginners - Learn Python in 1 Hour
1:00:06
Просмотров 17 млн
Впервые дал другу машину…
00:57
100❤️
00:19
Просмотров 2,6 млн
Web Server Concepts and Examples
19:40
Просмотров 232 тыс.
why I will never use python-poetry
9:09
Просмотров 55 тыс.
The most important Python script I ever wrote
19:58
Просмотров 158 тыс.
Python's 5 Worst Features
19:44
Просмотров 103 тыс.
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Просмотров 72 тыс.
Python Project Management with Poetry
58:08
Просмотров 1 тыс.
Python Poetry in 8 Minutes
8:27
Просмотров 53 тыс.
Don't Use Pip For Big Projects - Use These Instead
7:56
S-Pen в Samsung достоин Золота #Shorts
0:38
Подключил AirPods к Xbox
0:45
Просмотров 20 тыс.