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

Avoid problems with GitHub Windows runners #400

Merged
merged 2 commits into from
Apr 25, 2022
Merged

Conversation

lfarv
Copy link
Contributor

@lfarv lfarv commented Apr 20, 2022

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 of sysconfig. But this workaround has to be modified each time the GitHub configuration changes…

The proposed solution here is:

  1. Remove all Windows-specific workarounds in the PyAT code. sysconfig is always used,
  2. disable the tests on Windows for python 3.6 (always fails up to now) and python 3.7 (succeeds or fails, it depends on GitHub good will).

Consequences:

  • cleaner code
  • the compatibility of PyAT with python 3.6 and 3.7 is still checked on Linux and MacOS
  • the problem on Windows looks specific to GitHub, and should not harm normal Windows users, though I cannot check,
  • the problem is restricted to really old python versions.

@lfarv lfarv added Python For python AT code bug fix labels Apr 20, 2022
@lfarv lfarv merged commit a9c03cc into master Apr 25, 2022
@lfarv lfarv deleted the windows_github_actions branch April 25, 2022 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Python For python AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants