Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-fastnumbers for openSUSE:Factory checked in at 2024-11-26 20:55:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-fastnumbers (Old) and /work/SRC/openSUSE:Factory/.python-fastnumbers.new.28523 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-fastnumbers" Tue Nov 26 20:55:16 2024 rev:13 rq:1225877 version:5.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-fastnumbers/python-fastnumbers.changes 2024-01-03 12:25:01.883572385 +0100 +++ /work/SRC/openSUSE:Factory/.python-fastnumbers.new.28523/python-fastnumbers.changes 2024-11-26 20:55:19.344992671 +0100 @@ -1,0 +2,7 @@ +Fri Nov 22 18:57:14 UTC 2024 - Matej Cepl <[email protected]> + +- Add fix-compiler-errors.patch with upstream fixes for compiler + errors. +- Use %pytest_arch instead of home made calling of pytest. + +------------------------------------------------------------------- New: ---- fix-compiler-errors.patch BETA DEBUG BEGIN: New: - Add fix-compiler-errors.patch with upstream fixes for compiler errors. BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-fastnumbers.spec ++++++ --- /var/tmp/diff_new_pack.hjvSr9/_old 2024-11-26 20:55:19.933017189 +0100 +++ /var/tmp/diff_new_pack.hjvSr9/_new 2024-11-26 20:55:19.933017189 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-fastnumbers # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,9 @@ License: MIT URL: https://github.com/SethMMorton/fastnumbers Source: https://files.pythonhosted.org/packages/source/f/fastnumbers/fastnumbers-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix-compiler-errors.patch [email protected] +# Code from gh#SethMMorton/fastnumbers@5522116cd03a and gh#SethMMorton/fastnumbers@8d2104e5cd93 +Patch0: fix-compiler-errors.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module pip} BuildRequires: %{python_module typing-extensions} @@ -58,7 +61,7 @@ an input could be converted to int or float. %prep -%setup -q -n fastnumbers-%{version} +%autosetup -p1 -n fastnumbers-%{version} %build %if 0%{?suse_version} <= 1500 @@ -73,9 +76,7 @@ %python_expand %fdupes %{buildroot}%{$python_sitearch} %check -%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} -pytest-%{$python_bin_suffix} -} +%pytest_arch %files %{python_files} %doc README.rst ++++++ fix-compiler-errors.patch ++++++ >From 5522116cd03a14e72caee50e64902df7b5543028 Mon Sep 17 00:00:00 2001 From: Seth Morton <[email protected]> Date: Mon, 21 Oct 2024 21:55:42 -0700 Subject: [PATCH] Update CI configuration --- dev/formatting.py | 2 +- include/fastnumbers/third_party/ipow.hpp | 6 ++++-- setup.py | 8 ++++++++ src/cpp/parser.cpp | 3 +++ tox.ini | 13 +++++++++++-- 5 files changed, 27 insertions(+), 5 deletions(-) --- a/dev/formatting.py +++ b/dev/formatting.py @@ -52,6 +52,6 @@ any_cpp_formatting = any( # "Roll up" what happened into a single exit code. all_return_zero = all(ret.returncode == 0 for ret in [black_ret, clang_format_ret]) if any_cpp_formatting or not all_return_zero: - sys.exit("Not all files are formatted correctly. Run 'tox -e format'.") + sys.exit("Not all files are formatted correctly. Run 'tox run -e format'.") else: sys.exit(0) --- a/include/fastnumbers/third_party/ipow.hpp +++ b/include/fastnumbers/third_party/ipow.hpp @@ -58,8 +58,10 @@ inline T1 ipow(T1 base, T2 exp) { return 1; } - if (base == -1) { - return 1 - 2 * (exp & 1); + if constexpr(std::is_signed_v<T1>) { + if (base == -1) { + return 1 - 2 * (exp & 1); + } } return 0; --- a/setup.py +++ b/setup.py @@ -9,6 +9,7 @@ from setuptools import Extension, find_p # Compilation arguments are platform-dependent +link_args = ["-lm"] if sys.platform == "win32": compile_args = [ "/std:c++17", @@ -19,6 +20,8 @@ if sys.platform == "win32": if "FN_DEBUG" in os.environ or "FN_COV" in os.environ: compile_args.append("/Od") compile_args.append("/Z7") + if "FN_WARNINGS_AS_ERRORS" in os.environ: + compile_args.append("/WX") else: compile_args = [ "-std=c++17", @@ -31,6 +34,11 @@ else: if "FN_DEBUG" in os.environ or "FN_COV" in os.environ: compile_args.append("-Og") compile_args.append("-g") + if "FN_COV" in os.environ: + compile_args.append("--coverage") + link_args.append("--coverage") + if "FN_WARNINGS_AS_ERRORS" in os.environ: + compile_args.append("-Werror") ext = [ --- a/src/cpp/parser.cpp +++ b/src/cpp/parser.cpp @@ -460,4 +460,7 @@ NumberFlags CharacterParser::get_number_ case StringType::INTLIKE_FLOAT: return flag_wrap(NumberType::Float | NumberType::IntLike); } + + /* Is not reachable, but silences compiler warnings. */ + return NumberType::INVALID; } --- a/tox.ini +++ b/tox.ini @@ -4,10 +4,11 @@ # and then run "tox" from this directory. [tox] -envlist = py37, py38, py39, py310, py311, py12 +envlist = lint, mypy, py37, py38, py39, py310, py311, py12 # Other valid environments are: # format -# format-check +# lint +# mypy # docs # bump # clean @@ -50,6 +51,14 @@ deps = clang-format commands = {envpython} dev/formatting.py +# Check code quality. +[testenv:lint] +setenv = + FN_WARNINGS_AS_ERRORS=1 +deps = + ruff + clang-format + # Type checking [testenv:mypy] deps =
