Pyproject.toml: Difference between revisions
Line 23: | Line 23: | ||
=Project Metadata= | =Project Metadata= | ||
<syntaxhighlight lang='toml'> | |||
[project] | |||
name = "ofddi" | |||
version = "0.1.0" | |||
authors = [ | |||
{ name="Ovidiu Feodorov", | |||
email="ovidiu@example.com" | |||
}, | |||
] | |||
description = "DDI" | |||
readme = "README.md" | |||
requires-python = ">=3.12" | |||
classifiers = [ | |||
"Programming Language :: Python :: 3", | |||
"License :: OSI Approved :: MIT License", | |||
"Operating System :: OS Independent", | |||
] | |||
[project.urls] | |||
Homepage = "https://github.com/ovidiuf/ofddi" | |||
Issues = "https://github.com/ovidiuf/ofddi/issues" | |||
</syntaxhighlight> |
Revision as of 02:24, 6 April 2024
External
Internal
Overview
pyproject.toml
is a file that specifies required packages, scripts, plugins and URLs.
Build Backend Configuration
pyproject.toml
tells the build frontend tool which backend to use for the specific project it is part of.
The requires
key is a list of packages that are needed to build the package. The frontend should install them automatically when building the package. What about the dependencies specified in requirements.txt
? The build-backend
key is the name of the Python object that frontends will use to perform the build.
Additional configuration of the build tool will either be in a tool
section of the pyproject.toml
, or in a special file defined by the build tool. For example, when using setuptools
as build backend, additional configuration may be added to a setup.py
or setup.cfg
file.
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Project Metadata
[project]
name = "ofddi"
version = "0.1.0"
authors = [
{ name="Ovidiu Feodorov",
email="ovidiu@example.com"
},
]
description = "DDI"
readme = "README.md"
requires-python = ">=3.12"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://github.com/ovidiuf/ofddi"
Issues = "https://github.com/ovidiuf/ofddi/issues"