-
Couldn't load subscription status.
- Fork 3.2k
Fix integration tests on Windows #4769
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
|
Yayie! Thanks for working on this @benoit-pierre! ^>^
Can we have multiple jobs run concurrently? I don't know if it's possible but if it is, it'd be nice.
Which is why we kinda need these tests to be run on Windows. :P |
|
insert sad reaction here |
|
Yeah, many thanks for this. I'm not sure how easy it's going to be to review this, there's a lot of complexity in here. I'll try to go through it, but as a general comment I will say that the fact that the CI runs are succeeding is a reasonable indication that things look good overall. I agree with your decision to just run 2.7 and 3.6 x64. The intent here should be to catch Windows-specific issues, not completely re-test everything Travis already covers, so that should be sufficient. |
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 gave this a pass and it looks mostly good to me.
tests/functional/test_install.py
Outdated
|
|
||
| # Compute relative install path to FSPkg from scratch path. | ||
| full_rel_path = data.packages.join('FSPkg') - script.scratch_path | ||
| full_rel_url = ('file:' + full_rel_path + |
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.
nit: I would wrap it like:
full_rel_url = (
'file:' + full_rel_path + '#egg=FSPkg'
).replace(os.path.sep, '/')| rel_prefix_path = script.scratch / 'prefix' | ||
| install_path = ( | ||
| path / 'site-packages' / 'simple-1.0-py{0}.egg-info'.format(pyversion) | ||
| distutils.sysconfig.get_python_lib(prefix=rel_prefix_path) / |
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.
Not sure how good an idea it is to be depending on/using distutils here and in a few other places; is there some equivalent function in pip's codebase?
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.
We already use it in other places, and in pip's codebase. I don't see an equivalent function we could use.
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.
Thanks for looking! I now think my question was not exactly specific to this PR anyway.
| 'requiresupper' has install_requires = ['upper'] | ||
| """ | ||
| Upper = os.path.join(data.find_links, 'Upper-1.0.tar.gz') | ||
| Upper = '/'.join((data.find_links, 'Upper-1.0.tar.gz')) |
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.
Why not os.path.join?
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.
Because data.find_links is an URL.
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. Okay. XD
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.
Maybe better to use urljoin then, just to be explicit? I wouldn't want someone in future to "helpfully" switch back to os.path.join (although the Windows tests would now pick that up 😄)
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.
Except just replacing the example above with urljoin(data.find_links, 'Upper-1.0.tar.gz') does not work... Because:
>>> urljoin('/index/', 'package.tar.gz')
'/index/package.tar.gz'
>>> urljoin('/index', 'package.tar.gz
'/package.tar.gz'
Alternatively, use from posixpath import join as urljoin?
|
@benoit-pierre It would be awesome if you could split out the lsat 2 commits into 2 separate PRs. They're not really specific to Windows in any way but it'd be nice to handle them independently. |
|
@benoit-pierre Could you add a news file for this? :) IMO it should be a |
|
Honestly, it probably doesn't need to be mentioned in the change log at all. I don't think users will care that we started running integration tests on Windows (and "how much do users care about X" is sort of the standard to judge if something needs to be in the change log or not). |
|
Lol, well either way is fine :) I personally wouldn't have. |
|
Ha. My "think of an answer on the spur of the moment" approach has been exposed 😉. I actually like @dstufft's principle of "do users care" here, so I'll reverse myself from before and say I'm OK with not having a news item here. |
.travis/run.sh
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.
Why the change to use --develop here? I don't have a particular problem with it, just don't understand why it's needed (and whether that implies there's an implication of one of the other changes that I've missed).
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.
It's just faster, and we don't need to do a normal installation anymore (since we don't run unvendored tests).
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.
OK, cool, so not specifically related to the Windows changes. That's fine (and faster is always good ;-)).
|
Added a couple of minor points, but overall LGTM |
Then I am too. :) |
|
@pfmoore So, is this good to go? :3 |
Match the behavior of `urllib.request.pathname2url`: uppercase the drive letter.
- fix user's bin/scripts directory - support calling `pip` to update pip itself - force IO encoding to UTF-8 to prevent decoding errors - correctly handle the presence '&' characters in arguments to `run`
bbd7b17 to
a0a43c1
Compare
|
I moved the last 2 commits to their own PRs, as asked by @pradyunsg. |
|
Thank you! ^>^ Once the CI allows, I'll merge them. :) |
|
@pradyunsg Yep, I'm happy for this to be merged. |
|
Thanks @benoit-pierre for doing this - it's a huge improvement to our testing on Windows! |
|
Linking to #4751. |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The integration tests can now be run on Windows.
I added Python 3.6 jobs to AppVeyor, however, while I tested with all variants (x86/amd64, 2.7/3.3/3.4/3.5/3.6), this PR only enable the integration tests for the
Python27andPython36-x64jobs; as with only one job active at a time, enabling integration tests for all jobs will result in a ~3 hours long CI run...Fix one bug:
InstallRequirement.get_dist()would not correctly detect the distribution name (see b327c77).