Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# This allows the setuptools_scm library to discover the tag version from git
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -31,17 +31,18 @@ jobs:
pip install build
python -m build --wheel --outdir dist/ .

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: ./dist/*.whl

overwrite: true

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
Expand All @@ -52,17 +53,18 @@ jobs:
pip install build
python -m build --sdist --outdir dist/ .

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: ./dist/*.tar.gz

overwrite: true

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
name: Lint code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
Expand All @@ -37,14 +37,14 @@ jobs:
max-parallel: 2
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest] #, macos-latest]
python-version: [3.8, 3.9]

steps:
# Checkout and env setup
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion utool/Printable.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def printableVal(val, type_bit=True, justlength=False):
else:
_valstr = '[ ' + (', \n '.join([str(v) for v in val])) + ' ]'
# ??? isinstance(val, AbstractPrintable):
elif hasattr(val, 'get_printable') and type(val) is not type:
elif hasattr(val, 'get_printable') and not isinstance(val, type):
_valstr = val.get_printable(type_bit=type_bit)
elif isinstance(val, dict):
_valstr = '{\n'
Expand Down
2 changes: 1 addition & 1 deletion utool/util_arg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ def get_cmdline_varargs(argv=None):

# Do I like these more?
# varargs = get_varargs
argval = get_argval
argval_ = get_argval
argflag = get_argflag


Expand Down
2 changes: 1 addition & 1 deletion utool/util_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def is_dicteq(dict1_, dict2_, almosteq_ok=True, verbose_err=True):
try:
for (key1, val1), (key2, val2) in zip(dict1_.items(), dict2_.items()):
assert key1 == key2, 'key mismatch'
assert type(val1) == type(val2), 'vals are not same type'
assert isinstance(val1, type(val2)), 'vals are not same type'
if HAVE_NUMPY and np.iterable(val1):
if almosteq_ok and ut.is_float(val1):
assert np.all(
Expand Down
28 changes: 14 additions & 14 deletions utool/util_grabdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,20 +613,20 @@ def split_archive_ext(path):


TESTIMG_URL_DICT = {
'grace.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/rgQyu7r.jpg',
'jeff.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/l00rECD.png',
'ada2.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/zHOpTCb.jpg',
'ada.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/iXNf4Me.jpg',
'lena.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/JGrqMnV.png', # depricate lena
'astro.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/KXhKM72.png', # Use instead of lena
'carl.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/flTHWFD.jpg',
'easy1.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/Qqd0VNq.png',
'easy2.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/BDP8MIu.png',
'easy3.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/zBcm5mS.png',
'hard3.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/ST91yBf.png',
'zebra.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/58hbGcd.png',
'star.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/d2FHuIU.png',
'patsy.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/C1lNRfT.jpg',
'grace.jpg': 'https://wildbookiarepository.azureedge.net/testimgs/rgQyu7r.jpg',
'jeff.png': 'https://wildbookiarepository.azureedge.net/testimgs/l00rECD.png',
'ada2.jpg': 'https://wildbookiarepository.azureedge.net/testimgs/zHOpTCb.jpg',
'ada.jpg': 'https://wildbookiarepository.azureedge.net/testimgs/iXNf4Me.jpg',
'lena.png': 'https://wildbookiarepository.azureedge.net/testimgs/JGrqMnV.png', # depricate lena
'astro.png': 'https://wildbookiarepository.azureedge.net/testimgs/KXhKM72.png', # Use instead of lena
'carl.jpg': 'https://wildbookiarepository.azureedge.net/testimgs/flTHWFD.jpg',
'easy1.png': 'https://wildbookiarepository.azureedge.net/testimgs/Qqd0VNq.png',
'easy2.png': 'https://wildbookiarepository.azureedge.net/testimgs/BDP8MIu.png',
'easy3.png': 'https://wildbookiarepository.azureedge.net/testimgs/zBcm5mS.png',
'hard3.png': 'https://wildbookiarepository.azureedge.net/testimgs/ST91yBf.png',
'zebra.png': 'https://wildbookiarepository.azureedge.net/testimgs/58hbGcd.png',
'star.png': 'https://wildbookiarepository.azureedge.net/testimgs/d2FHuIU.png',
'patsy.jpg': 'https://wildbookiarepository.azureedge.net/testimgs/C1lNRfT.jpg',
}


Expand Down
2 changes: 1 addition & 1 deletion utool/util_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def make_hash(o):
References:
http://stackoverflow.com/questions/5884066/hashing-a-python-dictionary
"""
if type(o) == DictProxyType:
if isinstance(o, DictProxyType):
o2 = {}
for k, v in o.items():
if not k.startswith('__'):
Expand Down
2 changes: 1 addition & 1 deletion utool/util_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,7 @@ def type_profile2(sequence, TypedSequence=None):
isinstance(sequence, np.ndarray) and sequence.dtype != object
):
# Scalar / ndarray type
if type(sequence) == 'numpy.ndarray':
if isinstance(sequence, np.ndarray):
subtype_list = '[%s]' % (sequence.dtype,)
else:
subtype_list = None
Expand Down
Loading