Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the minor-patch group with 2 updates #3482

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ rpds-py==0.17.1
# via
# jsonschema
# referencing
ruff==0.8.6
ruff==0.9.1
# via -r constraints.in
sentry-sdk==2.8.0
# via -r constraints.in
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ webtest==3.0.2
cornice==6.1.0
pyramid==2.0.2
python-rapidjson==1.20
SQLAlchemy==2.0.36
SQLAlchemy==2.0.37
3 changes: 1 addition & 2 deletions kinto/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ def main(args=None):
if not backend:
while True:
prompt = (
"Select the backend you would like to use: "
"(1 - postgresql, default - memory) "
"Select the backend you would like to use: (1 - postgresql, default - memory) "
)
answer = input(prompt).strip()
try:
Expand Down
6 changes: 2 additions & 4 deletions kinto/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@
"trailing_slash_redirect_ttl_seconds": 3600,
"multiauth.groupfinder": "kinto.core.authorization.groupfinder",
"multiauth.policies": "",
"multiauth.policy.basicauth.use": (
"kinto.core.authentication." "BasicAuthAuthenticationPolicy"
),
"multiauth.authorization_policy": ("kinto.core.authorization." "AuthorizationPolicy"),
"multiauth.policy.basicauth.use": "kinto.core.authentication.BasicAuthAuthenticationPolicy",
"multiauth.authorization_policy": "kinto.core.authorization.AuthorizationPolicy",
}


Expand Down
2 changes: 1 addition & 1 deletion kinto/core/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def setup_deprecation(config):

def _end_of_life_tween_factory(handler, registry):
"""Pyramid tween to handle service end of life."""
deprecation_msg = "The service you are trying to connect no longer exists" " at this location."
deprecation_msg = "The service you are trying to connect no longer exists at this location."

def eos_tween(request):
eos_date = registry.settings["eos"]
Expand Down
18 changes: 9 additions & 9 deletions kinto/core/permission/postgresql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def get_authorized_principals(self, bound_permissions):

