Python pyproject.toml: Difference between revisions

From wikinotes
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<code>pyproject.toml</code> allows you to declare a build system,<br>
and contain configuration to be passed to other tools related to your project.<br>
(ex. before you needed to install setuptools, then could use <code>setup.py</code>)
= Documentation =
= Documentation =
<blockquote>
<blockquote>
{| class="wikitable"
{| class="wikitable"
|-
|-
| PEP-518 || https://www.python.org/dev/peps/pep-0518/
| official docs || https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
|-
| PEP-517 (execute build tools) || https://peps.python.org/pep-0517/
|-
| PEP-518 (specify build tools) || https://peps.python.org/pep-0518/
|-
|-
|}
|}

Latest revision as of 23:19, 14 February 2024

pyproject.toml allows you to declare a build system,
and contain configuration to be passed to other tools related to your project.
(ex. before you needed to install setuptools, then could use setup.py)

Documentation

official docs https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
PEP-517 (execute build tools) https://peps.python.org/pep-0517/
PEP-518 (specify build tools) https://peps.python.org/pep-0518/

Tutorials

pyproject.toml basics https://godatadriven.com/blog/a-practical-guide-to-setuptools-and-pyproject-toml/
what is pyproject.toml https://snarky.ca/what-the-heck-is-pyproject-toml/

Locations

${PROJECT}/pyproject.toml project config

Syntax

Common Configs

unittest

pytest

# pyproject.toml
[tool.pytest.ini_options]
python_files = *.py
testpaths = ["tests/unit", "tests/integration"]
norecursedirs = tests/integration/resources