The Python pyproject.toml File

The Python pyproject.toml File

Images of coding and ones and zeroes. Text reads: the Python pyrpoject.toml file. A configuration file used by packaging tools and other tools
So a few days ago I was working with a Senior in a Python codebase.

I work in quite a small codebase that's off the main repo at work as I work in a team that sits in the fringes of the company.

It's very cool. As we were debugging a CircleCI test that wouldn't pass, my Senior took me to the pyproject.toml file.

This is completely new to me as I am a JavaScript developer by background. Now I am a Python developer of course.

So what does this file do?

What is the pyproject.toml file?

The pyproject.toml file is a config file.

It is used by packaging tools.

It is used by other tools such as linters and type checkers as well. I'm wondering what this means, but according to this StackOverflow post, the pyproject.toml"contains the build system requirements of Python projects."

A quote from Medium says that: 

"This project is used to configure various aspects of your project, including dependencies and build tools."

It also says that this file is used for creating "metadata". So it is a standard way of setting up "project metadata" (source).

I don't know what toml stands for

But I think that it has something to do with tables.

TOM'S OBVIOUS, MINIMAL LANGUAGE? ARE YOU KIDDING ME? Who is Tom and how did he manage to get his name into Python files!!!

Okay it's Tom Preston-Werner who's an American billionaire software developer so I'm happy for him but wow.

Oh he co-founded GitHub. Okay then.

K THX BYE.

One last push...

... on this research task which I have set for myself and decided to research and said I would do.

This file wasn't always around - it was recently introduced at some point (but when??!). 2016, then.

It "defines what tools are needed to build our package."

I don't really know much about this but when I was installing something using 'pip install' a senior told me to set it up instead. I am confused now.

Help is welcome 😂 I accept Slack messages from colleagues! 😂



Comments