Using Makefile in Python with a Virtual Environment

  Рет қаралды 8,326

Earthly

Earthly

Жыл бұрын

Earthly ➤ earthly.dev/youtube
In this video, I will show you how - and why - to use makefiles with Python.
How to set up virtual environments and develop faster using this old-fashioned tool. And if you stay to the end, I'll share why makefiles are still an excellent choice for a modern developer.
Discover the seamless integration of Makefiles with Python programming for streamlined development workflows. Learn the step-by-step process of setting up virtual environments, executing code, and managing dependencies with pip, all within the powerful VS Code interface. Understand the nuances of interpreted languages and bytecode compilation as we delve into the practical applications of Makefiles as a task runner in Python projects. By the conclusion of this video, you'll be equipped with the knowledge to use Makefiles for build automation, clean up Python cache, and optimize your command line efficiency for robust software development. Don't miss the insights on how Makefiles, an ostensibly old-fashioned tool, provide enduring value and adaptability for the modern developer, enhancing both local and continuous integration (CI) build processes with tools like Earthly.dev. Join us to elevate your Python coding practices and embrace the longevity of Unix tools in today's development landscape.

Пікірлер: 20
@jitvimol
@jitvimol Жыл бұрын
WOW. Excellent tutorial. Thanks so much.
@umka7536
@umka7536 7 ай бұрын
Tye best makefile tutorial I've seen so far. 😊
@EarthlyTech
@EarthlyTech 7 ай бұрын
Glad you think so!
@vitharana1996
@vitharana1996 7 ай бұрын
this is great ! thank you for teaching me
@EarthlyTech
@EarthlyTech 7 ай бұрын
My pleasure!
@HyperFocusMarshmallow
@HyperFocusMarshmallow Жыл бұрын
Great tutorial! How would you compare this to using a tool like “poetry” for python. Seems like that gives you these things for free and other extra things in addition. That’s the one I know of, but I bet there are many other options.
@EarthlyTech
@EarthlyTech Жыл бұрын
I haven't used poetry. I like make because when I switch languages, make works with all of them. But if you are staying in python land always then something more specific to Python could make sense.
@HyperFocusMarshmallow
@HyperFocusMarshmallow Жыл бұрын
@Earthly I’ve only done some minor personal projects with poetry but it does seem nice. I guess the main benefit is that it resolves dependencies and can handle packaging. Otherwise there are pretty nice defaults and commands to help set it up automatically. Since packaging and dependencies can be quite fickle if you’re just manually carrying around a “requirements.txt” file, I quite like those features. It kind of reminds more of cargo in rust-land. It seems like a very modern approach. So I’d recommend checking it out for sure. I’ve seen people use conda a lot as well, but I haven’t delved into exactly which features it does well or what the costs versus benefits are. (Edit: Your point that developers from other contexts will feel at home with make has a point to it. I’ve seen projects use make to call poetry for that purpose. That kind of seems more complicated than just using one tool in my opinion. Thanks for the interaction!)
@EarthlyTech
@EarthlyTech Жыл бұрын
Maybe we need to do a future video on poetry? I'll look into it. Cargo is really nice and I do like the nice-defaults, batteries included approach.
@ethans-l9461
@ethans-l9461 10 ай бұрын
Make is useful for setting up Poetry for people not familiar with it. Make is a general state and dependency aware command runner. Poetry more than just running virtual environments does recursive dependency management and locking. As well as publication, building, etc. Poetry is specialized to Python, Make is generic. Using make to set-up python is quite nice if you’re introducing it to a team though.
@christianstork1049
@christianstork1049 Жыл бұрын
Thanks, good infos! FYI, you don't have to make your activate script executable. (Actually, you shouldn't since it's only meant to be sourced.) Oh, and shouldn't setup be .PHONY, too?
@EarthlyTech
@EarthlyTech Жыл бұрын
yeah, setup should probably be phony as well Thanks for watching!
@venky1922
@venky1922 Ай бұрын
How to do it in windows
@OchiiDinUmbraa
@OchiiDinUmbraa Жыл бұрын
How do you install gmake so that you can use it in a python terminal?
@EarthlyTech
@EarthlyTech Жыл бұрын
I'm just in a ZSH terminal and install gmake with brew install make. Does that help?
@OchiiDinUmbraa
@OchiiDinUmbraa Жыл бұрын
@@EarthlyTech Where is the install to the ZSH terminal? I keep instaling things i dont need. Im on windows.
@OchiiDinUmbraa
@OchiiDinUmbraa Жыл бұрын
Ok, im trying to install gmake from the Ubuntu console from Windows 11. When i type "brew install make" it tells me: Command 'brew' not found, did you mean: command 'qbrew' from deb qbrew (0.4.1-8build1) command 'brec' from deb bplay (0.991-10build1) Try: sudo apt install
@EarthlyTech
@EarthlyTech Жыл бұрын
​@@OchiiDinUmbraa On windows, use chocalately and run `choco install make` chocolatey.org/install
@EarthlyTech
@EarthlyTech Жыл бұрын
@@OchiiDinUmbraa Try running make, it's probably there, else install using Ubuntu package manager. Gmake is a MacOS alias for make
Makefiles in Python For Professional Automation
13:43
NeuralNine
Рет қаралды 40 М.
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 91 МЛН
Clowns abuse children#Short #Officer Rabbit #angel
00:51
兔子警官
Рет қаралды 21 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 23 МЛН
How to Use Poetry in Python to avoid Dependency Hell
20:21
Earthly
Рет қаралды 11 М.
makefile basics (beginner - intermediate) anthony explains #357
12:48
anthonywritescode
Рет қаралды 27 М.
The secret to making Golang error handling a breeze
13:46
Earthly
Рет қаралды 9 М.
Protocol Or ABC In Python - When to Use Which One?
23:45
ArjanCodes
Рет қаралды 198 М.
The Complete Guide to Python Virtual Environments!
15:52
teclado
Рет қаралды 333 М.
Supercharge your Python App with RAG and Ollama in Minutes
9:42
Matt Williams
Рет қаралды 30 М.
Replacing make with a Shell Script for Running Your Project's Tasks
23:18
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 91 МЛН