CharPyLS icon indicating copy to clipboard operation
CharPyLS copied to clipboard

MAINT allow to set environment variable at install

Open glemaitre opened this issue 7 years ago • 5 comments

This is not practical to hard code flag_MSCV since that one can need to install the package from pip without editing the setup.py. In this regard, I did a small hack to read an environment variable to turn ON/OFF the flag for the install.

glemaitre avatar Feb 16 '18 21:02 glemaitre

@glemaitre I updated the setup.py file to check the system platform type before setting any specific compiler or linker options. This is prefered over setting/reading environment variables.

Who8MyLunch avatar Feb 18 '18 16:02 Who8MyLunch

                                                                                  ‎What would happen if you use mingwin in windows? The flag seems to be for MSCV so I was unsure that checking the os would work under Windows with another compiler than MSCV

glemaitre avatar Feb 18 '18 17:02 glemaitre

@glemaitre yikes I cannot believe how difficult this became! I don't know the 'best' way to set these options that also allows for MINGW, and I just spent half my morning unsuccessfully trying to figure it out. For now I've removed the platform-specific compiler arguments.

Who8MyLunch avatar Feb 18 '18 17:02 Who8MyLunch

                                                                                  I thought to pass --install-option="args"‎ when installing with pip. However it is not so much documented and I wanted to have a quick fix for a CI. I don't know what you think about passing option at install?

glemaitre avatar Feb 18 '18 19:02 glemaitre

Passing options at pip CLI would be perfect!

Who8MyLunch avatar Feb 19 '18 04:02 Who8MyLunch