Closed tvatter closed 4 years ago
OK, so this behavior of sysconfig is a bit weird. The print of 7.4.0
only appears the first time that get_config_var
is called... It seems at first like this is an issue with get_config_var
, but maybe it should be taken into account no?
So, a way to prevent the functions from output undesirables things would be:
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
"from distutils import sysconfig as s;import sys;import struct;
save_stdout = sys.stdout
sys.stdout = open('trash', 'w')
values = ['.'.join(str(v) for v in sys.version_info),
sys.prefix,
s.get_python_inc(plat_specific=True),
s.get_python_lib(plat_specific=True),
s.get_config_var('EXT_SUFFIX'),
hasattr(sys, 'gettotalrefcount')+0,
struct.calcsize('@P'),
s.get_config_var('LDVERSION') or s.get_config_var('VERSION'),
s.get_config_var('LIBDIR') or '',
s.get_config_var('MULTIARCH') or ''];
sys.stdout = save_stdout
print(';'.join([str(item) for item in values]))
"
Additionally, the ';'.join([str(item) for item in values])
also converts to the list format and removes the need for:
string(REGEX REPLACE ";" "\\\\;" _PYTHON_VALUES ${_PYTHON_VALUES})
string(REGEX REPLACE "\n" ";" _PYTHON_VALUES ${_PYTHON_VALUES})
Hi,
I know that this question/issue might be hard to figure out, and I'm not sure that it's even an issue with this cmake_example, but I'm kind of desperate and I thought that maybe I was missing something.
I used this repo as a skeleton for my package pyvinecopulib and everything worked well if I use a "vanilla" conda environment.
In other words, if I just install miniconda and use the base environment, do a
git clone --recursive
and then apip install
, it works.However, I have another conda environment with the following config:
which can be replicated using the following explicit spec file on linux:
Using this new conda environment, I get:
I tried to understand what was going on by adding
message(STATUS "PYTHON_VALUES = \n ${_PYTHON_VALUES}")
at line 94, and I get:So the culprit appears to be:
In the base environment, we obviously get:
... any idea what I could/should do?