Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cwa/close-191-use-ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Oct 25, 2023
2 parents 18a8bae + 3f0821e commit ee89b67
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion ci_cd/tasks/update_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ def update_deps(
)
py_version = match.group("version")

already_handled_packages = set()
# Skip package if it is this project (this can happen for inter-relative extra
# dependencies)
already_handled_packages = {pyproject["project"]["name"]}

updated_packages = {}
dependencies = pyproject.get("project", {}).get("dependencies", [])
for optional_deps in (
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ testing = [
"pytest-cov ~=4.1",
]
dev = [
"ci-cd[docs,testing]",
"pre-commit ~=2.21",
"ci-cd[docs,testing]",
]

[project.urls]
Expand Down
11 changes: 9 additions & 2 deletions tests/tasks/test_update_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_update_deps(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:
pyproject_file.write_text(
data=f"""
[project]
name = "test"
requires-python = "~=3.7"
dependencies = [
Expand All @@ -50,10 +51,9 @@ def test_update_deps(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:
]
dev = [
"mike >={original_dependencies['mike']},<3",
"pytest ~={original_dependencies['pytest']}",
"pytest-cov ~={original_dependencies['pytest-cov']}",
"pre-commit ~={original_dependencies['pre-commit']}",
"pylint ~={original_dependencies['pylint']}",
"test[testing]",
]
# List from https://peps.python.org/pep-0508/#complete-grammar
Expand Down Expand Up @@ -160,6 +160,12 @@ def test_update_deps(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:
"'name5 [fred,bar]' is pinned to a URL and will be skipped"
in caplog.text
)
elif "test[testing]" in line:
assert line == "test[testing]"
assert (
"'test[testing]' is not version restricted and will be skipped."
not in caplog.text
)
else:
pytest.fail(f"Unknown package in line: {line}")

Expand Down Expand Up @@ -1130,6 +1136,7 @@ def test_ignore_rules_logic(
pyproject_file.write_text(
data=f"""
[project]
name = "test"
requires-python = "~=3.7"
dependencies = [
Expand Down

0 comments on commit ee89b67

Please sign in to comment.