Skip to content

Conversation

@Czaki
Copy link
Contributor

@Czaki Czaki commented Sep 4, 2019

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.

@YannickJadoul
Copy link
Member

@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 cibuildwheels philosophy to install the wheels inside of the cibuildwheel script (right, @joerick?).
Any idea how feasible that would be, @Czaki ?

@Czaki Czaki force-pushed the windows_on_travis branch from 1205328 to e0b6881 Compare September 9, 2019 13:24
@Czaki
Copy link
Contributor Author

Czaki commented Sep 9, 2019

I change code to install python inside cibuildwheel. Initial python still need to be installed manually.

@YannickJadoul
Copy link
Member

@Czaki Great, thank you very much! I'll have a close-up review later :-)

@Czaki
Copy link
Contributor Author

Czaki commented Sep 9, 2019

@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.

@joerick
Copy link
Contributor

joerick commented Sep 9, 2019

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 choco? That would be preferable to me, since it reduces our dependency on other tools, which can be slow to publish packages, and they add potential security holes to the build process.

@Czaki
Copy link
Contributor Author

Czaki commented Sep 9, 2019

I have bad experience with direct calling msiexec because it blocks all process without any error message, but I will try this in this week.

@Czaki
Copy link
Contributor Author

Czaki commented Sep 10, 2019

@joerick What do you think about usage of nuget for installing? It is recommended in python docs as method of installng python for CI.
https://docs.python.org/3/using/windows.html#windows-nuget

.travis.yml Outdated
include:
# Linux Python 2
- sudo: required
if: branch=master
Copy link
Member

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
Copy link
Member

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" ?

@@ -1 +1 @@
__version__ = '0.11.1'
__version__ = '0.11.2'
Copy link
Member

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 :-)

bace_choco_args = "--no-progress --force -y --allowmultiple --override".split()
instal_args = "'/quiet InstallAllUsers=1 TargetDir={}'"

class PythonConfiguration(object):
Copy link
Member

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.

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.
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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!

env.update(add_env)

subprocess.check_call(
p = subprocess.check_call(
Copy link
Member

Choose a reason for hiding this comment

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

What are these changes?

Copy link
Contributor Author

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.

Copy link
Member

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!

@YannickJadoul
Copy link
Member

@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'"
Copy link
Member

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.

Copy link
Contributor Author

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

@Czaki
Copy link
Contributor Author

Czaki commented Sep 12, 2019

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.
Switch to nuget allows to simplify yaml file also.

I have cleaned a code.

@Czaki
Copy link
Contributor Author

Czaki commented Sep 12, 2019

Error on Travis is connected with macos and problem with resolving dns name? Could You restart this test?

@joerick
Copy link
Contributor

joerick commented Sep 21, 2019

@Czaki is this ready for review? Let me know when and I'll take a proper look at the code :)

@Czaki
Copy link
Contributor Author

Czaki commented Sep 22, 2019

Generally yes.
In second PR there shown this link https://github.com/pybind/python_example that show some method which will allow for enable support of python 2.7 on travis. But I think that this change can be target of next PR with enhance of c++ modern standards support.

Copy link
Contributor

@joerick joerick left a 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.

# identifiers
expected_wheels = utils.expected_wheels('spam', '0.1.0')
build_identifiers = utils.cibuildwheel_get_build_identifiers(project_dir)
print("bb", build_identifiers)
Copy link
Member

Choose a reason for hiding this comment

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

What's this, still?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry.

Copy link
Member

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 ;-)



Copy link
Member

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?

@joerick joerick merged commit 80974e5 into pypa:master Oct 23, 2019
@Czaki Czaki deleted the windows_on_travis branch October 24, 2019 07:00
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.

3 participants