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

Tests are failing on Windows with Python > 3.6 #326

Closed
bvreede opened this issue Nov 21, 2022 · 0 comments · Fixed by #342
Closed

Tests are failing on Windows with Python > 3.6 #326

bvreede opened this issue Nov 21, 2022 · 0 comments · Fixed by #342
Labels
template Related to the template itself, as opposed to the generated code

Comments

@bvreede
Copy link
Member

bvreede commented Nov 21, 2022

Current tests are throwing an error on Windows with Python 3.7 and higher. See e.g. this workflow run.

It's an assertion error with this line (57-58) in test_project.py

    pip_output = run([f'{bin_dir}pip3', 'install', '--editable', '.[dev]'], result.project)
    assert pip_output.returncode == 0

This is the error message:

ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'c:\\hostedtoolcache\\windows\\python\\3.7.9\\x64\\lib\\site-packages\\~arkupsafe\\_speedups.cp37-win_amd64.pyd'
Consider using the `--user` option or check the permissions.
@bvreede bvreede added the template Related to the template itself, as opposed to the generated code label Nov 21, 2022
egpbos added a commit that referenced this issue Jun 8, 2023
This may fix #326, because this would also fix the lack of permissions that causes the error message there to suggest using `--user`.
egpbos added a commit that referenced this issue Jun 9, 2023
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 added a commit that referenced this issue Jun 9, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template Related to the template itself, as opposed to the generated code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant