Closed simonbowly closed 9 months ago
I think we should just put out a postfix release that pins gurobipy to 9.5.*. Users investigating what is going on will end up automatically at the project description, or come here to GH, to see the information.
Unfortunately, this doesn't work. If we push a postfix release for 1.0.1 which pins to 9.5.x, pip will just ignore it and choose from the gurobipy-stubs versions compatible with the installed gurobipy version. i.e. users of gurobipy 11 will get gurobipy-stubs 1.0.1 if they blindly install it (since 2.0.0 and 1.0.1.post0 will be incompatible with v11) and they won't get any warning.
So in addition to the postfix, we need to yank all wheels currently on pypi except 2.0.0. This will fail the install for anything other than an explicit gurobipy-stubs==1.0.1
requirement.
Postfix can be built from the v10 branch
Alright, thanks for investigating, it looks like we have a plan.
All seems to be behaving as expected (see below) so I'll close this issue.
> python --version
Python 3.9.18
> python -m pip install gurobipy-stubs gurobipy==9.5.*
Successfully installed gurobipy-9.5.2 gurobipy-stubs-1.0.1.post0
> python -m pip install gurobipy-stubs gurobipy==10.0.3
Successfully installed gurobipy-10.0.3 gurobipy-stubs-2.0.0
> python -m pip install gurobipy-stubs gurobipy==11.0.*
ERROR: Cannot install gurobipy-stubs==1.0.1.post0, gurobipy-stubs==2.0.0 and gurobipy==11.0.* because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested gurobipy==11.0.*
gurobipy-stubs 2.0.0 depends on gurobipy==10.*
The user requested gurobipy==11.0.*
gurobipy-stubs 1.0.1.post0 depends on gurobipy==9.5.*
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Not sure what the usual practice is here. Installing the stubs will overwrite the type hints included with future gurobipy installs so we should try to prevent installing the stubs or at least warn the user.
gurobipy dependency version of the current packages on PyPI:
gurobipy-stubs 1.0.x
depends ongurobipy>=9.5.0
(we may want to post-fix these versions? or publish a 1.0.2 and yank the others so the user at least gets a loud warning)gurobipy-stubs 2.0.0
depends ongurobipy==10.*
(nothing to do for this one, and no need to update setup.py on the master branch)