Building means compiling the source code to binary in a sandbox location where it won't affect your system if something goes wrong, like a build subdirectory inside the source code directory.
Install means copying the built binaries from the build subdirectory to a place in your system path, where they become easily accessible. This is rarely done by a straight copy command, and it's often done by some package manager that can track the files created and easily uninstall them later.
Usually, a build command does all the compiling and linking needed, but Python is an interpreted language, so if there are only pure Python files in the library, there's no compiling step in the build. Indeed, everything is copied to a build directory, and then copied again to a final location. Only if the library depends on code written in other languages that needs to be compiled you'll have a compiling step.
Answer from Pedro Werneck on Stack Overflowpython - What is Building and Installing? - Stack Overflow
What Exactly Does a Build System in Python Do?
How Do I Actually Build Something With Python?
Post your Python builds here!
» pip install python-build
Building means compiling the source code to binary in a sandbox location where it won't affect your system if something goes wrong, like a build subdirectory inside the source code directory.
Install means copying the built binaries from the build subdirectory to a place in your system path, where they become easily accessible. This is rarely done by a straight copy command, and it's often done by some package manager that can track the files created and easily uninstall them later.
Usually, a build command does all the compiling and linking needed, but Python is an interpreted language, so if there are only pure Python files in the library, there's no compiling step in the build. Indeed, everything is copied to a build directory, and then copied again to a final location. Only if the library depends on code written in other languages that needs to be compiled you'll have a compiling step.
You want a new chair for your living-room and you want to make it yourself. You browse through a catalog and order a pile of parts. When they arrives at your door, you can't immediately use them. You have to build the chair at your workshop. After a bit of elbow-grease, you can sit down in it. Afterwards, you install the chair in your living-room, in a convenient place to sit down.
The chair is a program you want to use. It arrives at your house as source code. You build it by compiling it into a runnable program. You install it by making it easier to use.
I consider myself a decent python developer. I have been working as a machine learning engineer for a few years, delivered a lot of ETL pipelines, MLOps projects (scaled out distributed model training and inference) using python and some cloud technologies.
My typical workflow has been to to expose rest APIs using combination of FastAPI, with celery backend for parallel task processing, deployment on Kubernetes etc. For environment management, I have used a combination of uv from Astral and Docker.
But now I am seeing a lot of posts on python build systems, such as hatchling but cannot figure out what is the value and what exactly do they do?
I have done some fair bit of C++ and Rust, and to me build refers to compilation. But Python does not compile, you run the source code directly, from the required entry point in a repository. So what exactly is it something like hatch or hatchling (is there a difference?) do that I cannot do with my package manager like uv?
In this regard, any link to a tutorial explaining the use case, and teaching the utility from ground up would be appreciated too.
I've been programming in Python for a while now. I'm familiar with all the basic functionalities and have been working on algorithms for a while as well. My question is, how do I actually build something solid with Python (say, an application, or a program that automatically replies to all my emails with a pre-written message)? I simply have no clue how to do that. I'm only familiar with the "logic" of Python, but I can't "build" anything with it. Where do I start? What do I learn?