Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 22909

Moshe Zadka: The "Dynamic" Properties in PyProject

$
0
0

When writing a pyproject.toml file, the project section is optional. However, if it does exist, two of its properties are required:

  • name
  • version

If these two properties are not there, the section will be ignored.

This is a lie. But it is not a big lie: it is almost true.

In general, if either of these two properties are not there, the section will be ignored. However, there is a way to indicate that either, or both, of these properties will be filled in by the build system later on.

This is done with dynamic.

For example

[project]name="my-package"dynamic=["version"]

This is the most common setting. However, it is possible to set dynamic to ["name", "version"] and avoid both parameters.


Viewing all articles
Browse latest Browse all 22909

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>