chore: bump ruff

This commit is contained in:
Yohan Boniface 2024-03-05 17:23:19 +01:00
parent 6542dd34ec
commit bfcdfdcfc1
8 changed files with 19 additions and 16 deletions

View file

@ -44,7 +44,7 @@ dependencies = [
[project.optional-dependencies]
dev = [
"hatch==1.9.3",
"ruff==0.2.2",
"ruff==0.3.0",
"djlint==1.34.1",
"mkdocs==1.5.3",
"mkdocs-material==9.5.12",

View file

@ -1,4 +1,5 @@
"""Base settings shared by all environments"""
# Import global settings to make it easier to extend settings.
from email.utils import parseaddr

View file

@ -1,4 +1,5 @@
"""Settings for Development Server"""
from umap.settings.base import * # pylint: disable=W0614,W0401
DEBUG = True

View file

@ -15,9 +15,9 @@ def staticfiles(settings):
settings.STATIC_ROOT = static_root
# Make sure settings are properly reset after the test
settings.STORAGES = deepcopy(settings.STORAGES)
settings.STORAGES["staticfiles"][
"BACKEND"
] = "umap.storage.UmapManifestStaticFilesStorage"
settings.STORAGES["staticfiles"]["BACKEND"] = (
"umap.storage.UmapManifestStaticFilesStorage"
)
try:
call_command("collectstatic", "--noinput")
yield

View file

@ -101,9 +101,9 @@ def test_map_should_display_custom_tilelayer(map, live_server, tilelayers, page)
url_pattern = re.compile(
r"https://[abc]{1}.basemaps.cartocdn.com/rastertiles/voyager/\d+/\d+/\d+.png"
)
map.settings["properties"]["tilelayer"][
"url_template"
] = "https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
map.settings["properties"]["tilelayer"]["url_template"] = (
"https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
)
map.settings["properties"]["tilelayersControl"] = True
map.save()
page.goto(f"{live_server.url}{map.get_absolute_url()}")

View file

@ -5,9 +5,9 @@ from umap.settings.base import * # pylint: disable=W0614,W0401
SECRET_KEY = "justfortests"
DEFAULT_FROM_EMAIL = "test@test.org"
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
STORAGES["staticfiles"][
"BACKEND"
] = "django.contrib.staticfiles.storage.StaticFilesStorage"
STORAGES["staticfiles"]["BACKEND"] = (
"django.contrib.staticfiles.storage.StaticFilesStorage"
)
if os.environ.get("GITHUB_ACTIONS", False) == "true":
DATABASES = {

View file

@ -320,9 +320,9 @@ class UserDownload(DetailView, SearchMixin):
zip_file.writestr(file_name, geojson_file.getvalue())
response = HttpResponse(zip_buffer.getvalue(), content_type="application/zip")
response[
"Content-Disposition"
] = 'attachment; filename="umap_backup_complete.zip"'
response["Content-Disposition"] = (
'attachment; filename="umap_backup_complete.zip"'
)
return response
@ -666,9 +666,9 @@ class MapDownload(DetailView):
def render_to_response(self, context, *args, **kwargs):
umapjson = self.object.generate_umapjson(self.request)
response = simple_json_response(**umapjson)
response[
"Content-Disposition"
] = f'attachment; filename="umap_backup_{self.object.slug}.umap"'
response["Content-Disposition"] = (
f'attachment; filename="umap_backup_{self.object.slug}.umap"'
)
return response

View file

@ -13,6 +13,7 @@ middleware here, or combine a Django application with an application of another
framework.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "umap.settings")