Skip to main content

Pyproject.toml: The Ultimate Guide to Python Packaging in 2026

5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

For years, the Python packaging world was a Wild West of setup.py, setup.cfg, and requirements.txt. It was messy, often insecure, and required executing arbitrary Python code just to install a library.

In 2026, pyproject.toml is the undisputed king. It is a single, human-readable configuration file that tells Python exactly how to build, install, and manage your project.

The `__main__.py` File: The Front Door to Your Python Package

5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

If __init__.py is the receptionist that organizes your package, then __main__.py is the front door. It's the specific file Python looks for when you try to execute a directory as if it were a single script.

In 2026, as Python applications become more modular, __main__.py has become the standard way to provide a Command Line Interface (CLI) for your tools.

How to Use `__init__.py` in Python Packages: Role, Patterns, and Best Practices

6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

While the existence of __init__.py makes a directory a package, how you fill that file separates a messy script from a professional library. In 2026, the goal of a well-crafted __init__.py is to provide a "Clean Facade"-hiding the messy internal plumbing of your project while offering a polished interface to the user.

Here are the industry-standard best practices for utilizing this file effectively.

Conventional Commits Cheat Sheet & Guide

6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Conventional Commits is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history, which makes it easier for automated tools to parse and for humans to understand (1).

How to Fix the 'ModuleNotFoundError: No module named pre_commit' Error

5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Getting the ModuleNotFoundError: No module named 'pre_commit' error is a classic "Lost in Translation" moment between your terminal and your Python environment. You know you want to commit code, and Git knows it needs to run a hook, but the Python interpreter looking for the pre_commit package is coming up empty-handed.

Here is the straightforward guide to finding that missing module and getting your hooks back on track.

Git Merging: How to Resolve Conflicts, Choose Strategies, and Keep Clean History

11 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

The dreaded CONFLICT (content): Merge conflict in file.txt. For many developers, seeing this message triggers an immediate spike in heart rate. It feels like you broke something.

Take a deep breath. You didn't break anything. A merge conflict is simply Git throwing its hands up and saying, "Hey, two people changed the exact same line of code, and I am not smart enough to guess which one is right. I need a human."

Here is how to read the Matrix, resolve the conflict, and get on with your day without losing your mind.

How to write RLS Policies to ensure users can only edit their own profile data?

5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

In a traditional setup, you'd write a bunch of backend code to check if session.user.id === profile.id. In Supabase, you just tell the database the rules and let it act as the bouncer.

Row Level Security (RLS) is the engine that ensures your users can see a thousand profiles but can only click "Edit" on their own. Here is how to configure it correctly in 2026.

How to Use Check Constraints in Supabase for Data Integrity

5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Data types are great, but they are often too "blunt" for real-world business logic. You might know a column is an integer, but you also need to ensure that it's never a negative number, or that a discount_price is always lower than the original_price.

In Supabase (which runs on PostgreSQL), the Check Constraint is your first line of defense for data integrity. It sits directly in the database engine, meaning no matter how a user tries to insert data (API, Dashboard, or CLI), the rule is impossible to bypass.

Git fetch vs git fetch origin: whats the difference?

5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

When you are typing away in your terminal, git fetch and git fetch origin probably feel exactly the same. In fact, if you only ever work on standard, single-team projects, you might go your entire career without realizing there is a difference at all.

However, Git is highly configurable. The moment you step into open-source development or complex team architectures, that little missing word (origin) suddenly completely changes how Git behaves.

Here is the candid truth about what Git is actually doing behind the scenes.

Fix Firestore Error: A Document Must Have an Even Number of Path Elements

5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

If you are working with Firebase and suddenly see the error fatal: A document must have an even number of path elements, don't worry-you haven't broken your database. This is Firestore's way of telling you that you've gotten lost in the "Map" of your data.

In Firestore, there is one unbreakable rule: Collections and Documents must always alternate.

Looking for more content?
Hrekov Blog contains 165 articles. Browse the blog archive or Explore the full timeline.