From df44f7a5c21a8afe0d5dc00f7b7db55d499ba092 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 26 Mar 2024 16:21:44 +0100 Subject: [PATCH] require python 3.6 * HACKING, NEWS, README, doc/org/install.org: Update. * m4/pypath.m4, python/spot/__init__.py: Adjust requirements. * python/spot/ltsmin.i: Don't use capture_output, this is a 3.7 option. --- HACKING | 2 +- NEWS | 6 ++++++ README | 4 ++-- doc/org/install.org | 2 +- m4/pypath.m4 | 2 +- python/spot/__init__.py | 8 ++++---- python/spot/ltsmin.i | 3 ++- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/HACKING b/HACKING index 59a0fc401..85b45ed14 100644 --- a/HACKING +++ b/HACKING @@ -42,7 +42,7 @@ since the generated files they produce are distributed.) A complete LaTeX distribution, including latexmk and extra fonts like dsfont.sty. ImageMagick - Python >= 3.5, IPython >= 2.3 + Python >= 3.6, IPython >= 2.3 Jupyter >= 4, with nbconvert GraphViz Java >= 1.7 (needed to run PlantUML while generating the doc) diff --git a/NEWS b/NEWS index c782d4233..4bc2f452e 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,11 @@ New in spot 2.11.6.dev (not yet released) + Build: + + - When Python bindings are enabled, Spot now requires Python 3.6 or + later. Python 3.6 has reached end-of-life in 2021, but is still + used on CentOS 7 (which will reach end-of-support later in 2024). + Documentation: - https://spot.lre.epita.fr/tut25.html is a new example showing diff --git a/README b/README index a19fc8473..30c181574 100644 --- a/README +++ b/README @@ -76,7 +76,7 @@ Requirements Spot requires a C++17-compliant compiler. G++ 7.x or later, as well as Clang++ 5.0 or later should work. -Spot expects a complete installation of Python (version 3.5 or later). +Spot expects a complete installation of Python (version 3.6 or later). Especially, Python's headers files should be installed. If you don't have Python installed, and do NOT want to install it, you should run configure with the --disable-python option (see below). @@ -133,7 +133,7 @@ flags specific to Spot: offers a convenient interface when used in an IPython notebook, and are also used to build the CGI script that translates LTL formulas on-line. You may safely disable these, especially if you - do not have a working Python 3.2+ installation or if you are + do not have a working Python 3.6+ installation or if you are attempting some cross-compilation. --enable-max-accsets=N diff --git a/doc/org/install.org b/doc/org/install.org index 0a08677e1..f498194e9 100644 --- a/doc/org/install.org +++ b/doc/org/install.org @@ -22,7 +22,7 @@ successful development build]]. Spot requires a C++17-compliant compiler. =g++= 7.0 or later, as well as =clang++= 5.0 or later should work. -Spot expects a complete installation of Python (version 3.5 or later). +Spot expects a complete installation of Python (version 3.6 or later). Especially, Python's headers files should be installed (the package to install has a name like =python-dev= or =libpython3-dev= in most distributions). If you don't have Python installed, and do NOT want diff --git a/m4/pypath.m4 b/m4/pypath.m4 index 61a9921bd..efdf57355 100644 --- a/m4/pypath.m4 +++ b/m4/pypath.m4 @@ -1,5 +1,5 @@ AC_DEFUN([adl_CHECK_PYTHON], - [AM_PATH_PYTHON([3.5]) + [AM_PATH_PYTHON([3.6]) case $PYTHON in [[\\/$]]* | ?:[[\\/]]* );; *) AC_MSG_ERROR([The PYTHON variable must be set to an absolute filename.]);; diff --git a/python/spot/__init__.py b/python/spot/__init__.py index c44ce9555..b784fdbdf 100644 --- a/python/spot/__init__.py +++ b/python/spot/__init__.py @@ -19,8 +19,8 @@ import sys -if sys.hexversion < 0x03030000: - sys.exit("This module requires Python 3.3 or newer") +if sys.hexversion < 0x03060000: + sys.exit("This module requires Python 3.6 or newer") import subprocess import os @@ -710,7 +710,7 @@ def automata(*sources, timeout=None, ignore_abort=True, # returned by spot.automata() is destroyed. Otherwise, _supress() # is just a dummy context manager that does nothing (Python 3.7 # introduces nullcontext() for this purpose, but at the time of - # writing we support Python 3.4). + # writing we still have to support Python 3.6). mgr = proc if proc else _supress() with mgr: while a: @@ -730,7 +730,7 @@ def automata(*sources, timeout=None, ignore_abort=True, # an exception. if ret and sys.exc_info()[0] is None: raise subprocess.CalledProcessError(ret, filename[:-1]) - # deleting o explicitly now prevents Python 3.5 from + # deleting o explicitly used to prevent Python 3.5 from # reporting the following error: " returned a result with # an error set". It's not clear to me if the bug is in Python diff --git a/python/spot/ltsmin.i b/python/spot/ltsmin.i index 94b4ca93b..c039fdba3 100644 --- a/python/spot/ltsmin.i +++ b/python/spot/ltsmin.i @@ -173,7 +173,8 @@ try: try: p = subprocess.run(['divine', 'compile', '--ltsmin', t.name], - capture_output=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, universal_newlines=True) if p.stdout: print(p.stdout) if p.stderr: print(p.stderr, file=sys.stderr)