Skip to content

Commit a37d040

Browse files
authored
Merge pull request #692 from gerrod3/package-type-filter-fix
Fix package_types filter breaking others
2 parents 3c61037 + 1760d24 commit a37d040

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

CHANGES/691.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the `package_types` filter breaking other remote filters.

pulp_python/app/tasks/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def create_bandersnatch_config(remote):
8383
config["plugins"]["enabled"] += "prerelease_release\n"
8484
if remote.package_types:
8585
rrfm = "regex_release_file_metadata"
86-
config["plugins"]["enabled"] += rrfm
86+
config["plugins"]["enabled"] += f"{rrfm}\n"
8787
if not config.has_section(rrfm):
8888
config.add_section(rrfm)
8989
config[rrfm]["any:release_file.packagetype"] = "\n".join(remote.package_types)

pulp_python/tests/functional/api/test_sync.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,23 @@ def test_sync_platform_exclude(
264264
assert summary.present["python.python"]["count"] == SCIPY_COUNTS["no_os"]
265265

266266

267+
@pytest.mark.parallel
268+
def test_sync_multiple_filters(
269+
python_repo_with_sync, python_remote_factory, python_content_summary
270+
):
271+
"""Tests sync with multiple filters."""
272+
remote = python_remote_factory(
273+
includes=PYTHON_LG_PROJECT_SPECIFIER,
274+
package_types=["bdist_wheel"],
275+
keep_latest_packages=1,
276+
prereleases=False
277+
)
278+
repo = python_repo_with_sync(remote)
279+
280+
summary = python_content_summary(repository_version=repo.latest_version_href)
281+
assert summary.present["python.python"]["count"] == PYTHON_LG_FIXTURE_COUNTS["multi"]
282+
283+
267284
@pytest.mark.parallel
268285
def test_proxy_sync(
269286
python_bindings,

pulp_python/tests/functional/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
"latest_3": 49,
136136
"sdist": 27,
137137
"bdist_wheel": 63,
138+
"multi": 33, # keep_latest=1, package_types="bdist_wheel", prereleases=False
138139
}
139140

140141
DJANGO_LATEST_3 = 4 # latest version has 2 dists, each other has 1

0 commit comments

Comments
 (0)