Skip to content
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

Add option to specify pip version on windows #250

Closed
mtreinish opened this issue Jan 22, 2020 · 7 comments
Closed

Add option to specify pip version on windows #250

mtreinish opened this issue Jan 22, 2020 · 7 comments

Comments

@mtreinish
Copy link
Contributor

As part of the initial setup for an environment python -m pip install --upgrade pip is run unconditionally on windows:

https://github.com/joerick/cibuildwheel/blob/master/cibuildwheel/windows.py#L144

However, sometimes it's necessary to install a specific or capped version of pip to workaround issues. This has come up recently because of the pip 20.0.0 and pip 20.0.1 releases which are causing issues trying to install some packages (and in my local case running pip install pip<20.0.0 as a CIBW_BEFORE_BUILD command). It would be nice to have an option to be able to specify a version so that we don't have to install pip multiple times.

@YannickJadoul
Copy link
Member

@mtreinish We've been discussing about e.g. CIBW_PIP_CONSTRAINTS (or something like that) to specify constraint files to all pip invocations, in #239. It seems like that might also help here; do you reckon this would be a good solution for your use case?

@mtreinish
Copy link
Contributor Author

@YannickJadoul yes I think adding support for a constraints file is more then sufficient for my use case. I've actually been trying to hack in a workaround using a constraints file via CIBW_ENVIRONMENT and setting PIP_CONSTRAINT to a constraints file that already existed in the repo. Haven't gotten it working quite yet, but having a native approach in cibuildwheel for this would be quite nice.

@YannickJadoul
Copy link
Member

YannickJadoul commented Jan 23, 2020

I've actually been trying to hack in a workaround using a constraints file via CIBW_ENVIRONMENT and setting PIP_CONSTRAINT to a constraints file that already existed in the repo.

Actually, I realized that something like that would be possible and wanted to try that out today; but, it's not as easy to do as it seems, then?

EDIT: I just tried PIP_CONSTRAINT locally (which seems to work?), and check that the variables from CIBW_ENVIRONMENT are set by cibuildwheel before installing pip (which seems to be the case). Any idea what was going wrong when you tried it?

@mtreinish
Copy link
Contributor Author

It's just a path thing for me, I'm just going up against finding the constraints file for the env variable via the cwd. I probably need to just use an absolute path and figure out exactly where on disk the ci system is cloning things.

@mtreinish
Copy link
Contributor Author

Actually I've resolved the file path issues and it's not quote working as I was hoping. Yes the constraints file is getting honored but it looks like it's causing issues as things try to upgrade:

The log is here:

https://dev.azure.com/qiskit-ci/qiskit-aer/_build/results?buildId=7383&view=logs&j=88076fea-ae17-5b87-3f51-0f9c840a5695&t=0929d076-b24b-5e0f-e240-ccd588fa2c57&l=137

I still think having a user facing straightforward way to do this would be better

@YannickJadoul
Copy link
Member

Huh, that is a weird error, indeed:

2020-01-23T20:48:42.8728538Z ERROR: To modify pip, please run the following command:
2020-01-23T20:48:42.8728954Z c:\cibw\python\python.3.5.4\tools\python.exe -m pip install --upgrade setuptools wheel

I don't see how that command would be "modifying pip", do you?
Anyway, I hope we won't have the same error when trying to implement CIBW_PIP_CONSTRAINT or so. But I agree that it would probably be a useful addition to cibuidwheel :-)

mtreinish added a commit to mtreinish/cibuildwheel that referenced this issue Jan 24, 2020
As part of the initial setup for an environment on windows:
'python -m pip install --upgrade pip' is run unconditionally. However,
there are situtations where a specific version of pip is needed
(normally to avoid issues introduced in new pip releases). This commit
adds a new config env variable flag, CIBW_PIP_VERSION_WINDOWS, which
takes a pip version in that will be used for this command. For example,
if CIBW_PIP_VERSION_WINDOWS=19.3.1 then the windows environment setup
will run 'python -m pip install --upgrade pip=19.3.1'.

Fixes pypa#250
@joerick
Copy link
Contributor

joerick commented Feb 28, 2020

Closed as a duplicate of #239

@joerick joerick closed this as completed Feb 28, 2020
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 a pull request may close this issue.

3 participants