forked from pypi/warehouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new flag to disable PEP 740 support. (pypi#16645)
* Add a new flag to disable PEP 740 support. * fixup migration Signed-off-by: William Woodruff <william@trailofbits.com> * migrations: flip PEP740 flag default PEP 740 should be enabled by default. Signed-off-by: William Woodruff <william@trailofbits.com> * Apply suggestions from code review Co-authored-by: Dustin Ingram <di@users.noreply.github.com> * migrations: rebase DISABLE_PEP740 flag migration Signed-off-by: William Woodruff <william@trailofbits.com> --------- Signed-off-by: William Woodruff <william@trailofbits.com> Co-authored-by: William Woodruff <william@trailofbits.com> Co-authored-by: William Woodruff <william@yossarian.net> Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
- Loading branch information
1 parent
80144c2
commit 738267a
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
warehouse/migrations/versions/2e049cda494f_add_disable_pep740_flag.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
""" | ||
add DISABLE_PEP740 flag | ||
Revision ID: 2e049cda494f | ||
Revises: f204918656f1 | ||
Create Date: 2024-09-05 15:15:58.703955 | ||
""" | ||
|
||
from alembic import op | ||
|
||
revision = "2e049cda494f" | ||
down_revision = "f204918656f1" | ||
|
||
|
||
def upgrade(): | ||
op.execute( | ||
""" | ||
INSERT INTO admin_flags(id, description, enabled, notify) | ||
VALUES ( | ||
'disable-pep740', | ||
'Disable PEP 740 support.', | ||
FALSE, | ||
FALSE | ||
) | ||
""" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.execute("DELETE FROM admin_flags WHERE id = 'disable-pep740'") |