Restore "packages" namespace for backwards compatibility
shipped.
I'm afraid this doesn't resolve the problem with many libraries, such as the official Dropbox and Keen clients, which do
from requests.packages.urllib3.poolmanager import PoolManager
This results in the following error:
ModuleNotFoundError: No module named 'requests.packages.urllib3'; 'requests.packages' is not a package
I'm trying to find a solution for them too @raicheff. I'm open to suggestions.
Currently, code that was written to import against the requests.packages namespace previously will have to import code that rests at this module-level now.
For example:
from requests.packages.urllib3.poolmanager import PoolManager
Will need to be re-written to be:
from requests.packages import urllib3
urllib3.poolmanager.PoolManager
Or, even better:
from urllib3.poolmanager import PoolManager
If we really want backwards compatibility, we may have to stub out the whole library as an empty imported package. I'm willing to do that, if needed.
solution found!
https://github.com/kennethreitz/requests/commit/c952e9e4e07ebaf579aaf8924ff6f7c61710c8c8
@raicheff care to test against master and see if that solves the issue for you, for the next release?
@kennethreitz Yes, just tested it and it works!
\o/
will cut a release shortly
Thanks Kenneth, that's awesome!
This solution is ugly is hell, but I guess it will do the job for now. I would suggest you add a deprecation warning on import of these modules (similar to how Flask does it with the ext package), and remove the shimmed packages in the next major release.
I came up with a much better solution.
https://github.com/kennethreitz/requests/commit/28666e5d3ae04fede9a9078aba937b0ce6380adc
going to cut a release
shipped 2.16.2!
Tested – works!
With 2.16.2, coala's core tests are down to only one error, in an emulated read timeout test.
https://circleci.com/gh/jayvdb/coala/296
We still have a few other issues which have strangely popped up, and probably some version conflicts for chardet. Still investigating.
@jayvdb keep us up to date!
@kennethreitz , I haven't found the cause of https://github.com/coala/coala/issues/4282 (and it is 3am so I'm off) , but the workaround was simple : https://github.com/coala/coala/pull/4283
excellent @jayvdb!