Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/pulp-glue/+sync_capability.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added a precheck for the `sync` capability to repositories. All repository types should adequately announce it.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ line-length = 100

[tool.ruff.lint]
# This section is managed by the cookiecutter templates.
extend-select = ["I", "INT"]
extend-select = ["I", "ICN", "INT", "T10"]

[tool.ruff.lint.flake8-import-conventions.aliases]
# This section is managed by the cookiecutter templates.
typing = "t"

[tool.mypy]
# This section is managed by the cookiecutter templates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,17 @@ extend-exclude = ["cookiecutter/bootstrap", "cookiecutter/ci", "cookiecutter/doc

[tool.ruff.lint]
# This section is managed by the cookiecutter templates.
extend-select = ["I", "INT"]
extend-select = ["I", "ICN", "INT", "T10"]

[tool.ruff.lint.isort]
# This section is managed by the cookiecutter templates.
sections = { second-party = ["pulp_glue"] }
section-order = ["future", "standard-library", "third-party", "second-party", "first-party", "local-folder"]

[tool.ruff.lint.flake8-import-conventions.aliases]
# This section is managed by the cookiecutter templates.
typing = "t"

[tool.mypy]
# This section is managed by the cookiecutter templates.
strict = true
Expand Down
6 changes: 5 additions & 1 deletion pulp-glue/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@ line-length = 100

[tool.ruff.lint]
# This section is managed by the cookiecutter templates.
extend-select = ["I", "INT"]
extend-select = ["I", "ICN", "INT", "T10"]

[tool.ruff.lint.flake8-import-conventions.aliases]
# This section is managed by the cookiecutter templates.
typing = "t"

2 changes: 2 additions & 0 deletions pulp-glue/src/pulp_glue/common/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,8 @@ def sync(self, body: EntityDefinition | None = None) -> t.Any:
Returns:
Record of the sync task.
"""
if not self.capable("sync"):
warnings.warn(DeprecationWarning("Repository has not declared 'sync' capability."))
return self.call("sync", parameters={self.HREF: self.pulp_href}, body=body or {})

def modify(
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,17 @@ extend-exclude = ["cookiecutter/bootstrap", "cookiecutter/ci", "cookiecutter/doc

[tool.ruff.lint]
# This section is managed by the cookiecutter templates.
extend-select = ["I", "INT"]
extend-select = ["I", "ICN", "INT", "T10"]

[tool.ruff.lint.isort]
# This section is managed by the cookiecutter templates.
sections = { second-party = ["pulp_glue"] }
section-order = ["future", "standard-library", "third-party", "second-party", "first-party", "local-folder"]

[tool.ruff.lint.flake8-import-conventions.aliases]
# This section is managed by the cookiecutter templates.
typing = "t"


[tool.pytest]
testpaths = ["tests", "pulp_glue/tests"]
Expand Down
Loading