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

[WIP] Fix Windows tests #342

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Conversation

egpbos
Copy link
Member

@egpbos egpbos commented Jun 8, 2023

Trying to fix #326, don't merge, I'm just using this PR to run CI, because I don't have Windows locally.

@egpbos egpbos requested a review from sverhoeven June 8, 2023 16:55
@egpbos egpbos force-pushed the fix_326_windows_tests_pip_install_user branch from 7616a0f to d5e299d Compare June 9, 2023 10:48
@egpbos
Copy link
Member Author

egpbos commented Jun 9, 2023

Ready for review @sverhoeven, @bvreede

@egpbos egpbos requested a review from bvreede June 9, 2023 10:49
Everywhere: on CI, in tests, in docs. Also, we replace bare pip/pip3 and pytest calls with python -m pip and python -m pytest respectively, to make sure we always use the same python executable everywhere.

This fixes #326 (failing Windows tests on CI), because the `python3` executable causes issues (it is not properly copied into the venv directory by venv, which is a CPython bug, see python/cpython#87915), while the python executable does work; see e.g. here https://stackoverflow.com/questions/61669873/python-venv-env-fails-winerror-2-the-system-cannot-find-the-file-specified. `python` should be the same executable under the hood as `python3`, if the setup-python action works as expected, at least.
It also allows us to remove the IS_WINDOWS_CI special case.

Failed attempts at fixing #326 included:
- Setting the shells (assuming something went wrong with environment
  variables)
- Using full paths for both the executable and the venv directory in the
  template test suite.
@egpbos egpbos force-pushed the fix_326_windows_tests_pip_install_user branch from d5e299d to 9686cf7 Compare June 9, 2023 10:52
@egpbos
Copy link
Member Author

egpbos commented Jun 9, 2023

(one more force push, I accidentally rebased a previous commit)

Copy link
Contributor

@bvreede bvreede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works!
Very happy for this to be merged.

@egpbos egpbos merged commit 38c16d9 into main Jul 10, 2023
@sjvrijn sjvrijn deleted the fix_326_windows_tests_pip_install_user branch May 3, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests are failing on Windows with Python > 3.6
2 participants