boostorg/boostdep

Make depinst compatible with python3

Closed this issue · 3 comments

Using Python3 (default on e.g. Windows GHA) depinst raises:

File "tools/boostdep/depinst/depinst.py", line 57
    print 'Cannot determine module for header', h
                                              ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Cannot determine module for header', h)?

I'd propose to make the tool at least Python3 compatible if not Python3 only given that Python2 is EOL already. However as current system python are often Python2 this might cause to much fallout.

An easy fix would be to use print('Cannot determine module for header ' + h) style which is equivalent in Python2 or python 3 or use the future module which allows print('Cannot determine module for header', h) syntax in Python2 (actually it works already but prints ('Cannot determine module for header', 'aa'))

See

from __future__ import print_function
and

boostdep/.travis.yml

Lines 126 to 139 in 9d58908

- os: linux
compiler: g++
env: PYTHON3=1
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- cp -r $TRAVIS_BUILD_DIR/* tools/boostdep
- ./bootstrap.sh
script:
- python3 tools/boostdep/depinst/depinst.py ../tools/boostdep
- ./b2 tools/boostdep/build
although this code path is probably not exercised there, which is why it was missed.

Actually it looks like you're using an old depinst, that line reads differently.

vprint( 0, 'Cannot determine module for header', h )

You are right, missed the update. Sorry for the noise