File: 0026-Use-the-python3-binary.patch

package info (click to toggle)
cctbx 2022.9%2Bds2%2B~3.11.2%2Bds1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 130,052 kB
  • sloc: python: 815,067; cpp: 289,996; ansic: 22,472; fortran: 18,268; javascript: 1,852; sh: 1,145; sql: 632; csh: 519; java: 368; makefile: 316; xml: 25
file content (38 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Stefano Rivera <stefanor@debian.org>
Date: Sat, 24 Dec 2022 19:18:17 -0400
Subject: Use the python3 binary

On Debian there is no /usr/bin/python

Forwarded: not-needed
---
 libtbx/auto_build/install_base_packages.py | 2 +-
 libtbx/pkg_utils.py                        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libtbx/auto_build/install_base_packages.py b/libtbx/auto_build/install_base_packages.py
index 5700f9e..22aa268 100644
--- a/libtbx/auto_build/install_base_packages.py
+++ b/libtbx/auto_build/install_base_packages.py
@@ -645,7 +645,7 @@ Installation of Python packages may fail.
     if extra_options:
       assert isinstance(extra_options, list), 'extra pip options must be passed as a list'
     if download_only:
-      pip_version_cmd = ['python', '-c', 'import pip; print(pip.__version__)']
+      pip_version_cmd = ['python3', '-c', 'import pip; print(pip.__version__)']
       pip_version_result = subprocess.run(pip_version_cmd, stdout=subprocess.PIPE)
       if pip_version_result.returncode != 0:
         print("Skipping download of python package %s %s" % \
diff --git a/libtbx/pkg_utils.py b/libtbx/pkg_utils.py
index 0c1847e..e17ab32 100644
--- a/libtbx/pkg_utils.py
+++ b/libtbx/pkg_utils.py
@@ -13,7 +13,7 @@ import subprocess
 import libtbx.load_env
 
 try:
-  pip_version_cmd = ['python', '-c', 'import pip; print(pip.__version__)']
+  pip_version_cmd = ['python3', '-c', 'import pip; print(pip.__version__)']
   pip_version_str = subprocess.check_output(pip_version_cmd).decode().strip()
   import pkg_resources