Skip to content

Commit 04d5afc

Browse files
committed
Create 3.4 branch
[noissue]
1 parent c9e4612 commit 04d5afc

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

.github/workflows/scripts/release.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,38 @@
2121
from packaging.requirements import Requirement
2222

2323

24+
async def get_package_from_pypi(package_name, plugin_path):
25+
"""
26+
Download a package from PyPI.
27+
28+
:param name: name of the package to download from PyPI
29+
:return: String path to the package
30+
"""
31+
config = BandersnatchConfig().config
32+
config["mirror"]["master"] = "https://pypi.org"
33+
config["mirror"]["workers"] = "1"
34+
config["mirror"]["directory"] = plugin_path
35+
if not config.has_section("plugins"):
36+
config.add_section("plugins")
37+
config["plugins"]["enabled"] = "blocklist_release\n"
38+
if not config.has_section("allowlist"):
39+
config.add_section("allowlist")
40+
config["plugins"]["enabled"] += "allowlist_release\nallowlist_project\n"
41+
config["allowlist"]["packages"] = "\n".join([package_name])
42+
os.makedirs(os.path.join(plugin_path, "dist"), exist_ok=True)
43+
async with Master("https://pypi.org/") as master:
44+
mirror = BandersnatchMirror(homedir=plugin_path, master=master)
45+
name = Requirement(package_name).name
46+
result = await mirror.synchronize([name])
47+
package_found = False
48+
49+
for package in result[name]:
50+
current_path = os.path.join(plugin_path, package)
51+
destination_path = os.path.join(plugin_path, "dist", os.path.basename(package))
52+
shutil.move(current_path, destination_path)
53+
package_found = True
54+
return package_found
55+
2456

2557
def create_release_commits(repo, release_version, plugin_path):
2658
"""Build changelog, set version, commit, bump to next dev version, commit."""
@@ -96,7 +128,9 @@ def create_tag_and_build_package(repo, desired_tag, commit_sha, plugin_path):
96128

97129
# Check if Package is available on PyPI
98130
loop = asyncio.get_event_loop() # noqa
99-
package_found = asyncio.run(get_package_from_pypi("pulp-python=={tag.name}", plugin_path))
131+
package_found = asyncio.run(
132+
get_package_from_pypi("pulp-python=={tag.name}", plugin_path)
133+
) # noqa
100134

101135
if not package_found:
102136
os.system("python3 setup.py sdist bdist_wheel --python-tag py3")

pulp_python/tests/functional/api/test_pypi_apis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_twine_upload(self):
182182
capture_output=True,
183183
check=True,
184184
)
185-
tasks = task_api.list(reserved_resources_record=[repo.pulp_href]).results
185+
tasks = task_api.list(reserved_resources_record=repo.pulp_href).results
186186
for task in reversed(tasks):
187187
t = monitor_task(task.pulp_href)
188188
repo_ver_href = t.created_resources[-1]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pulpcore>=3.13
1+
pulpcore>=3.13,<3.15
22
pkginfo
33
packaging
44
bandersnatch==4.4.0

template_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ plugin_name: pulp_python
3131
plugin_snake: pulp_python
3232
publish_docs_to_pulpprojectdotorg: true
3333
pulp_settings: null
34-
pulpcore_branch: master
35-
pulpcore_pip_version_specifier: null
34+
pulpcore_branch: 3.13
35+
pulpcore_pip_version_specifier: ~=3.13.0
3636
pulpprojectdotorg_key_id: null
3737
pydocstyle: true
3838
pypi_username: pulp

0 commit comments

Comments
 (0)