What is the best practice to define package version? I am using mesonpy
. The documentation at Single-sourcing the package version — Python Packaging User Guide describes setup.py
.
I tried setting __version__
in __init__.py
, and adding to pyproject.toml
,
[project]
...
dynamic = ["version"]
and
[tool.meson-python.dynamic]
version = {attr = "funcphys.__version__"}
which supposedly works with setuptools
>0.60, but mesonpy
does not support this approach. The mesonpy
documentation only describes arguments passed to meson
.
I also want to build my package with conda-build
, which has its own way of setting the version. The build section in recipe/meta.yaml
has
{% set version = "2.0b0" %}
and
script: "{{ PYTHON }} -m pip install . -v"
I want to avoid having to set the same value in 3 separate files.