Skip to content

bug(python): sample noxfile installs the library from source when INSTALL_LIBRARY_FROM_SOURCE is set to "false" #988

@tmatsuo

Description

@tmatsuo

It is done by the following code:

INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False))

The problem is Python always convert non-empty string to True. I think we need to use something like distutils.util.strtobool.

$ python
Python 3.8.2 (default, Apr 21 2020, 21:57:57) 
[GCC 9.2.1 20191109] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> bool("false")
True
>>> bool("False")
True
>>> import distutils.util
>>> bool(distutils.util.strtobool("false"))
False
>>> bool(distutils.util.strtobool("False"))
False
>>>

Metadata

Metadata

Labels

lang: pythonIssues specific to Python.priority: p2Moderately-important priority. Fix may not be included in next release.samplesIssues that are directly related to samples.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions