From 598b10090ee9e28d71a197bebe6cd98c603292b1 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Mon, 20 Oct 2025 19:14:44 -0400 Subject: [PATCH] Use full path for settings.deprecation_warnings access Changed from settings_module.settings.deprecation_warnings to fastmcp.settings.settings.deprecation_warnings for clarity. --- src/fastmcp/server/auth/providers/auth0.py | 4 ++-- src/fastmcp/server/auth/providers/aws.py | 4 ++-- src/fastmcp/server/auth/providers/azure.py | 4 ++-- src/fastmcp/server/auth/providers/github.py | 4 ++-- src/fastmcp/server/auth/providers/google.py | 4 ++-- src/fastmcp/server/auth/providers/workos.py | 4 ++-- src/fastmcp/settings.py | 1 + 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/fastmcp/server/auth/providers/auth0.py b/src/fastmcp/server/auth/providers/auth0.py index b726d0106..1b8e7fb37 100644 --- a/src/fastmcp/server/auth/providers/auth0.py +++ b/src/fastmcp/server/auth/providers/auth0.py @@ -27,7 +27,7 @@ from key_value.aio.protocols import AsyncKeyValue from pydantic import AnyHttpUrl, SecretStr, field_validator from pydantic_settings import BaseSettings -import fastmcp.settings as settings_module +import fastmcp.settings from fastmcp.server.auth.oidc_dcr_proxy import OIDCDCRProxy from fastmcp.settings import ( ENV_FILE, @@ -212,7 +212,7 @@ class Auth0Provider(Auth0DCRProvider): """ def __init__(self, **kwargs): - if settings_module.settings.deprecation_warnings: + if fastmcp.settings.settings.deprecation_warnings: warnings.warn( "Auth0Provider is deprecated, use Auth0DCRProvider instead", DeprecationWarning, diff --git a/src/fastmcp/server/auth/providers/aws.py b/src/fastmcp/server/auth/providers/aws.py index 3ae92f7f4..d5f4ed576 100644 --- a/src/fastmcp/server/auth/providers/aws.py +++ b/src/fastmcp/server/auth/providers/aws.py @@ -29,7 +29,7 @@ from key_value.aio.protocols import AsyncKeyValue from pydantic import AnyHttpUrl, SecretStr, field_validator from pydantic_settings import BaseSettings -import fastmcp.settings as settings_module +import fastmcp.settings from fastmcp.server.auth import TokenVerifier from fastmcp.server.auth.auth import AccessToken from fastmcp.server.auth.oidc_dcr_proxy import OIDCDCRProxy @@ -263,7 +263,7 @@ class AWSCognitoProvider(AWSCognitoDCRProvider): """ def __init__(self, **kwargs): - if settings_module.settings.deprecation_warnings: + if fastmcp.settings.settings.deprecation_warnings: warnings.warn( "AWSCognitoProvider is deprecated, use AWSCognitoDCRProvider instead", DeprecationWarning, diff --git a/src/fastmcp/server/auth/providers/azure.py b/src/fastmcp/server/auth/providers/azure.py index e6b022a71..9fb0f51a8 100644 --- a/src/fastmcp/server/auth/providers/azure.py +++ b/src/fastmcp/server/auth/providers/azure.py @@ -13,7 +13,7 @@ from key_value.aio.protocols import AsyncKeyValue from pydantic import SecretStr, field_validator from pydantic_settings import BaseSettings -import fastmcp.settings as settings_module +import fastmcp.settings from fastmcp.server.auth.oauth_dcr_proxy import OAuthDCRProxy from fastmcp.server.auth.providers.jwt import JWTVerifier from fastmcp.settings import ( @@ -315,7 +315,7 @@ class AzureProvider(AzureDCRProvider): """ def __init__(self, **kwargs): - if settings_module.settings.deprecation_warnings: + if fastmcp.settings.settings.deprecation_warnings: warnings.warn( "AzureProvider is deprecated, use AzureDCRProvider instead", DeprecationWarning, diff --git a/src/fastmcp/server/auth/providers/github.py b/src/fastmcp/server/auth/providers/github.py index 494b6fbcf..7edee4046 100644 --- a/src/fastmcp/server/auth/providers/github.py +++ b/src/fastmcp/server/auth/providers/github.py @@ -28,7 +28,7 @@ from key_value.aio.protocols import AsyncKeyValue from pydantic import AnyHttpUrl, SecretStr, field_validator from pydantic_settings import BaseSettings -import fastmcp.settings as settings_module +import fastmcp.settings from fastmcp.server.auth import TokenVerifier from fastmcp.server.auth.auth import AccessToken from fastmcp.server.auth.oauth_dcr_proxy import OAuthDCRProxy @@ -324,7 +324,7 @@ class GitHubProvider(GitHubDCRProvider): """ def __init__(self, **kwargs): - if settings_module.settings.deprecation_warnings: + if fastmcp.settings.settings.deprecation_warnings: warnings.warn( "GitHubProvider is deprecated, use GitHubDCRProvider instead", DeprecationWarning, diff --git a/src/fastmcp/server/auth/providers/google.py b/src/fastmcp/server/auth/providers/google.py index dbbce95f8..503f4d97d 100644 --- a/src/fastmcp/server/auth/providers/google.py +++ b/src/fastmcp/server/auth/providers/google.py @@ -29,7 +29,7 @@ from key_value.aio.protocols import AsyncKeyValue from pydantic import AnyHttpUrl, SecretStr, field_validator from pydantic_settings import BaseSettings -import fastmcp.settings as settings_module +import fastmcp.settings from fastmcp.server.auth import TokenVerifier from fastmcp.server.auth.auth import AccessToken from fastmcp.server.auth.oauth_dcr_proxy import OAuthDCRProxy @@ -343,7 +343,7 @@ class GoogleProvider(GoogleDCRProvider): """ def __init__(self, **kwargs): - if settings_module.settings.deprecation_warnings: + if fastmcp.settings.settings.deprecation_warnings: warnings.warn( "GoogleProvider is deprecated, use GoogleDCRProvider instead", DeprecationWarning, diff --git a/src/fastmcp/server/auth/providers/workos.py b/src/fastmcp/server/auth/providers/workos.py index 13c1f60ee..ce81209ad 100644 --- a/src/fastmcp/server/auth/providers/workos.py +++ b/src/fastmcp/server/auth/providers/workos.py @@ -19,7 +19,7 @@ from pydantic_settings import BaseSettings from starlette.responses import JSONResponse from starlette.routing import Route -import fastmcp.settings as settings_module +import fastmcp.settings from fastmcp.server.auth import AccessToken, RemoteAuthProvider, TokenVerifier from fastmcp.server.auth.oauth_dcr_proxy import OAuthDCRProxy from fastmcp.server.auth.providers.jwt import JWTVerifier @@ -301,7 +301,7 @@ class WorkOSProvider(WorkOSDCRProvider): """ def __init__(self, **kwargs): - if settings_module.settings.deprecation_warnings: + if fastmcp.settings.settings.deprecation_warnings: warnings.warn( "WorkOSProvider is deprecated, use WorkOSDCRProvider instead", DeprecationWarning, diff --git a/src/fastmcp/settings.py b/src/fastmcp/settings.py index ae4b5e617..2bbf95bc5 100644 --- a/src/fastmcp/settings.py +++ b/src/fastmcp/settings.py @@ -145,6 +145,7 @@ class Settings(BaseSettings): which accessed fastmcp.settings.settings """ # Deprecated in 2.8.0 + breakpoint() logger.warning( "Using fastmcp.settings.settings is deprecated. Use fastmcp.settings instead.", )