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

fix ci/install.ps1 and other ci configs for Windows #1345

Open
wants to merge 5 commits into
base: atspi
Choose a base branch
from

Conversation

junkmd
Copy link
Contributor

@junkmd junkmd commented Sep 29, 2023

From the AppVeyor CI results in a previous PR, I noticed that in environments with Python 3.9 and later, Test-Path $env:PYTHON in ci/install.ps1 returns False, and it falls back to Python 3.4.

As a result, even in cases where UIA_SUPPORT=YES, comtypes is not actually installed, and the functionality of backend='uia' is not being tested.

I'm experimenting with various solutions to fix this.

trial and error commits

make tests runnable for each Python versions

I tried removing the fallback conditional, and while it worked on Python 3.8 and earlier, but it failed on Python 3.9 and later.

  • (Is C:\\Python3x\Scripts\pip.exe truly missing from the env?)

68204d2
77e9f3d
6ec3cc9
a493bec
c99a277
c1dfaa5
0a1c669
1077bd9
2b2b7a8
83a69a6
5f9e123
1af2a72
663b23b
d529000
f37d82e
47d4f4b
115b38d
c13950f
0a7b9ac
1e7383f
5d4e4d8
30d3d68
6572f11
a2aef52
91d32fc
03a404d
66eda19
97bd990
70e864a

I welcome other maintainers to contribute to resolving this issue.

Thank you.

@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

Merging #1345 (99b8c9f) into atspi (bf7f789) will decrease coverage by 0.02%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##            atspi    #1345      +/-   ##
==========================================
- Coverage   94.15%   94.13%   -0.02%     
==========================================
  Files          60       60              
  Lines       23036    23036              
==========================================
- Hits        21689    21686       -3     
- Misses       1347     1350       +3     

@junkmd
Copy link
Contributor Author

junkmd commented Oct 3, 2023

I've made several commits for trial and error, and I've been investigating various aspects.

What I've found is that the default Build worker image (when image: is not specified) doesn't support the newer versions of Python.

https://www.appveyor.com/docs/windows-images-software/#python

On the other hand, when specifying a newer Build worker image, we encounter issues like failing to install packages specified in dev-requirements.txt, or even when the installation succeeds, some tests fail.

It seems like we'll need to use appropriate workarounds for each Python version.

Any opinions would be appreciated.

@junkmd
Copy link
Contributor Author

junkmd commented Oct 7, 2023

By specifying APPVEYOR_BUILD_WORKER_IMAGE separately in appveyor.yml, the tests have been successful in environments with Python 3.8 and below.
https://www.appveyor.com/docs/build-environment/#using-multiple-images-for-the-same-build

However, issues arise in environments that support newer Python versions like Visual Studio 2019 and Visual Studio 2022. Installation of Pillow fails in Python 3.9, and PyQt5 installation fails in Python 3.10 and Python 3.11.

Does anyone know of a workaround for this issue?

@junkmd
Copy link
Contributor Author

junkmd commented Oct 8, 2023

Python 3.10 and Python 3.11 were successfully installed with the latest version of PyQt5 and by using nose2 instead of nose. (nose has been in maintenance mode for a while, and it became unusable with Python 3.10 due to the removal of collections.Callable.)

For Python 3.9, it will probably install successfully if we can specify the appropriate version of Pillow.

However, I'm not very familiar with workarounds for installing Pillow or with the command-line optional arguments for nose and nose2. I haven't been able to handle this properly.

If anyone knows more about this, please advise.

@junkmd junkmd changed the title fix ci/install.ps1 fix ci/install.ps1 and other ci configs for Windows Oct 8, 2023
@junkmd junkmd marked this pull request as ready for review October 8, 2023 13:08
@junkmd
Copy link
Contributor Author

junkmd commented Nov 4, 2023

At 70ee60b, pywinauto.unittests.test_application.DesktopUiaWindowSpecificationTests.test_folder_list was failing.

However, at 99b8c9f, adding a command to show file extensions in File Explorer in runTestsuite.ps1, test_folder_list is no longer failing.

It appears that the different default behaviors of the GUI, depending on the image specified in AppVeyor, might be the reason for the test failures.

@junkmd
Copy link
Contributor Author

junkmd commented Nov 4, 2023

Are we using nose instead of Python's built-in unittest command in our CI because we want to exclude testall.py? As previously mentioned, nose doesn't work with all Python versions supported by pywinauto, and we need to switch to nose2.

If we move testall.py to a different directory, we might be able to use Python's built-in unittest command (or a combination of coverage and unittest).

What is the reason for continuing to use nose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant