Avoid problems with GitHub Windows runners #400
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a workaround for a problem with GitHub Windows runners used for tests. The problem is the following:
The file extensions for the python extensions compiled from C are accessible from the python "
sysconfig
" module. This module is imported in 2 locations:at.c
, where the C extensions are dynamically loaded,load/utils.py
, where the presence of the extension is checked when loading a Matlab lattice description.Unfortunately, the
sysconfig
module returns a wrong value on GitHub for python 3.6 and 3.7 on Windows:.pyd
instead of.cp36-win_amd64.pyd
. Even worse, the file extension for python 3.7 changed twice without notice in the last few weeks, resulting in failing tests.Up to now the solution was to introduce a Windows-specific workaround in the 2 files mentioned above, by importing the deprecated
distutils.sysconfig
module instead ofsysconfig
. But this workaround has to be modified each time the GitHub configuration changes…The proposed solution here is:
sysconfig
is always used,Consequences: