diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 19970e5e..ec1fec10 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -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 }} @@ -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' @@ -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 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 706ac0e1..6c9a49b9 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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' @@ -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 }} diff --git a/utool/Printable.py b/utool/Printable.py index a2a2a572..9b1b860a 100755 --- a/utool/Printable.py +++ b/utool/Printable.py @@ -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' diff --git a/utool/util_arg.py b/utool/util_arg.py index e74dc080..218b1c85 100755 --- a/utool/util_arg.py +++ b/utool/util_arg.py @@ -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 diff --git a/utool/util_dict.py b/utool/util_dict.py index 2072aa56..68ee1c82 100755 --- a/utool/util_dict.py +++ b/utool/util_dict.py @@ -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( diff --git a/utool/util_grabdata.py b/utool/util_grabdata.py index 41b2e98a..bdbcb583 100755 --- a/utool/util_grabdata.py +++ b/utool/util_grabdata.py @@ -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', } diff --git a/utool/util_hash.py b/utool/util_hash.py index 2d81643e..57136ea5 100755 --- a/utool/util_hash.py +++ b/utool/util_hash.py @@ -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('__'): diff --git a/utool/util_list.py b/utool/util_list.py index bdbefa0f..08bbc24e 100755 --- a/utool/util_list.py +++ b/utool/util_list.py @@ -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