Skip to content

Commit

Permalink
Merge pull request #861 from VWS-Python/strict-mypy-plugin
Browse files Browse the repository at this point in the history
Use new mypy plugin for strict kwargs
  • Loading branch information
adamtheturtle authored Dec 24, 2024
2 parents 2e3dac0 + f838c13 commit 1360331
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# This method of getting the release from the version goes hand in hand with
# the ``post-release`` versioning scheme chosen in the ``setuptools-scm``
# configuration.
release = version.split(".post")[0]
release = version.split(sep=".post")[0]

project_metadata = importlib.metadata.metadata(distribution_name=project)
requires_python = project_metadata["Requires-Python"]
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ optional-dependencies.dev = [
"furo==2024.8.6",
"interrogate==1.7.0",
"mypy[faster-cache]==1.14.0",
"mypy-strict-kwargs==2024.12.24",
"pre-commit==4.0.1",
"pylint==3.3.3",
"pyproject-fmt==2.5.0",
Expand Down Expand Up @@ -305,6 +306,9 @@ strict = true
files = [ "." ]
exclude = [ "build" ]
follow_untyped_imports = true
plugins = [
"mypy_strict_kwargs",
]

[tool.pyright]
enableTypeIgnoreComments = false
Expand Down
20 changes: 10 additions & 10 deletions src/vws_web_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def wait_for_logged_in(driver: WebDriver) -> None: # pragma: no cover
"""
ten_second_wait = WebDriverWait(driver=driver, timeout=10)
ten_second_wait.until(
expected_conditions.presence_of_element_located(
method=expected_conditions.presence_of_element_located(
locator=(By.CLASS_NAME, "userNameInHeaderSpan"),
),
)
Expand Down Expand Up @@ -145,7 +145,7 @@ def create_database(
)

ten_second_wait.until(
expected_conditions.element_to_be_clickable(
method=expected_conditions.element_to_be_clickable(
mark=(By.ID, add_database_button_id),
),
)
Expand Down Expand Up @@ -206,14 +206,14 @@ def get_database_details(
ten_second_wait = WebDriverWait(driver=driver, timeout=10)

ten_second_wait.until(
expected_conditions.presence_of_element_located(
method=expected_conditions.presence_of_element_located(
locator=(By.ID, "table_search"),
),
)

search_input_element = driver.find_element(by=By.ID, value="table_search")
original_first_database_cell_element = ten_second_wait.until(
expected_conditions.element_to_be_clickable(
method=expected_conditions.element_to_be_clickable(
mark=(By.ID, "table_row_0_project_name"),
),
)
Expand All @@ -222,22 +222,22 @@ def get_database_details(
# The search has competed when the original first database cell element is
# "stale".
ten_second_wait.until(
expected_conditions.staleness_of(
method=expected_conditions.staleness_of(
element=original_first_database_cell_element
),
)

# We assume that searching for the database name will return one result.
database_cell_element = ten_second_wait.until(
expected_conditions.element_to_be_clickable(
method=expected_conditions.element_to_be_clickable(
mark=(By.ID, "table_row_0_project_name"),
),
)

database_cell_element.click()

access_keys_tab_item = ten_second_wait.until(
expected_conditions.presence_of_element_located(
method=expected_conditions.presence_of_element_located(
locator=(By.LINK_TEXT, "Database Access Keys"),
),
)
Expand Down Expand Up @@ -363,6 +363,6 @@ def show_database_details(
click.echo(message=yaml.dump(data=details), nl=False)


vws_web_tools_group.add_command(create_vws_database)
vws_web_tools_group.add_command(create_vws_license)
vws_web_tools_group.add_command(show_database_details)
vws_web_tools_group.add_command(cmd=create_vws_database)
vws_web_tools_group.add_command(cmd=create_vws_license)
vws_web_tools_group.add_command(cmd=show_database_details)
4 changes: 2 additions & 2 deletions tests/test_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@


@pytest.mark.parametrize(
"command",
_COMMANDS,
argnames="command",
argvalues=_COMMANDS,
ids=[str(object=cmd) for cmd in _COMMANDS],
)
def test_vws_command_help(
Expand Down

0 comments on commit 1360331

Please sign in to comment.