From 33f3c6fc4ca8810cee4c517594be725a26eec70c Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 26 Jul 2026 13:49:26 +0200 Subject: pyouroboros: Use consistent format docstrings 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 --- setup.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'setup.py') 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' 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} " -- cgit v1.2.3