Skip to content

Commit

Permalink
chore: update sqlalchemy exception imports (#12919)
Browse files Browse the repository at this point in the history
* chore: update sqlalchemy exception imports

Changed in 1.4, and a proxy import was left in place.
Update references to quiet down IDE warnings and use the current
location.

Refs: sqlalchemy/sqlalchemy@aded39f#diff-2772b7fba8928afe87d08ebadd2f805fdce83b3ffc638ed705cbedc7fd67ce41

Signed-off-by: Mike Fiedler <[email protected]>

* lint: sort imports

Signed-off-by: Mike Fiedler <[email protected]>

---------

Signed-off-by: Mike Fiedler <[email protected]>
  • Loading branch information
miketheman authored Feb 1, 2023
1 parent 3dce39d commit 186180c
Show file tree
Hide file tree
Showing 30 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion tests/unit/accounts/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
HTTPSeeOther,
HTTPTooManyRequests,
)
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound
from webauthn.authentication.verify_authentication_response import (
VerifiedAuthentication,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/admin/views/test_banners.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pytest

from pyramid.httpexceptions import HTTPNotFound
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound
from webob.multidict import MultiDict

from warehouse.admin.views import banners as views
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/admin/views/test_sponsors.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import pytest

from pyramid.httpexceptions import HTTPNotFound
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound
from webob.multidict import MultiDict

from warehouse.admin.interfaces import ISponsorLogoStorage
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/email/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pretend
import pytest

from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse import email
from warehouse.accounts.interfaces import IUserService
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/manage/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
HTTPTooManyRequests,
)
from pyramid.response import Response
from sqlalchemy.exc import NoResultFound
from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import NoResultFound
from webauthn.helpers import bytes_to_base64url
from webob.multidict import MultiDict

Expand Down
2 changes: 1 addition & 1 deletion warehouse/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
sql,
)
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.exc import NoResultFound
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm.exc import NoResultFound

from warehouse import db
from warehouse.events.models import HasEvents
Expand Down
2 changes: 1 addition & 1 deletion warehouse/accounts/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import requests

from passlib.context import CryptContext
from sqlalchemy.exc import NoResultFound
from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.sql import exists
from webauthn.helpers import bytes_to_base64url
from zope.interface import implementer
Expand Down
2 changes: 1 addition & 1 deletion warehouse/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)
from pyramid.security import forget, remember
from pyramid.view import view_config, view_defaults
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound
from webauthn.helpers import bytes_to_base64url

