Skip to content

Commit

Permalink
Merge pull request #1239 from ggainey/3_70_compat
Browse files Browse the repository at this point in the history
Bump pulpcore upper bounds to 3.85

(cherry picked from commit b5fc626)
  • Loading branch information
hstct authored and patchback[bot] committed Feb 24, 2025
1 parent 25a5d88 commit fbb3e38
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 22 deletions.
6 changes: 3 additions & 3 deletions pulp_deb/tests/functional/api/test_crud_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_create_package(apt_package_api, deb_package_factory):
# Create a package and verify its attributes
attrs = {
"relative_path": DEB_PACKAGE_RELPATH,
"file": get_local_package_absolute_path(DEB_PACKAGE_RELPATH),
"file": str(get_local_package_absolute_path(DEB_PACKAGE_RELPATH)),
}
package = deb_package_factory(**attrs)
assert package.relative_path == DEB_PACKAGE_RELPATH
Expand Down Expand Up @@ -47,7 +47,7 @@ def test_same_sha256_same_relative_path_no_repo(
):
"""Test whether uploading the same package works and that it stays unique."""
attrs = {
"file": get_local_package_absolute_path(DEB_PACKAGE_RELPATH),
"file": str(get_local_package_absolute_path(DEB_PACKAGE_RELPATH)),
"relative_path": DEB_PACKAGE_RELPATH,
}

Expand All @@ -74,7 +74,7 @@ def test_structured_package_upload(
):
"""Test whether uploading a structured package works and creates the correct paths."""
attrs = {
"file": get_local_package_absolute_path(DEB_PACKAGE_RELPATH),
"file": str(get_local_package_absolute_path(DEB_PACKAGE_RELPATH)),
"relative_path": DEB_PACKAGE_RELPATH,
"distribution": str(uuid4()),
"component": str(uuid4()),
Expand Down
7 changes: 3 additions & 4 deletions pulp_deb/tests/functional/api/test_crud_remotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def test_create_remote_repository_with_same_name(
@pytest.mark.parallel
def test_create_remote_repository_without_url(deb_remote_custom_data_factory):
"""Verify whether it is possible to create a remote without an URL."""
pytest.skip("pydantic catches this before we get to the server")
data = gen_deb_remote_verbose()

with pytest.raises(ApiException) as exc:
deb_remote_custom_data_factory(data)

Expand Down Expand Up @@ -154,10 +154,9 @@ def test_remote_download_policies(
# Create a snapshot of the remote for later reference
remote_snapshot = deb_get_remote_by_href(remote.pulp_href)

# Attempt to change the remote policy to an invalid string
with pytest.raises(ApiException) as exc:
# Attempt to change the remote policy to an invalid string (now caught by pydantic)
with pytest.raises(Exception):
deb_patch_remote(remote, {"policy": str(uuid4())})
assert exc.value.status == 400

# Verify that the remote policy remains unchanged
remote = deb_get_remote_by_href(remote.pulp_href)
Expand Down
18 changes: 11 additions & 7 deletions pulp_deb/tests/functional/api/test_duplicate_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_upload_package_and_duplicate(

# Upload a test package to a component in the repo.
package_upload_params = {
"file": get_local_package_absolute_path(DEB_PACKAGE_RELPATH),
"file": str(get_local_package_absolute_path(DEB_PACKAGE_RELPATH)),
"relative_path": DEB_PACKAGE_RELPATH,
"distribution": str(uuid4()),
"component": str(uuid4()),
Expand All @@ -70,8 +70,10 @@ def test_upload_package_and_duplicate(
)

# Upload a duplicate of the first package into the repo.
package_upload_params["file"] = get_local_package_absolute_path(
package_name=DEB_PACKAGE_RELPATH, relative_path=DUPLICATE_PACKAGE_DIR
package_upload_params["file"] = str(
get_local_package_absolute_path(
package_name=DEB_PACKAGE_RELPATH, relative_path=DUPLICATE_PACKAGE_DIR
)
)
deb_package_factory(**package_upload_params)

Expand Down Expand Up @@ -110,13 +112,15 @@ def test_add_duplicates_to_repo(
"""
# Upload two duplicate packages.
package_upload_params = {
"file": get_local_package_absolute_path(
package_name=DEB_PACKAGE_RELPATH, relative_path=DUPLICATE_PACKAGE_DIR
"file": str(
get_local_package_absolute_path(
package_name=DEB_PACKAGE_RELPATH, relative_path=DUPLICATE_PACKAGE_DIR
)
),
"relative_path": DEB_PACKAGE_RELPATH,
}
href1 = deb_package_factory(**package_upload_params).pulp_href
package_upload_params["file"] = get_local_package_absolute_path(DEB_PACKAGE_RELPATH)
package_upload_params["file"] = str(get_local_package_absolute_path(DEB_PACKAGE_RELPATH))
href2 = deb_package_factory(**package_upload_params).pulp_href

# Generate an empty test repo.
Expand All @@ -129,5 +133,5 @@ def test_add_duplicates_to_repo(

# Assert the error message.
assert "Cannot create repository version since there are newly added packages with" in str(
exception.value
exception.value.task.error["description"]
)
2 changes: 1 addition & 1 deletion pulp_deb/tests/functional/api/test_rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_rbac_upload(deb_repository_factory, deb_package_factory, gen_user):
user_denied = gen_user()
repo = deb_repository_factory()
package_attrs = {
"file": get_local_package_absolute_path(DEB_PACKAGE_RELPATH),
"file": str(get_local_package_absolute_path(DEB_PACKAGE_RELPATH)),
"relative_path": DEB_PACKAGE_RELPATH,
"repository": repo.pulp_href,
}
Expand Down
8 changes: 4 additions & 4 deletions pulp_deb/tests/functional/api/test_source_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def artifact_factory(
def _artifact_factory(relative_name, relative_path=SOURCE_PACKAGE_PATH):
try:
file = get_local_package_absolute_path(relative_name, relative_path=relative_path)
artifact = gen_object_with_cleanup(pulpcore_bindings.ArtifactsApi, file)
artifact = gen_object_with_cleanup(pulpcore_bindings.ArtifactsApi, str(file))
except ApiException as exc:
if artifact := _find_existing_artifact(pulpcore_bindings.ArtifactsApi, exc):
return artifact
Expand Down Expand Up @@ -84,13 +84,13 @@ def test_upload_source_package_and_publish(
source_package = source_packages.results[0]
else:
# source package doesn't exist
artifact_factory(SOURCE_PACKAGE_SOURCE)
artifact = artifact_factory(SOURCE_PACKAGE_RELPATH)
artifact_factory(str(SOURCE_PACKAGE_SOURCE))
artifact = artifact_factory(str(SOURCE_PACKAGE_RELPATH))

# Upload a test source package
package_upload_params = {
"artifact": artifact.pulp_href,
"relative_path": SOURCE_PACKAGE_RELPATH,
"relative_path": str(SOURCE_PACKAGE_RELPATH),
}
source_package = deb_source_package_factory(**package_upload_params)
deb_modify_repository(repository, {"add_content_units": [source_package.pulp_href]})
Expand Down
2 changes: 1 addition & 1 deletion pulp_deb/tests/functional/api/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_sync_invalid_cases(
with pytest.raises(PulpTaskError) as exc:
deb_sync_repository(remote, repo)
for exp in expected:
assert exp in str(exc.value)
assert exp in str(exc.value.task.error["description"])


@pytest.mark.parallel
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ requires-python = ">=3.9"
dependencies = [
# All things django and asyncio are deliberately left to pulpcore
# Example transitive requirements: asgiref, asyncio, aiohttp
"pulpcore>=3.49.0,<3.70",
"pulpcore>=3.49.0,<3.85",
"python-debian>=0.1.44,<0.2.0",
"python-gnupg>=0.5,<0.6",
"jsonschema>=4.6,<5.0",
Expand Down Expand Up @@ -165,4 +165,4 @@ replace = "version = \"{new_version}\""

filename = "./pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""
replace = "version = \"{new_version}\""

0 comments on commit fbb3e38

Please sign in to comment.