mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Various packaging requirements for idna
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
If you are planning to submit a pull request to requests with any changes in
|
||||
If you are planning to submit a pull request to requests with any changes in
|
||||
this library do not go any further. These are independent libraries which we
|
||||
vendor into requests. Any changes necessary to these libraries must be made in
|
||||
them and submitted as separate pull requests to those libraries.
|
||||
@@ -7,5 +7,7 @@ urllib3 pull requests go here: https://github.com/shazow/urllib3
|
||||
|
||||
chardet pull requests go here: https://github.com/chardet/chardet
|
||||
|
||||
idna pull requests go here: https://github.com/kjd/idna
|
||||
|
||||
See https://github.com/kennethreitz/requests/pull/1812#issuecomment-30854316
|
||||
for the reasoning behind this.
|
||||
|
||||
@@ -34,3 +34,9 @@ try:
|
||||
except ImportError:
|
||||
import chardet
|
||||
sys.modules['%s.chardet' % __name__] = chardet
|
||||
|
||||
try:
|
||||
from . import idna
|
||||
except ImportError:
|
||||
import idna
|
||||
sys.modules['%s.idna' % __name__] = idna
|
||||
|
||||
@@ -37,6 +37,7 @@ packages = [
|
||||
'requests',
|
||||
'requests.packages',
|
||||
'requests.packages.chardet',
|
||||
'requests.packages.idna',
|
||||
'requests.packages.urllib3',
|
||||
'requests.packages.urllib3.packages',
|
||||
'requests.packages.urllib3.contrib',
|
||||
|
||||
@@ -1884,6 +1884,7 @@ def test_urllib3_pool_connection_closed(httpbin):
|
||||
def test_vendor_aliases():
|
||||
from requests.packages import urllib3
|
||||
from requests.packages import chardet
|
||||
from requests.packages import idna
|
||||
|
||||
with pytest.raises(ImportError):
|
||||
from requests.packages import webbrowser
|
||||
|
||||
Reference in New Issue
Block a user