Skip to content

Commit

Permalink
Merge pull request #13 from jburel/test_infra
Browse files Browse the repository at this point in the history
Test infra
  • Loading branch information
jburel authored Jan 30, 2024
2 parents 71509b0 + 9d7a392 commit e161ab6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/omero_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: [
Expand All @@ -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: [
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
9 changes: 5 additions & 4 deletions src/omero_demo_cleanup/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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 = []
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e161ab6

Please sign in to comment.