from warehouse.accounts import REDIRECT_FIELD_NAME
Expand Down
2 changes: 1 addition & 1 deletion warehouse/admin/views/banners.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from pyramid.httpexceptions import HTTPNotFound, HTTPSeeOther
from pyramid.view import view_config
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse.banners.models import Banner
from warehouse.forms import Form, URIValidator
Expand Down
2 changes: 1 addition & 1 deletion warehouse/admin/views/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from pyramid.httpexceptions import HTTPNotFound, HTTPSeeOther
from pyramid.view import view_config
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse.malware.models import MalwareCheck, MalwareCheckState, MalwareCheckType
from warehouse.malware.tasks import backfill, remove_verdicts, run_scheduled_check
Expand Down
2 changes: 1 addition & 1 deletion warehouse/admin/views/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPSeeOther
from pyramid.view import view_config
from sqlalchemy import String, cast, or_
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse.accounts.models import User
from warehouse.email import send_email
Expand Down
2 changes: 1 addition & 1 deletion warehouse/admin/views/prohibited_project_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPSeeOther
from pyramid.view import view_config
from sqlalchemy import func, literal, or_
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse.accounts.models import User
from warehouse.packaging.models import (
Expand Down
2 changes: 1 addition & 1 deletion warehouse/admin/views/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from pyramid.httpexceptions import HTTPBadRequest, HTTPMovedPermanently, HTTPSeeOther
from pyramid.view import view_config
from sqlalchemy import func, or_
from sqlalchemy.exc import NoResultFound
from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import NoResultFound

from warehouse.accounts.models import User
from warehouse.forklift.legacy import MAX_FILESIZE, MAX_PROJECT_SIZE
Expand Down
2 changes: 1 addition & 1 deletion warehouse/admin/views/sponsors.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pyramid.httpexceptions import HTTPNotFound, HTTPSeeOther
from pyramid.view import view_config
from slugify import slugify
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse.admin.interfaces import ISponsorLogoStorage
from warehouse.forms import Form, URIValidator
Expand Down
2 changes: 1 addition & 1 deletion warehouse/email/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from celery.schedules import crontab
from first import first
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse import tasks
from warehouse.accounts.interfaces import ITokenService, IUserService
Expand Down
2 changes: 1 addition & 1 deletion warehouse/email/ses/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pyramid.httpexceptions import HTTPBadRequest, HTTPServiceUnavailable
from pyramid.response import Response
from pyramid.view import view_config
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound
from sqlalchemy.sql import exists

from warehouse.email.ses.models import EmailMessage, EmailStatus, Event, EventTypes
Expand Down
2 changes: 1 addition & 1 deletion warehouse/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

from sqlalchemy import Column, DateTime, ForeignKey, Index, String, orm, sql
from sqlalchemy.dialects.postgresql import JSONB, UUID
from sqlalchemy.exc import NoResultFound
from sqlalchemy.ext.declarative import AbstractConcreteBase, declared_attr
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm.exc import NoResultFound

from warehouse import db
from warehouse.ip_addresses.models import IpAddress
Expand Down
2 changes: 1 addition & 1 deletion warehouse/forklift/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from pyramid.response import Response
from pyramid.view import view_config
from sqlalchemy import func, orm
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound
from sqlalchemy.exc import MultipleResultsFound, NoResultFound
from trove_classifiers import classifiers, deprecated_classifiers

from warehouse import forms
Expand Down
2 changes: 1 addition & 1 deletion warehouse/integrations/vulnerabilities/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# limitations under the License.

from sqlalchemy import func, orm
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse import tasks
from warehouse.integrations import vulnerabilities
Expand Down
2 changes: 1 addition & 1 deletion warehouse/legacy/api/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from packaging.utils import canonicalize_name, canonicalize_version
from pyramid.httpexceptions import HTTPMovedPermanently, HTTPNotFound
from pyramid.view import view_config
from sqlalchemy.exc import MultipleResultsFound, NoResultFound
from sqlalchemy.orm import Load, contains_eager, joinedload
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

from warehouse.cache.http import cache_control
from warehouse.cache.origin import origin_cache
Expand Down
2 changes: 1 addition & 1 deletion warehouse/legacy/api/xmlrpc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
xmlrpc_method as _xmlrpc_method,
)
from sqlalchemy import func, orm, select
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse.accounts.models import User
from warehouse.classifiers.models import Classifier
Expand Down
2 changes: 1 addition & 1 deletion warehouse/macaroons/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import pymacaroons

from pymacaroons.exceptions import MacaroonDeserializationException
from sqlalchemy.exc import NoResultFound
from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import NoResultFound
from zope.interface import implementer

from warehouse.macaroons import caveats
Expand Down
2 changes: 1 addition & 1 deletion warehouse/malware/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import inspect

from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

import warehouse.malware.checks as checks
import warehouse.packaging.models as packaging_models
Expand Down
2 changes: 1 addition & 1 deletion warehouse/manage/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
from pyramid.response import Response
from pyramid.view import view_config, view_defaults
from sqlalchemy import func
from sqlalchemy.exc import NoResultFound
from sqlalchemy.orm import Load, joinedload
from sqlalchemy.orm.exc import NoResultFound
from webauthn.helpers import bytes_to_base64url

import warehouse.utils.otp as otp
Expand Down
2 changes: 1 addition & 1 deletion warehouse/organizations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
sql,
)
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound
from sqlalchemy_utils.types.url import URLType

from warehouse import db
Expand Down
2 changes: 1 addition & 1 deletion warehouse/organizations/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import datetime

from sqlalchemy import func
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound
from zope.interface import implementer

from warehouse.accounts.models import User
Expand Down
2 changes: 1 addition & 1 deletion warehouse/packaging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
sql,
)
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.exc import MultipleResultsFound, NoResultFound
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative import declared_attr # type: ignore
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import validates
from sqlalchemy.orm.collections import attribute_mapped_collection
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

from warehouse import db
from warehouse.accounts.models import User
Expand Down
2 changes: 1 addition & 1 deletion warehouse/packaging/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from natsort import natsorted
from pyramid.httpexceptions import HTTPMovedPermanently, HTTPNotFound
from pyramid.view import view_config
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse.accounts.models import User
from warehouse.cache.origin import origin_cache
Expand Down
2 changes: 1 addition & 1 deletion warehouse/subscriptions/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import stripe

from sqlalchemy import or_
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound
from zope.interface import implementer

from warehouse.organizations.models import (
Expand Down
2 changes: 1 addition & 1 deletion warehouse/utils/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
HTTPSeeOther,
)
from sqlalchemy import exists, func
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import NoResultFound

from warehouse.admin.flags import AdminFlagValue
from warehouse.events.tags import EventTag
Expand Down

0 comments on commit 186180c

Please sign in to comment.