Windows Docker Image & test pipeline
According to our discussion, I have created a test framework for PyTest, taking the scope of the topic a bit broader.
Under the directory .ci/windows you will find an environment that is used to create wheels for Windows, and that right away for several Python versions from 3.6 to 3.11. Furthermore, it is for both 32-bit and 64-bit systems. As a core element, the tool cibuildwheel is used, whose advantage lies in the fact that it can create multiple wheels without additional work. In addition, it also takes over the task of testing.
After each wheel is created, it is installed in a temporary virtual environment, where the tests are executed. Once all the tests are successfully completed, the wheels are uploaded to codebase using the twine package.
Regarding deployment, I would like to note that Codebase does not provide Windows Runner. Therefore, if possible, I suggest a simple solution: Just use a Windows PC that you already have access to. The setup is basically straightforward and goes as follows:
- Install Docker on the Windows PC. When doing this, it should not be run with the WSL backend, but with the Hyper-V backend. You can find more information about this at the following link: https://docs.docker.com/desktop/faqs/windowsfaqs/#how-do-i-switch-between-windows-and-linux-containers
- Create a GitLab Access Token. You can find instructions on how to do this here: https://codebase.helmholtz.cloud/help/user/packages/pypi_repository/index#authenticate-with-the-package-registry
- Clone the repo and navigate to the root directory.
- In this directory, there is a Docker Compose file. It uses the Dockerfile under .ci/windows to create a Windows image.
- Running the docker compose up command will start everything. Please note that the first build may take some time - so a coffee break might be convenient.
- Trigger this process each time you want to publish new windows wheels
Just give it a try and let me know if you need help