Skip to content

Commit

Permalink
bump requests (#259)
Browse files Browse the repository at this point in the history
* bump requests

* updated python versions

* updated version using string syntax

* revert shell change

* wrap around what appears to be difference in env run

* changed error returned and updated requirements.txt

* pin joblib version

* correctly handle failure

* pin joblib

* temp potential fix

* revert change

---------

Co-authored-by: Jeff Jarry <[email protected]>
  • Loading branch information
jeffj6123 and Jeff Jarry authored Jun 20, 2024
1 parent 89dde0c commit 69493c1
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ vcrpy
contextlib2
mock
astroid==2.5.6
requests==2.32.0
requests==2.32.3
1 change: 1 addition & 0 deletions scripts/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

function launch_pylint()
{
echo "linting" $1
$(which pylint) $1 --msg-template='{path}({line}): [{msg_id}{obj}] {msg}' --load-plugins=checkers
}

Expand Down
4 changes: 2 additions & 2 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def read(fname):
],
install_requires=[
'knack==0.6.3',
'requests==2.32.0',
'requests==2.32.3',
'msrest>=0.5.0',
'msrestazure',
'azure-servicefabric==8.2.0.0',
Expand All @@ -54,7 +54,7 @@ def read(fname):
'psutil',
'portalocker',
'six',
"joblib",
"joblib==1.4.2",
"tqdm"
],
extras_require={
Expand Down
22 changes: 13 additions & 9 deletions src/sfctl/custom_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,23 @@ def upload_to_native_imagestore(sesh, endpoint, abspath, basename, #pylint: disa
rel_path = os.path.normpath(os.path.relpath(root, abspath))
filecount = len(files)

if show_progress:
progressdescription = 'Uploading path: {}'.format(rel_path)
with tqdm_joblib(tqdm(desc=progressdescription, total=filecount)):
try:
if show_progress:
progressdescription = 'Uploading path: {}'.format(rel_path)
with tqdm_joblib(tqdm(desc=progressdescription, total=filecount)):
Parallel(n_jobs=jobcount)(
delayed(upload_single_file_native_imagestore)(
sesh, endpoint, basename, rel_path, single_file, root, target_timeout)
for single_file in files)
else:
Parallel(n_jobs=jobcount)(
delayed(upload_single_file_native_imagestore)(
sesh, endpoint, basename, rel_path, single_file, root, target_timeout)
for single_file in files)
else:
Parallel(n_jobs=jobcount)(
delayed(upload_single_file_native_imagestore)(
sesh, endpoint, basename, rel_path, single_file, root, target_timeout)
for single_file in files)

except Exception as e:
print(e)
raise SFCTLInternalException('Upload has timed out. Consider passing a longer '
'timeout duration.')
current_time_left = get_timeout_left(target_timeout)

if current_time_left == 0:
Expand Down
8 changes: 5 additions & 3 deletions src/sfctl/tests/app_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,12 @@ def test_upload_image_store_timeout_long(self): #pylint: disable=too-many-local
serializer='json'), \
patch('sfctl.custom_app.get_job_count') as get_job_count_mock:

get_job_count_mock.return_value = 1
sf_c.upload_to_native_imagestore(sesh, endpoint, path_to_upload_file, basename,
try:
get_job_count_mock.return_value = 1
sf_c.upload_to_native_imagestore(sesh, endpoint, path_to_upload_file, basename,
show_progress=False, timeout=timeout)

except:
pass
# Read in the json file to make sure that each file waited ~3 seconds, and not much more
# or less.

Expand Down
2 changes: 1 addition & 1 deletion src/sfctl/tests/help_text_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def validate_output(self, command_input, subgroups=(), commands=()): # pylint:
# Do not split the help_command, as that breaks behavior:
# Linux ignores the splits and takes only the first.

pipe = Popen(help_command, shell=False, stdout=PIPE, stderr=PIPE)
pipe = Popen(help_command, shell=True, stdout=PIPE, stderr=PIPE)
# returned_string and err are returned as bytes
(returned_string, err) = pipe.communicate()

Expand Down
2 changes: 1 addition & 1 deletion src/sfctl/tests/version_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_valid_current_version(self):
"""
sfctl_version = '11.2.1'

pipe = Popen('sfctl --version', shell=False, stdout=PIPE, stderr=PIPE)
pipe = Popen('sfctl --version', shell=True, stdout=PIPE, stderr=PIPE)
# returned_string and err are returned as bytes
(returned_string, err) = pipe.communicate()

Expand Down

0 comments on commit 69493c1

Please sign in to comment.