cli.version: Show information about free-threaded-ness
Now you see information like $ pyeclib-backend -V pyeclib 1.7.0 liberasurecode 1.7.1 CPython 3.14.0rc2 free-threading build or $ pyeclib-backend -V pyeclib 1.7.0 liberasurecode 1.7.1 CPython 3.13.7 experimental free-threading build on free-threaded builds instead of just $ pyeclib-backend -V pyeclib 1.7.0 liberasurecode 1.7.1 CPython 3.14.0rc2 Change-Id: Ie0bc70ff0d1fe74b4c4037251216cdc70c735611 Signed-off-by: Tim Burke <tim.burke@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import platform
|
||||
import sys
|
||||
|
||||
from pyeclib import ec_iface
|
||||
|
||||
@@ -31,7 +32,8 @@ version_description = "print pyeclib and liberasurecode versions"
|
||||
def version_command(args=None):
|
||||
print(f"pyeclib {ec_iface.__version__}")
|
||||
print(f"liberasurecode {ec_iface.LIBERASURECODE_VERSION}")
|
||||
print(f"{platform.python_implementation()} {platform.python_version()}")
|
||||
version_str = sys.version.split(' (', 1)[0]
|
||||
print(f"{platform.python_implementation()} {version_str}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@@ -38,7 +38,7 @@ class TestVersion(unittest.TestCase):
|
||||
main(args)
|
||||
self.assertTrue(stdout.getvalue().endswith("\n"))
|
||||
line_parts = [
|
||||
line.split(" ")
|
||||
line.split(" ", 1)
|
||||
for line in stdout.getvalue()[:-1].split("\n")
|
||||
]
|
||||
self.assertEqual([prog for prog, vers in line_parts], [
|
||||
@@ -46,7 +46,9 @@ class TestVersion(unittest.TestCase):
|
||||
'liberasurecode',
|
||||
platform.python_implementation(),
|
||||
])
|
||||
re_version = re.compile(r"^\d+\.\d+\.\d+(?:rc\d*)?$")
|
||||
re_version = re.compile(
|
||||
r"^\d+\.\d+\.\d+(?:rc\d*)?"
|
||||
r"(?:(?: experimental)? free-threading build)?$")
|
||||
self.assertEqual(
|
||||
[bool(re_version.match(vers)) for prog, vers in line_parts],
|
||||
[True] * 3)
|
||||
|
Reference in New Issue
Block a user