Use Python 3 in script shebangs
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Thu, 18 Dec 2025 07:37:30 +0000 (07:37 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Thu, 18 Dec 2025 07:37:30 +0000 (07:37 +0000)
(Skipping the two .pyx files with #!python - they need to be compiled
with Cython, not directly run with any version of plain Python)

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

Gbp-Pq: Name python3_shebangs.patch

archive/docs/fix_longtable.py
statsmodels/regression/quantile_regression.py
statsmodels/sandbox/examples/example_pca.py
statsmodels/tools/print_version.py
tools/export_notebooks_to_python.py
tools/generate_formula_api.py

index 1147c695a2a97bac84267673beff03fafdd80a2c..31958df5c9e62a9941c48a4084684068ebc6fa37 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import sys
 import os
 
index 5060253c3eb96908af9c809186e213263705e9bb..7b9c5e500541157a1a8f23bb7a1f22e1da8851e8 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 '''
 Quantile regression model
index 2d32c25f3b663b184daeb33d0e7f3040630a4837..695121806f35b36c82c323d18b882cabf31bf2ff 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import numpy as np
 from statsmodels.sandbox.pca import Pca
index bd2d4224d398b427d381ac36518b594aabbbe080..5465225d9b249465d469ecc69190001c55926e92 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from functools import reduce
 import sys
 from os.path import dirname
index 145ccff16394dd786b4563cb2910c826e81d6ad3..2ee49cbddc5d8f7d50f34c52a97a949efb668097 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import argparse
 import glob
 import logging
@@ -134,6 +134,8 @@ def main():
                     continue
                 elif block.startswith("# In[ ]:"):
                     continue
+                if block == "#!/usr/bin/env python":
+                    block = "#!/usr/bin/env python3"
                 if block.startswith("#"):
                     # Wrap comments from Markdown
                     block = textwrap.fill(block, width=74)
index 8cc08c3f5ed0dffbf62724227b17f098240910d9..9277e4712ad59505a8a2ac816a2d0b706393ed00 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """
 This will generate an API file for formula in dir/statsmodels/formula/api.py