File: 03-docs-read-version-from-pyproject.diff

package info (click to toggle)
python-firebase-messaging 0.4.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 652 kB
  • sloc: python: 1,454; makefile: 14
file content (31 lines) | stat: -rw-r--r-- 1,231 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: Fix build documentation: use version from pyproject.toml
Author: Carles Pina i Estany <cpina@debian.org>
Forwarded: not-needed
Last-Update: 2024-12-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -3,7 +3,7 @@
 # For the full list of built-in configuration values, see the documentation:
 # https://www.sphinx-doc.org/en/master/usage/configuration.html
 
-from importlib.metadata import version as _version
+import tomllib
 
 # -- Project information -----------------------------------------------------
 # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
@@ -11,8 +11,11 @@ from importlib.metadata import version a
 project = "firebase-messaging"
 copyright = "2023, Steven Beth"
 author = "Steven Beth"
-release = _version("firebase_messaging")
-version = _version("firebase_messaging")
+
+with open("../../pyproject.toml", "rb") as f:
+    pyproject_data = tomllib.load(f)
+
+version = release = pyproject_data["project"]["version"]
 
 # -- General configuration ---------------------------------------------------
 # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration