quantumlib/qsim

`flynt` breaks release pipeline

Closed this issue · 3 comments

This line in setup.py generates a SyntaxError: invalid syntax in the release pipeline:

qsim/setup.py

Line 49 in 6c226ec

cmake_args += [f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{cfg.upper()}={extdir}"]

This was automatically formatted from the following by flynt:

qsim/setup.py

Lines 49 to 51 in 4912145

cmake_args += [
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)
]

It's unclear why this breaks the release, although it may be a backwards-compatibility issue.

Confirmed: f-strings are not supported before Python 3.6, and the release script was using Python 3.5.

Since we use f-strings elsewhere in the Python layer and Cirq already requires Python 3.6 or later, my preferred solution to this is to bump the Python requirement forward,

It turns out that the Kokoro machines that drive our release pipeline only have Python 3.5. Unless I can find a workaround to use Python 3.6 on those machines, we'll need to disable flynt in setup.py.

The v0.9.5 release provides a workaround by disabling flynt on setup.py. In the long term, we'll want to migrate our release pipeline over to Github Actions and re-enable flynt.