-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip should be updated when the virtualenv is first created #11074
Comments
Does that just replace the one in the virtualenv or hte system one? If the former, +1. |
It updates the one in the virtualenv, as long as the virtualenv is active. |
I'm interested in working on this. I think I've already got a working solution (on my system it upgrades pip from 7.1.2 to 8.1.2), but I want to verify what happens on a system that's old enough to fail installing mach before I submit a PR. |
I spoke too soon. I tried on my mac and the upgrade command failed. The only difference I noticed between systems was on my mac |
I'm going to assume the system pip issue was just a problem with configuration on my machine. I forced it to use the correct path and was able to reproduce the failure with old pip and fix it with an upgrade. On that note though, would changing |
@campaul I'm not sure whether mach should be doing that, but it doesn't seem right to me. mach should always use the virtualenv and never use the system Python, especially considering it's installing packages, which it won't be able to do if it uses the system Python unless ran with root privileges, which will in turn break your system Python. As long as the virtualenv is active, it should be fine to use |
The system pip issue I was having is actually #8968. I'll follow up in that ticket and make a PR that just upgrades pip for now. |
No one's working on this right now. But, there's an open PR (#14253). |
…r=frewsxcv Commit that fixes the issue #11074 by upgrading pip whenever virtuale… <!-- Please describe your changes on the following line: --> I have kind of resolved the issue #11074 by adding bool variable which is set to `True` if we had created the virtualenv and `False` otherwise. Then it updates pip by executing `pip install --upgrade pip` in the same way as packages are updated. I am a little bit worried that I have almost duplicated the installation routine from the `for` loop but I am not sure whether I should add a function or not. I think it is the best way of doing this because it does not need any Internet access for regular work (only for the first time you execute mach) as @larsbergstrom worried [here](#11149). It also doesn't add any extra latency on a no-op build. I have checked the solution inside a docker container based on debian wheezy. Before the patch `./mach` failed to run because it wasn't able to install some packages. Now it runs successfully. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11074 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it changes only mach_bootstrap.py <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14452) <!-- Reviewable:end -->
Judging by several reports on IRC, people who have old versions of pip on their systems (OS X ships with 1.4.1, apparently) can't install mach 0.6. To solve this, we could simply update pip whenever we create the virtualenv.
The text was updated successfully, but these errors were encountered: