diff --git a/.github/workflows/omero_plugin.yml b/.github/workflows/omero_plugin.yml index f90e1ea..c698d83 100644 --- a/.github/workflows/omero_plugin.yml +++ b/.github/workflows/omero_plugin.yml @@ -23,7 +23,7 @@ jobs: env: STAGE: cli steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout omero-test-infra uses: actions/checkout@master with: diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 50f2c32..31c7524 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -7,8 +7,10 @@ jobs: name: Publish to PyPI runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.9' - name: Build a binary wheel and a source tarball run: | python -mpip install wheel diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a5f8ea..cdff46a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,26 +7,26 @@ repos: - id: seed-isort-config - repo: https://github.com/PyCQA/isort - rev: 5.11.5 + rev: 5.13.2 hooks: - id: isort args: ["--profile", "black"] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.12.1 hooks: - id: black args: [--target-version=py36] - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v3.15.0 hooks: - id: pyupgrade args: - --py36-plus - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.5.0 hooks: - id: trailing-whitespace exclude: .bumpversion.cfg @@ -45,7 +45,7 @@ repos: - --autofix - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 6.1.0 hooks: - id: flake8 additional_dependencies: [ @@ -63,14 +63,14 @@ repos: ] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.931 + rev: v1.8.0 hooks: - id: mypy # This is for checking tests/* (everything else has a stricter check # below), but since there's no include it's run on everything - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.931 + rev: v1.8.0 hooks: - id: mypy args: [ @@ -80,7 +80,7 @@ repos: exclude: tests/ - repo: https://github.com/adrienverge/yamllint.git - rev: v1.26.3 + rev: v1.33.0 hooks: - id: yamllint # args: [--config-data=relaxed] diff --git a/setup.py b/setup.py index 3a4cca6..d996496 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ def get_long_description() -> str: ], author="The Open Microscopy Team", author_email="", - python_requires=">=3.6", + python_requires=">=3.8", install_requires=["omero-py>=5.6.0"], zip_safe=True, keywords=["OMERO.CLI", "plugin"], diff --git a/src/omero_demo_cleanup/library.py b/src/omero_demo_cleanup/library.py index 996a854..c8d7661 100755 --- a/src/omero_demo_cleanup/library.py +++ b/src/omero_demo_cleanup/library.py @@ -36,6 +36,8 @@ LegalGraphTargetsResponse, ) from omero.gateway import BlitzGateway +from omero.model import Experimenter +from omero.plugins import hql # type: ignore[attr-defined] # noqa from omero.rtypes import rlong, unwrap from omero.sys import ParametersI @@ -154,7 +156,7 @@ def get_delete_classes(conn: BlitzGateway) -> List[str]: params, ) delete_classes.append(delete_class) - except omero.QueryException: + except omero.QueryException: # type: ignore[attr-defined] # TODO: Suppress console warning output. pass return delete_classes @@ -181,14 +183,13 @@ def delete_data(conn: BlitzGateway, user_id: int, dry_run: bool = True) -> None: submit(conn, delete, Delete2Response) -def exp_to_str(exp): +def exp_to_str(exp: Experimenter) -> str: # "user-3" (#6) Charles Darwin full_name = f"{unwrap(exp.firstName)} {unwrap(exp.lastName)}" return f'"{exp.omeName.val}" (#{exp.id.val}) {full_name}' def users_by_id_or_username(conn: BlitzGateway, ignore_users: str) -> List[int]: - if not ignore_users: return [] exclude = [] @@ -361,7 +362,7 @@ def perform_delete( def main() -> None: - with omero.cli.cli_login() as cli: + with omero.cli.cli_login() as cli: # type: ignore[attr-defined] conn = omero.gateway.BlitzGateway(client_obj=cli.get_client()) conn.SERVICE_OPTS.setOmeroGroup("-1") try: