Skip to content

Commit a7dca45

Browse files
authored
Merge pull request #320 from seleniumbase/remove-urllib3-requirement
Use requests instead of urllib3 for webdriver downloads
2 parents 9398bb0 + fd7e580 commit a7dca45

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ before_install:
1616
install:
1717
- "pip install --upgrade pip"
1818
- "pip install -r requirements.txt --upgrade"
19-
- "pip install mysqlclient==1.3.14"
19+
- "pip install mysqlclient==1.4.2"
2020
- "python setup.py develop"
2121
- "sudo rm -f /etc/boto.cfg"
2222
before_script:

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ ipdb
66
chardet
77
unittest2
88
selenium==3.141.0
9-
requests==2.21.0
109
urllib3==1.24.2
10+
requests>=2.21.0
1111
pytest>=4.4.1
1212
pytest-cov>=2.6.1
1313
pytest-forked>=1.0.2
@@ -18,9 +18,9 @@ pytest-xdist>=1.28.0
1818
pytest-ordering>=0.6
1919
parameterized>=0.7.0
2020
beautifulsoup4>=4.6.0
21-
colorama==0.4.1
21+
colorama>=0.4.1
2222
pyotp>=2.2.7
2323
boto>=2.49.0
24-
flake8==3.7.7
25-
PyVirtualDisplay==0.2.1
24+
flake8>=3.7.7
25+
PyVirtualDisplay>=0.2.1
2626
-e .

seleniumbase/console_scripts/sb_install.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
import os
1717
import platform
1818
import requests
19-
import urllib3 # Some systems don't have requests.packages.urllib3
2019
import shutil
2120
import sys
2221
import tarfile
2322
import zipfile
2423
from seleniumbase import drivers # webdriver storage folder for SeleniumBase
25-
urllib3.disable_warnings()
2624
DRIVER_DIR = os.path.dirname(os.path.realpath(drivers.__file__))
2725

2826

@@ -186,13 +184,11 @@ def main():
186184
file_path = downloads_folder + '/' + file_name
187185
if not os.path.exists(downloads_folder):
188186
os.mkdir(downloads_folder)
189-
local_file = open(file_path, 'wb')
190-
http = urllib3.PoolManager()
191-
remote_file = http.request('GET', download_url, preload_content=False)
187+
192188
print('\nDownloading %s from:\n%s ...' % (file_name, download_url))
193-
local_file.write(remote_file.read())
194-
local_file.close()
195-
remote_file.close()
189+
remote_file = requests.get(download_url)
190+
with open(file_path, 'wb') as file:
191+
file.write(remote_file.content)
196192
print('Download Complete!\n')
197193

198194
if file_name.endswith(".zip"):

setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.23.3',
20+
version='1.23.4',
2121
description='Reliable Browser Automation & Testing Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',
@@ -59,8 +59,8 @@
5959
'chardet',
6060
'unittest2',
6161
'selenium==3.141.0',
62-
'requests==2.21.0', # Changing this may effect "urllib3"
63-
'urllib3>=1.24.2,<1.25.0', # Keep this lib in sync with "requests"
62+
'urllib3==1.24.2',
63+
'requests>=2.21.0',
6464
'pytest>=4.4.1',
6565
'pytest-cov>=2.6.1',
6666
'pytest-forked>=1.0.2',
@@ -71,11 +71,11 @@
7171
'pytest-ordering>=0.6',
7272
'parameterized>=0.7.0',
7373
'beautifulsoup4>=4.6.0', # Keep at >=4.6.0 while using bs4
74-
'colorama==0.4.1',
74+
'colorama>=0.4.1',
7575
'pyotp>=2.2.7',
7676
'boto>=2.49.0',
77-
'flake8>=3.6.0,<3.8.0',
78-
'PyVirtualDisplay==0.2.1',
77+
'flake8>=3.7.7',
78+
'PyVirtualDisplay>=0.2.1',
7979
],
8080
packages=[
8181
'seleniumbase',

0 commit comments

Comments
 (0)