query = f"""
WITH required_perms AS (
VALUES {','.join(perm_values)}
VALUES {",".join(perm_values)}
)
SELECT principal
FROM required_perms JOIN access_control_entries
Expand Down Expand Up @@ -292,14 +292,14 @@ def get_accessible_objects(self, principals, bound_permissions=None, with_childr
object_id_condition = "object_id LIKE pattern"
else:
object_id_condition = (
"object_id LIKE pattern " "AND object_id NOT LIKE pattern || '/%'"
"object_id LIKE pattern AND object_id NOT LIKE pattern || '/%'"
)
query = f"""
WITH required_perms AS (
VALUES {','.join(perm_values)}
VALUES {",".join(perm_values)}
),
user_principals AS (
VALUES {','.join(principals_values)}
VALUES {",".join(principals_values)}
),
potential_objects AS (
SELECT object_id, permission, required_perms.column1 AS pattern
Expand Down Expand Up @@ -341,15 +341,15 @@ def check_permission(self, principals, bound_permissions):

query = f"""
WITH required_perms AS (
VALUES {','.join(perms_values)}
VALUES {",".join(perms_values)}
),
allowed_principals AS (
SELECT principal
FROM required_perms JOIN access_control_entries
ON (object_id = column1 AND permission = column2)
),
required_principals AS (
VALUES {','.join(principals_values)}
VALUES {",".join(principals_values)}
)
SELECT COUNT(*) AS matched
FROM required_principals JOIN allowed_principals
Expand Down Expand Up @@ -412,7 +412,7 @@ def replace_object_permissions(self, object_id, permissions):
if not new_aces:
query = f"""
WITH specified_perms AS (
VALUES {','.join(specified_perms)}
VALUES {",".join(specified_perms)}
)
DELETE FROM access_control_entries
USING specified_perms
Expand All @@ -422,7 +422,7 @@ def replace_object_permissions(self, object_id, permissions):
else:
query = f"""
WITH specified_perms AS (
VALUES {','.join(specified_perms)}
VALUES {",".join(specified_perms)}
),
delete_specified AS (
DELETE FROM access_control_entries
Expand All @@ -435,7 +435,7 @@ def replace_object_permissions(self, object_id, permissions):
UNION SELECT :object_id
),
new_aces AS (
VALUES {','.join(new_aces)}
VALUES {",".join(new_aces)}
)
INSERT INTO access_control_entries(object_id, permission, principal)
SELECT DISTINCT d.object_id, n.column1, n.column2
Expand Down
2 changes: 1 addition & 1 deletion kinto/core/resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ def is_valid_timestamp(value):
operator = COMPARISON.GT
else:
if param == "_to":
message = "_to is now deprecated, " "you should use _before instead"
message = "_to is now deprecated, you should use _before instead"
url = (
"https://kinto.readthedocs.io/en/2.4.0/api/"
"resource.html#list-of-available-url-"
Expand Down
3 changes: 1 addition & 2 deletions kinto/core/resource/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class URL(URL):

def __init__(self, *args, **kwargs):
message = (
"`kinto.core.resource.schema.URL` is deprecated, "
"use `kinto.core.schema.URL` instead."
"`kinto.core.resource.schema.URL` is deprecated, use `kinto.core.schema.URL` instead."
)
warnings.warn(message, DeprecationWarning)
super().__init__(*args, **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions kinto/core/storage/postgresql/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ def create_from_config(config, prefix="", with_transaction=True):
url = filtered_settings[prefix + "url"]
existing_client = _CLIENTS[transaction_per_request].get(url)
if existing_client:
msg = "Reuse existing PostgreSQL connection. " f"Parameters {prefix}* will be ignored."
msg = f"Reuse existing PostgreSQL connection. Parameters {prefix}* will be ignored."
warnings.warn(msg)
return existing_client

# Initialize SQLAlchemy engine from filtered_settings.
poolclass_key = prefix + "poolclass"
filtered_settings.setdefault(
poolclass_key, ("kinto.core.storage.postgresql." "pool.QueuePoolWithMaxBacklog")
poolclass_key, ("kinto.core.storage.postgresql.pool.QueuePoolWithMaxBacklog")
)
filtered_settings[poolclass_key] = config.maybe_dotted(filtered_settings[poolclass_key])
engine = sqlalchemy.engine_from_config(filtered_settings, prefix=prefix, url=url)
Expand Down
5 changes: 2 additions & 3 deletions kinto/core/views/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def page_not_found(response, request):

if not request.path.startswith(f"/{request.registry.route_prefix}"):
errno = ERRORS.VERSION_NOT_AVAILABLE
error_msg = "The requested API version is not available " "on this server."
error_msg = "The requested API version is not available on this server."
elif trailing_slash_redirection_enabled:
redirect = None

Expand All @@ -80,8 +80,7 @@ def page_not_found(response, request):
def service_unavailable(response, request):
if response.content_type != "application/json":
error_msg = (
"Service temporary unavailable "
"due to overloading or maintenance, please retry later."
"Service temporary unavailable due to overloading or maintenance, please retry later."
)
response = http_error(response, errno=ERRORS.BACKEND, message=error_msg)

Expand Down
3 changes: 1 addition & 2 deletions kinto/plugins/accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def includeme(config):
if "basicauth" in auth_policies and policy in auth_policies:
if auth_policies.index("basicauth") < auth_policies.index(policy):
error_msg = (
"'basicauth' should not be mentioned before '%s' "
"in 'multiauth.policies' setting."
"'basicauth' should not be mentioned before '%s' in 'multiauth.policies' setting."
) % policy
raise ConfigurationError(error_msg)

Expand Down
3 changes: 1 addition & 2 deletions kinto/plugins/default_bucket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,5 @@ def includeme(config):
"default_bucket",
description="The default bucket is an alias for a personal"
" bucket where collections are created implicitly.",
url="https://kinto.readthedocs.io/en/latest/api/1.x/"
"buckets.html#personal-bucket-default",
url="https://kinto.readthedocs.io/en/latest/api/1.x/buckets.html#personal-bucket-default",
)
2 changes: 1 addition & 1 deletion kinto/plugins/flush.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def flush_post(request):
def includeme(config):
config.add_api_capability(
"flush_endpoint",
description="The __flush__ endpoint can be used to remove " "all data from all backends.",
description="The __flush__ endpoint can be used to remove all data from all backends.",
url="https://kinto.readthedocs.io/en/latest/api/1.x/flush.html",
)
config.add_cornice_service(flush)
2 changes: 1 addition & 1 deletion kinto/plugins/quotas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def includeme(config):
config.add_api_capability(
"quotas",
description="Quotas Management on buckets " "and collections.",
description="Quotas Management on buckets and collections.",
url="https://kinto.readthedocs.io",
)

Expand Down
2 changes: 1 addition & 1 deletion tests/core/resource/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_events_have_custom_representation(self):
self.app.post_json(self.plural_url, self.body, headers=self.headers, status=201)
self.assertEqual(
repr(self.events[0]),
"<ResourceChanged action=create " "uri={}>".format(self.plural_url),
"<ResourceChanged action=create uri={}>".format(self.plural_url),
)

def test_post_sends_create_action(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/core/resource/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_filter_with__to_return_an_alert_header(self):
json.loads(alert),
{
"code": "soft-eol",
"message": ("_to is now deprecated, " "you should use _before instead"),
"message": ("_to is now deprecated, you should use _before instead"),
"url": (
"https://kinto.readthedocs.io/en/2.4.0/api/resource"
".html#list-of-available-url-parameters"
Expand Down
2 changes: 1 addition & 1 deletion tests/core/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


# This is the principal a connected user should have (in the tests).
USER_PRINCIPAL = "basicauth:8a931a10fc88ab2f6d1cc02a07d3a81b5d4768f6f13e85c5" "d8d4180419acb1b4"
USER_PRINCIPAL = "basicauth:8a931a10fc88ab2f6d1cc02a07d3a81b5d4768f6f13e85c5d8d4180419acb1b4"


class BaseWebTest(testing.BaseWebTest):
Expand Down
6 changes: 3 additions & 3 deletions tests/core/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_basic_auth_is_declined_if_disabled_in_settings(self):
{
"multiauth.policies": "dummy",
"multiauth.policy.dummy.use": (
"pyramid.authentication." "RepozeWho1AuthenticationPolicy"
"pyramid.authentication.RepozeWho1AuthenticationPolicy"
),
}
)
Expand All @@ -42,7 +42,7 @@ def test_policy_name_is_used(self, basicAuth):
{
"multiauth.policies": "dummy",
"multiauth.policy.dummy.use": (
"kinto.core.authentication." "BasicAuthAuthenticationPolicy"
"kinto.core.authentication.BasicAuthAuthenticationPolicy"
),
}
)
Expand All @@ -58,7 +58,7 @@ def test_views_are_forbidden_if_unknown_auth_method(self):
app.get(self.plural_url, headers=self.headers, status=401)

def test_principals_are_fetched_from_permission_backend(self):
patch = mock.patch(("tests.core.support." "AllowAuthorizationPolicy.permits"))
patch = mock.patch(("tests.core.support.AllowAuthorizationPolicy.permits"))
self.addCleanup(patch.stop)
mocked = patch.start()

Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def test_migrate_in_read_only_display_an_error(self):
self.registry.settings = {"readonly": "true"}
scripts.migrate({"registry": self.registry})
mocked.error.assert_any_call(
"Cannot migrate the storage backend " "while in readonly mode."
"Cannot migrate the storage backend while in readonly mode."
)
mocked.error.assert_any_call(
"Cannot migrate the permission " "backend while in readonly mode."
"Cannot migrate the permission backend while in readonly mode."
)

def test_migrate_in_dry_run_mode(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def test_pool_object_is_shared_among_backend_instances(self):
def test_warns_if_configured_pool_size_differs_for_same_backend_type(self):
self.backend.load_from_config(self._get_config())
settings = {**self.settings, "storage_pool_size": 1}
msg = "Reuse existing PostgreSQL connection. Parameters storage_* " "will be ignored."
with mock.patch("kinto.core.storage.postgresql.client." "warnings.warn") as mocked:
msg = "Reuse existing PostgreSQL connection. Parameters storage_* will be ignored."
with mock.patch("kinto.core.storage.postgresql.client.warnings.warn") as mocked:
self.backend.load_from_config(self._get_config(settings=settings))
mocked.assert_any_call(msg)

Expand Down
6 changes: 3 additions & 3 deletions tests/plugins/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_app_settings(cls, extras=None):
# XXX: this should be a default setting.
extras.setdefault(
"multiauth.policy.account.use",
"kinto.plugins.accounts.authentication." "AccountsAuthenticationPolicy",
"kinto.plugins.accounts.authentication.AccountsAuthenticationPolicy",
)
extras.setdefault("account_cache_ttl_seconds", "30")
return super().get_app_settings(extras)
Expand Down Expand Up @@ -865,15 +865,15 @@ def test_create_user_in_read_only_displays_an_error(self):
self.registry.settings["readonly"] = "true"
code = scripts.create_user({"registry": self.registry})
assert code == 51
mocked.error.assert_called_once_with("Cannot create a user with " "a readonly server.")
mocked.error.assert_called_once_with("Cannot create a user with a readonly server.")

def test_create_user_when_not_included_displays_an_error(self):
with mock.patch("kinto.plugins.accounts.scripts.logger") as mocked:
self.registry.settings["includes"] = ""
code = scripts.create_user({"registry": self.registry})
assert code == 52
mocked.error.assert_called_once_with(
"Cannot create a user when the accounts " "plugin is not installed."
"Cannot create a user when the accounts plugin is not installed."
)

def test_create_user_with_an_invalid_username_and_password_confirmation_recovers(self):
Expand Down
10 changes: 5 additions & 5 deletions tests/plugins/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ class DefaultBucketTest(HistoryWebTest):
@classmethod
def get_app_settings(cls, extras=None):
settings = super().get_app_settings(extras)
settings["includes"] = "kinto.plugins.default_bucket " "kinto.plugins.history"
settings["includes"] = "kinto.plugins.default_bucket kinto.plugins.history"
return settings

def setUp(self):
Expand Down Expand Up @@ -539,13 +539,13 @@ def setUp(self):
self.julia_headers = get_user_headers("julia")

self.alice_principal = (
"basicauth:d5b0026601f1b251974e09548d44155e16" "812e3c64ff7ae053fe3542e2ca1570"
"basicauth:d5b0026601f1b251974e09548d44155e16812e3c64ff7ae053fe3542e2ca1570"
)
self.bob_principal = (
"basicauth:c031ced27503f788b102ca54269a062ec737" "94bb075154c74a0d4311e74ca8b6"
"basicauth:c031ced27503f788b102ca54269a062ec73794bb075154c74a0d4311e74ca8b6"
)
self.julia_principal = (
"basicauth:d8bab8d9fe0510fcaf9b5ad5942c027fc" "2fdf80b6dc59cc3c48d12a2fcb18f1c"
"basicauth:d8bab8d9fe0510fcaf9b5ad5942c027fc2fdf80b6dc59cc3c48d12a2fcb18f1c"
)

bucket = {"permissions": {"read": [self.alice_principal]}}
Expand Down Expand Up @@ -638,7 +638,7 @@ class ExcludeResourcesTest(HistoryWebTest):
def get_app_settings(cls, extras=None):
settings = super().get_app_settings(extras)
settings["history.exclude_resources"] = (
"/buckets/a " "/buckets/b/collections/a " "/buckets/b/groups/a"
"/buckets/a /buckets/b/collections/a /buckets/b/groups/a"
)
return settings

Expand Down
10 changes: 5 additions & 5 deletions tests/plugins/test_quotas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,13 +1106,13 @@ def paginated_mock(*args, **kwargs):
)

mocked_logger.info.assert_any_call(
"Bucket bucket-1, collection collection-1. " "Final size: 1 records, 78 bytes."
"Bucket bucket-1, collection collection-1. Final size: 1 records, 78 bytes."
)
mocked_logger.info.assert_any_call(
"Bucket bucket-1, collection collection-2. " "Final size: 1 records, 79 bytes."
"Bucket bucket-1, collection collection-2. Final size: 1 records, 79 bytes."
)
mocked_logger.info.assert_any_call(
"Bucket bucket-1. Final size: " "2 collections, 2 records, 193 bytes."
"Bucket bucket-1. Final size: 2 collections, 2 records, 193 bytes."
)

def test_rebuild_quotas_doesnt_update_if_dry_run(self):
Expand All @@ -1135,8 +1135,8 @@ def paginated_mock(*args, **kwargs):
assert not self.storage.update.called

mocked.info.assert_any_call(
"Bucket bucket-1, collection collection-1. " "Final size: 1 records, 78 bytes."
"Bucket bucket-1, collection collection-1. Final size: 1 records, 78 bytes."
)
mocked.info.assert_any_call(
"Bucket bucket-1. Final size: 1 collections, " "1 records, 114 bytes."
"Bucket bucket-1. Final size: 1 collections, 1 records, 114 bytes."
)
2 changes: 1 addition & 1 deletion tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
MINIMALIST_COLLECTION = {}
MINIMALIST_GROUP = {"data": dict(members=["fxa:user"])}
MINIMALIST_RECORD = {"data": dict(name="Hulled Barley", type="Whole Grain")}
USER_PRINCIPAL = "basicauth:8a931a10fc88ab2f6d1cc02a07d3a81b5d4768f6f13e85c5" "d8d4180419acb1b4"
USER_PRINCIPAL = "basicauth:8a931a10fc88ab2f6d1cc02a07d3a81b5d4768f6f13e85c5d8d4180419acb1b4"


class BaseWebTest(testing.BaseWebTest):
Expand Down
Loading
Loading