Skip to content

Commit b136d67

Browse files
committed
Add python 2 to Ubuntu build matrix.
1 parent 6a9c341 commit b136d67

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

.github/get-py-env.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python
22
#
33
# Determine info about the Python install and write shell code to stdout, to
44
# set env variables. This will set the variables PY_LDFLAGS, PY_CFLAGS and
@@ -41,7 +41,7 @@ def find_python_h():
4141
python3-config but not the sysconfig info (after moving the
4242
install).
4343
"""
44-
c_flags = extract_flags(['python3-config', '--cflags'], '-I')
44+
c_flags = extract_flags(['python-config', '--cflags'], '-I')
4545
for part in c_flags.split():
4646
m = re.search(r'-I(\S+)', part)
4747
if not m:
@@ -53,12 +53,12 @@ def find_python_h():
5353

5454

5555
def main():
56-
ld_flags = extract_flags(['python3-config', '--ldflags'], '-L')
57-
c_flags = extract_flags(['python3-config', '--cflags'], '-I')
56+
ld_flags = extract_flags(['python-config', '--ldflags'], '-L')
57+
c_flags = extract_flags(['python-config', '--cflags'], '-I')
5858
include_path = find_python_h()
59-
print(f'PY_LDFLAGS="{ld_flags}"')
60-
print(f'PY_CFLAGS="{c_flags}"')
61-
print(f'PY_INC_PATH="{include_path}"')
59+
print('PY_LDFLAGS="{}"'.format(ld_flags))
60+
print('PY_CFLAGS="{}"'.format(c_flags))
61+
print('PY_INC_PATH="{}"'.format(include_path))
6262

6363

6464
if __name__ == '__main__':

.github/run-faber.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ set -eu
44

55
echo "cxx version: $CXX $($CXX --version)"
66
echo "cxx std: $CXX_STD"
7-
echo "python3 path: $(which python3)"
8-
echo "python3 version: $(python3 --version)"
7+
echo "python path: $(which python)"
8+
echo "python version: $(python --version)"
99

1010
if ! which faber > /dev/null; then
1111
echo "Installing faber..."
12-
python3 -m pip install --upgrade pip
13-
python3 -m pip install -U faber
12+
python -m pip install --upgrade pip
13+
python -m pip install -U faber
1414
fi
1515
echo "faber version: $(faber -v)"
1616

1717
# find and set PY_LDFLAGS and PY_INC_PATH
18-
eval $(python3 .github/get-py-env.py)
18+
eval $(python .github/get-py-env.py)
1919

2020
echo "PY_INC_PATH=$PY_INC_PATH"
2121
echo "PY_LDFLAGS=$PY_LDFLAGS"
2222

23-
case $(python3-config --abiflags) in
23+
case $(python-config --abiflags) in
2424
*t*)
2525
# When running with free-threaded, we always want to disable the GIL
2626
# even for extensions without the mod_gil_not_used() flag
@@ -29,10 +29,10 @@ case $(python3-config --abiflags) in
2929
esac
3030

3131
# this could be set by LD_LIBRARY_PATH but faber overrides it
32-
prefix=$(python3-config --prefix)
32+
prefix=$(python-config --prefix)
3333
echo "${prefix}/lib" > /etc/ld.so.conf.d/boost-ci.conf && ldconfig
3434

35-
sed -e "s/\$PYTHON/python3/g" .ci/faber > $HOME/.faber
35+
sed -e "s/\$PYTHON/python/g" .ci/faber > $HOME/.faber
3636

3737
faber \
3838
--with-boost-include=${BOOST_PY_DEPS} \

.github/workflows/test-ubuntu.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: ['3.14']
16+
python-version: ['2.7', '3.14']
1717
cxx: [g++, clang++]
1818
std: [c++11, c++14, c++17]
1919
include:
@@ -34,6 +34,7 @@ jobs:
3434
steps:
3535
- uses: actions/checkout@v5
3636
- name: setup python
37+
if: "${{ matrix.python-version != '2.7' }}"
3738
uses: actions/setup-python@v5
3839
with:
3940
python-version: ${{ matrix.python-version }}

0 commit comments

Comments
 (0)