Matplotlib built from sources has the wrong version number

Hello, Matplotlib Community.

Recently, I tried to build Matplotlib from sources. The following commands are what I runned:

git clone --depth=1 --branch=main https://github.com/matplotlib/matplotlib.git
cd matplotlib
conda create --prefix ./.venv --yes
conda activate ./.venv
export LANG=en_US.UTF-8
export PYTHONNOUSERSITE=1
conda install python=3.12 sphinx=8.1.2 numpy=2.0.0 gcc gxx binutils ninja --channel conda-forge --yes
pip install --requirement=requirements/doc/doc-requirements.txt --progress-bar=off --verbose
pip install .[dev] --config-settings=compile-args=-j4 --verbose
python -c "import matplotlib; print(matplotlib.__version__)"

Although the matplotlib package is built successfully, its version number went wrong!?

0.1.0.dev1+gdc63ec7

What happened? What caused it? How to fix it?

The following file is the full log of the above commands:

log-build-matplotlib-from-sources-2024-12-19.txt

With this option, you get no tags, and thus no valid version to generate.