Skip to content

Commit

Permalink
Make migration version 24aa37164e72 apply immediately (pypi#17411)
Browse files Browse the repository at this point in the history
* Fixup migration version 24aa37164e72

* don't instigate a migration
  • Loading branch information
ewdurbin authored Jan 14, 2025
1 parent a8a9391 commit 342cc1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,46 +25,14 @@


def upgrade():
op.sync_enum_values(
enum_schema="public",
enum_name="release_dynamic_fields",
new_values=[
"Platform",
"Supported-Platform",
"Summary",
"Description",
"Description-Content-Type",
"Keywords",
"Author",
"Author-Email",
"Maintainer",
"Maintainer-Email",
"License",
"License-Expression",
"License-File",
"Classifier",
"Requires-Dist",
"Requires-Python",
"Requires-External",
"Project-Url",
"Provides-Extra",
"Provides-Dist",
"Obsoletes-Dist",
"Home-Page",
"Download-Url",
"Requires",
"Provides",
"Obsoletes",
],
affected_columns=[
TableReference(
table_schema="public",
table_name="releases",
column_name="dynamic",
column_type=ColumnType.ARRAY,
)
],
enum_values_to_rename=[],
op.execute(
"ALTER TYPE public.release_dynamic_fields ADD VALUE IF NOT EXISTS 'Requires'"
)
op.execute(
"ALTER TYPE public.release_dynamic_fields ADD VALUE IF NOT EXISTS 'Provides'"
)
op.execute(
"ALTER TYPE public.release_dynamic_fields ADD VALUE IF NOT EXISTS 'Obsoletes'"
)


Expand Down
4 changes: 2 additions & 2 deletions warehouse/packaging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ class ReleaseURL(db.Model):
"Description",
"Description-Content-Type",
"Keywords",
"Home-Page", # Deprecated, but technically permitted by PEP 643
"Download-Url", # Deprecated, but technically permitted by PEP 643
"Author",
"Author-Email",
"Maintainer",
Expand All @@ -565,8 +567,6 @@ class ReleaseURL(db.Model):
# Although the following are deprecated fields, they are technically
# permitted as dynamic by PEP 643
# https://github.com/pypa/setuptools/issues/4797#issuecomment-2589514950
"Home-Page",
"Download-Url",
"Requires",
"Provides",
"Obsoletes",
Expand Down

0 comments on commit 342cc1a

Please sign in to comment.