-
Notifications
You must be signed in to change notification settings - Fork 294
Build Python wheels for windows on travis #160
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
Conversation
|
@Czaki Amazing, thanks! Looks pretty good to me, as well. I have one major suggestion: as far as I know, part of the idea is to abstract away the management of different versions of Python. So just like we download and install all the different pkg-files on macOS, it would be |
1205328 to
e0b6881
Compare
|
I change code to install python inside cibuildwheel. Initial python still need to be installed manually. |
|
@Czaki Great, thank you very much! I'll have a close-up review later :-) |
|
@YannickJadoul You can also look on https://github.com/Czaki/cibuildwheel/tree/windows_on_travis2 branch. There is try of better protection of collision with existing installation based on [https://www.python.org/dev/peps/pep-0514/](pep 514). Problem with python 3.4 is that there exist this version installation in windows image. But hidden on very strange path and windows installers do not allow to add second copy. In future this tools may upgrade python version and generate problems. I do not found pep 514 entries for python 3.4, but maybe this protection will be usefull? If yes then I will clean the code. Or maybe You know how find existing python installation on windows. |
|
This is heading in a good direction! Agree that installing within cibuildwheel is the right approach - the user shouldn't be concerned with that. I have lots of smaller comments on the diff as it is now, but before that, would it be easy/possible to install Python directly from downloads from python.org rather than using |
|
I have bad experience with direct calling |
|
@joerick What do you think about usage of nuget for installing? It is recommended in python docs as method of installng python for CI. |
.travis.yml
Outdated
| include: | ||
| # Linux Python 2 | ||
| - sudo: required | ||
| if: branch=master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not forget about this when merging :-)
README.md
Outdated
| | Travis CI | ✅ | ✅ | ✅* | | ||
| | AppVeyor | | | ✅ | | ||
| | CircleCI | ✅ | ✅ | | | ||
| > \* Travis provides windows machines but user need install python manually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typos to "Travis provides a Windows environment but Python needs to be installed manually" ?
cibuildwheel/__init__.py
Outdated
| @@ -1 +1 @@ | |||
| __version__ = '0.11.1' | |||
| __version__ = '0.11.2' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave this out, please. @joerick will update the version when he makes a new release :-)
cibuildwheel/windows.py
Outdated
| bace_choco_args = "--no-progress --force -y --allowmultiple --override".split() | ||
| instal_args = "'/quiet InstallAllUsers=1 TargetDir={}'" | ||
|
|
||
| class PythonConfiguration(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a though: could we keep this as a simple namedtuple, and format/create the full args when we need them.
We could even just make a simple function get_choco_args that takes the version and arch and returns all the arguments? Then we don't need to change the current PythonConfiguration.
cibuildwheel/windows.py
Outdated
| if IS_RUNNING_ON_AZURE: | ||
| if IS_RUNNING_ON_AZURE or IS_RUNNING_ON_TRAVIS: | ||
| # Python 3.4 isn't supported on Azure. | ||
| # I meet problem with install python on travis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What problems are you getting, exactly? Do you have a link we can use for future reference? Also, please move this line down, to not split up "Python 3.4 isn't supported on Azure." and "See https://..." since these lines belong together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exact problem is that python installer do not allow to install two instances of same python version. One of pre-installed program has own instance of python 3.4 x64. But it is installed under strange path. I try to write part of code for discovery installation https://github.com/Czaki/cibuildwheel/commit/b0cefb63c75e17952a19dabe4ffe410b75af3254#diff-bf885b72fecfdf7485cab147f7957d5c but all info which i found in internet is connected with pep 514, but python 3.4 do not satisfy it.
should I describe it in comment inside code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I see. It's probably just fine to write a single line that this version clashes with an already installed version of Python 3.4 on Travis CI's Windows image. Thanks!
test/shared/utils.py
Outdated
| env.update(add_env) | ||
|
|
||
| subprocess.check_call( | ||
| p = subprocess.check_call( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove this. Artefact after debug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, don't worry. Sorry to be too quick about it!
|
@joerick @Czaki The current, very incomplete Travis CI docs for Windows seem to suggest using chocolatey: https://docs.travis-ci.com/user/reference/windows/ |
.travis.yml
Outdated
| - os: windows | ||
| language: shell | ||
| before_install: | ||
| - choco install python3 --version 3.5.4 --no-progress --force -y --allowmultiple --override --installargs "'/quiet InstallAllUsers=1 TargetDir=C:\Python35-x64'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for future reference, is there a reason we need all of these different arguments, here?
https://docs.travis-ci.com/user/languages/python/ seems to be suggesting to just choco install python (or maybe python3, I guess) and use the python executable afterwards.
I understand we need more flags/control for the different versions, but for the one that's just running cibuildwheel in the examples, it would be great to keep things simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--no-progress means not show progress of download. In other cases the 4MB limit of log on travis may run out.
-y accept all questions during installation.
-allowmultiple allow multiple versions of package. Not sure if need here. Needed with next installations
--override --installargs "'/quiet InstallAllUsers=1 TargetDir=C:\Python35-x64'" - set install directory
|
I found that python installing through nuget do not conflict with existing python installation. So I switch to use nuget (installed with choco). This protect code from part of fail on changes in windows image. I have cleaned a code. |
|
Error on Travis is connected with macos and problem with resolving dns name? Could You restart this test? |
|
@Czaki is this ready for review? Let me know when and I'll take a proper look at the code :) |
|
Generally yes. |
joerick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Czaki, this is getting there. I've got a few suggestions and comments of how to neaten it up before it's ready to merge.
Co-Authored-By: Joe Rickerby <[email protected]>
test/01_basic/cibuildwheel_test.py
Outdated
| # identifiers | ||
| expected_wheels = utils.expected_wheels('spam', '0.1.0') | ||
| build_identifiers = utils.cibuildwheel_get_build_identifiers(project_dir) | ||
| print("bb", build_identifiers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this, still?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. Very easily overlooked. I was just lucky to notice it ;-)
test/shared/utils.py
Outdated
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small spurious change left?
This changes allow to build parts of windows wheels on travis-ci.
Supported python version: 3.5+
For python 2.7 I do not found method to install VCForPython27.msi. Try of installation with msiexec stuck without any action https://travis-ci.com/Czaki/cibuildwheel/builds/125771121
Try of installation it from choco fail because bug in DotNet3.5 formula. https://travis-ci.com/Czaki/cibuildwheel/builds/125753492
For python 3.4 there is collision with python installed by some tool under strange path. And I do not know how to write script for search its path. The collision is only for 32 bits version, butt I decided to remove both.
on the end of yaml file I put the lines which fails. Maybe someone with better windows knowledge find a way to solve it.
If there will be decision to not fight for old releases then also is possible to use https://www.nuget.org/packages/python/ as python source (which is suggested in python docs). But it contains only python from version 3.5.