Skip to content

Commit 689a3d1

Browse files
committed
Merge branch 'develop' into main
2 parents 1d8cf40 + 5b84ce7 commit 689a3d1

File tree

8 files changed

+33
-6
lines changed

8 files changed

+33
-6
lines changed

CHANGES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Change log for CommonPy
22
=======================
33

4+
Version 1.3.0
5+
-------------
6+
7+
* Fixed issue #2: httpx Timeout needs a default value.
8+
* Bump the required version of [httpx](https://www.python-httpx.org) to 0.16.
9+
* Changed name `filter_by_extension(...)` to `filtered_by_extension(...)` to follow the style of other functions that return values.
10+
* Made trivial changes to the Makefile
11+
12+
413
Version 1.2.0
514
-------------
615

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The `file_utils` module provides a number of miscellaneous simple functions for
9292
| `copy_file(src, dst)` | Copies file from `src` to `dst` |
9393
| `open_file(file)` | Opens the `file` by calling the equivalent of "open" on this system |
9494
| `open_url(url)` | Opens the `url` in the user's default web browser |
95-
| `filter_by_extensions(list, endings)` | |
95+
| `filtered_by_extensions(list, endings)` | |
9696
| `files_in_directory(dir, ext, recursive)` | |
9797

9898

commonpy/file_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def alt_extension(filepath, ext):
105105
return path.splitext(filepath)[0] + '.' + ext
106106

107107

108-
def filter_by_extensions(item_list, endings):
108+
def filtered_by_extensions(item_list, endings):
109109
if not item_list:
110110
return []
111111
if not endings:

commonpy/interrupt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def interrupted():
112112

113113

114114
def raise_for_interrupts():
115-
'''Check whether an interrupt occurred; if so, raise UserCancelled.'''
115+
'''Check whether an interrupt occurred; if so, raise an exception.'''
116116
if interrupted():
117117
if __debug__: log(f'raising {__exception}')
118118
raise __exception

commonpy/network_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def addurl(text):
114114
return f'{text} for {url}'
115115

116116
if client is None:
117-
timeout = httpx.Timeout(connect = 15, read = 15, write = 15)
117+
timeout = httpx.Timeout(15, connect = 15, read = 15, write = 15)
118118
client = httpx.Client(timeout = timeout, http2 = True, verify = False)
119119

120120
failures = 0

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PyYAML >= 5.3.1
22
boltons >= 20.2.1
33
dateparser >= 1.0.0
44
h2 >= 3.2.0
5-
httpx >= 0.14.2
5+
httpx >= 0.16.1
66
humanize >= 3.0.0
77
pytest >= 6.1.2
88
python_dateutil >= 2.8.1

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[metadata]
1010
name = commonpy
11-
version = 1.2.0
11+
version = 1.3.0
1212
description = Assortment of Python helper functions and utility classes
1313
author = Michael Hucka
1414
author_email = mhucka@caltech.edu

tests/test_network_utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
import pytest
3+
import sys
4+
from time import time
5+
6+
try:
7+
thisdir = os.path.dirname(os.path.abspath(__file__))
8+
sys.path.append(os.path.join(thisdir, '..'))
9+
except:
10+
sys.path.append('..')
11+
12+
from commonpy.network_utils import *
13+
14+
15+
def test_net():
16+
(response, error) = net('get', 'https://www.google.com')
17+
assert error == None
18+
assert response.status_code == 200

0 commit comments

Comments
 (0)