Skip to content

Commit 0f213c7

Browse files
committed
tmp
1 parent 02d63d3 commit 0f213c7

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

pulp_python/app/migrations/0019_create_missing_metadata_artifacts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ def create_missing_metadata_artifacts(apps, schema_editor):
155155
PythonPackageContent.objects.filter(metadata_sha256__isnull=False)
156156
.exclude(metadata_sha256="")
157157
.prefetch_related("contentartifact_set")
158+
.only("filename", "metadata_sha256")
158159
)
159160
# todo: only for testing, remove later
160161
created_count = 0
161162
skipped_count = 0
162163

163-
# todo: do i need temp dir? (not needed in localhost)
164164
with tempfile.TemporaryDirectory(dir=settings.WORKING_DIRECTORY) as temp_dir:
165165
for package in packages:
166166
metadata_relative_path = f"{package.filename}.metadata"
@@ -195,7 +195,7 @@ def create_missing_metadata_artifacts(apps, schema_editor):
195195
)
196196
created_count += 1
197197
except Exception:
198-
# Failed to save metadata artifact
198+
# Failed to save metadata content artifact
199199
skipped_count += 1
200200

201201
print(f"Created {created_count} missing metadata artifacts. Skipped {skipped_count} packages.")

pulp_python/app/tasks/sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ async def create_content(self, pkg):
255255
if upstream_pkg.has_metadata:
256256
url = upstream_pkg.metadata_url
257257
md_sha256 = upstream_pkg.metadata_digests.get("sha256")
258+
package.metadata_sha256 = md_sha256
258259
artifact = Artifact(sha256=md_sha256)
259260

260261
metadata_artifact = DeclarativeArtifact(

pulp_python/app/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,11 @@ def artifact_to_metadata_artifact(
303303
return metadata_artifact
304304

305305
finally:
306-
if temp_wheel_path and os.path.exists(temp_wheel_path):
307-
os.unlink(temp_wheel_path)
308-
if temp_metadata_path and os.path.exists(temp_metadata_path):
309-
os.unlink(temp_metadata_path)
306+
pass
307+
# if temp_wheel_path and os.path.exists(temp_wheel_path):
308+
# os.unlink(temp_wheel_path)
309+
# if temp_metadata_path and os.path.exists(temp_metadata_path):
310+
# os.unlink(temp_metadata_path)
310311

311312

312313
def fetch_json_release_metadata(name: str, version: str, remotes: set[Remote]) -> dict:

0 commit comments

Comments
 (0)