aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-07-26 13:49:26 +0200
committerDimitri Staessens <dimitri@ouroboros.rocks>2026-07-26 14:50:26 +0200
commit33f3c6fc4ca8810cee4c517594be725a26eec70c (patch)
treec4b2f8c14357b1b4e979e01c3b516ddf254f3b98 /setup.py
parent3947452e391b1f1fc3933b28ce97d86e3b555d84 (diff)
downloadpyouroboros-33f3c6fc4ca8810cee4c517594be725a26eec70c.tar.gz
pyouroboros-33f3c6fc4ca8810cee4c517594be725a26eec70c.zip
pyouroboros: Use consistent format docstringsHEADmaster
This is basically a clean up pass to make sure all docstrings are aligned. The copyright banners are replaced by SPDX statements. Also did a general clean up on the comments. Passes pylint. No structural changes. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/setup.py b/setup.py
index 6d8d160..a7b06e9 100755
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,15 @@
-"""Build script for the PyOuroboros CFFI extensions.
+#
+# SPDX-FileCopyrightText: 2016 - 2026 Dimitri Staessens
+# SPDX-License-Identifier: LGPL-2.1-only
+#
+
+"""
+Build script for the PyOuroboros CFFI extensions.
Resolves the ouroboros library version via ``pkg-config`` and the
pyouroboros source version via ``setuptools_scm``, verifies that the
-``major.minor`` halves match, and delegates the actual build to the
-CFFI builders under ``ffi/``.
+``major.minor`` halves match, and delegates the actual build to the CFFI
+builders under ``ffi/``.
"""
from __future__ import annotations
@@ -28,19 +34,21 @@ def _get_ouroboros_version() -> str:
def _check_build_version_compat() -> None:
+ """
+ Exit when the ouroboros and pyouroboros ``major.minor`` disagree.
+
+ Returns without checking when the tree carries no SCM information.
+ """
+
try:
pyo7s_ver = get_version(root='.', relative_to=__file__)
except (LookupError, OSError):
- return # no SCM info, skip check
+ return
o7s_ver = _get_ouroboros_version()
- # setuptools_scm: '0.23.1.dev3+g<hash>' or '0.23.0'
- # pkg-config: '0.23.0'
- # Compare major.minor only.
o7s_parts = o7s_ver.split('.')
pyo7s_parts = pyo7s_ver.split('.')
-
if o7s_parts[0] != pyo7s_parts[0] or o7s_parts[1] != pyo7s_parts[1]:
sys.exit(
f"ERROR: Version mismatch: ouroboros {o7s_ver} "