Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tmatsuo opened this issue Mar 16, 2021 · 0 comments · Fixed by #1176
Assignees
Labels
lang: python Issues specific to Python. priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@tmatsuo
Copy link
Contributor

tmatsuo commented Mar 16, 2021

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
>>>
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Mar 16, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Mar 17, 2021
@tmatsuo tmatsuo changed the title bug(python): sample noxfile always install the library from source bug(python): sample noxfile installs the library from source when INSTALL_LIBRARY_FROM_SOURCE is set to "false" Mar 17, 2021
@tmatsuo tmatsuo added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 18, 2021
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Mar 19, 2021
@chingor13 chingor13 added the lang: python Issues specific to Python. label Apr 14, 2021
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jul 14, 2021
@parthea parthea self-assigned this Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: python Issues specific to Python. priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants