Introducing the pyproject.toml Spec
In this lesson, you’ll get some context regarding the structure of pyproject.toml
. Specifically, you’ll check out PEP 621 – Storing project metadata in pyproject.toml.
00:00 One other file that we’ll just take a quick look at since we’re a little bit diving into documentation here is the PEP 621.
00:07
This was the PEP that kind of defines how these metadata should look. So, you see it’s called Storing project data in pyproject.toml. And if you just start scrolling down a little bit here, you’ll see that we’ll quite soon get to spelling out the—there we go, the specifications. So the table name, you can see here, it starts saying, okay, things should live inside a table named project
.
00:31
If you scroll down section more, you can see it says name
. And now we can compare this to the setuptools page, and we’ll see that we have project
and we have the name
there. So this is kind of the implementation, well, we saw the specification in the PEP. Okay, so this follows the PEP for how you should structure your TOML file because you still have some freedom in how to define a TOML file.
00:55 TOML isn’t just a Python thing. Other languages use TOML. This is a PEP-defined structure for a TOML file for a Python package.
01:05
Yeah. TOML by itself is a completely general configuration format, but the PEP kind of defines a schema that we need to follow so that pip
will understand it when it tries to install things.
Become a Member to join the conversation.