Closed ydc-0 closed 8 months ago
Feel free to send a PR
@balamurugana Do you prefer to add urllib3>2.0
to install_requires
or make minio compatible with urllib 1.x
?
@balamurugana Do you prefer to add
urllib3>2.0
toinstall_requires
or make minio compatible withurllib 1.x
?
@ydc-0 urllib3>2.0
to install_requires
7.2.0 was still working without issues and just now our pipelines are breaking due to these urllib3 errors. I don't understand why this breaking change was introduced with a patch version in https://github.com/minio/minio-py/releases/tag/7.2.1
If I'm not missing something then just adding urllib3>=2.0
to install_requires
will not change the fact that this is a breaking change, which is why I would suggest that the changes in 7.2.1 are reverted and instead released with a proper major version increase
What is the error you are getting?
We're having this issue as well. I'd really suggest that we add support for urllib 1 and 2 instead of forcing the v2 version just because of typing..
I'll try to find the time to submit a PR for this.
I investigated a little further: The only issue is the import of BaseHTTPResponse
which minio
uses for typing.
This class was added in urllib3
v2 and does not exist in v1. IMO we have multiple options to resolve this:
urllib3>=2
as dependency in install_requires
(as mentioned here) - this would force all applications using minio in combination with urllib3 v1 to downgrade to version 7.2.0
just because of typing.try / catch
to import HTTPResponse
instead of BaseHTTPResponse
if the app uses version 1 of urllib3. This would work, but we'd tell the typing system that HTTPResponse
is the same as BaseHTTPResponse
which is simply not true.HTTPResponse
and use that in our typing.What do you think is the way to go @balamurugana @mwagnurr @ydc-0 ?
@anehx I suggest to use urllib3>=2
i.e. no change. urllib3 v1
is in maintenance mode and it won't get any new feature. Users of urllib3 v1
and don't want to upgrade to urllib3 v2
could use minio-py v7.2.0
@anehx In fact, I'm still using minio==7.2.0
in my project, because there are other packages that require urllib3<2
.
BTW, pip install minio urllib3<2
will still install minio==7.2.1, must add minio!=7.2.1
or minio<=7.2.0
to requirements.txt
when using urllib3<2
✗ pip install minio urllib3<2
Uninstalling minio-7.2.2:
Successfully uninstalled minio-7.2.2
Successfully installed minio-7.2.1 urllib3-1.26.18 # do not work
✗ pip install minio!=7.2.1 urllib3\<2
Successfully installed minio-7.2.0
✗ pip install --upgrade minio urllib3\>2
Successfully installed minio-7.2.2 urllib3-2.1.0
@balamurugana Is it possible to avoid pip install minio==7.2.1
by default when there are urllib3<2
? May yank
the version 7.2.1? https://peps.python.org/pep-0592/
If pip install minio urllib3<2
could install minio==7.2.0
, it would help others to not have a hard limit of minio.
Issue
minio 7.2.1 can not work with urllib3 1.x, but
urllib3>2.0
is not ininstall_requires
.Since urllib3 2.0 is less than one year, There are still some other packages that do not support urllib3 2.x. It would be better if minio is still compatible with urllib3 1.x.
https://github.com/urllib3/urllib3/blob/main/CHANGES.rst#200-2023-04-26
https://github.com/minio/minio-py/pull/1367/files
To reproduce
Failure Logs