chore: bump ruff
This commit is contained in:
parent
6542dd34ec
commit
bfcdfdcfc1
8 changed files with 19 additions and 16 deletions
|
@ -44,7 +44,7 @@ dependencies = [
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
"hatch==1.9.3",
|
"hatch==1.9.3",
|
||||||
"ruff==0.2.2",
|
"ruff==0.3.0",
|
||||||
"djlint==1.34.1",
|
"djlint==1.34.1",
|
||||||
"mkdocs==1.5.3",
|
"mkdocs==1.5.3",
|
||||||
"mkdocs-material==9.5.12",
|
"mkdocs-material==9.5.12",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
"""Base settings shared by all environments"""
|
"""Base settings shared by all environments"""
|
||||||
|
|
||||||
# Import global settings to make it easier to extend settings.
|
# Import global settings to make it easier to extend settings.
|
||||||
from email.utils import parseaddr
|
from email.utils import parseaddr
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
"""Settings for Development Server"""
|
"""Settings for Development Server"""
|
||||||
|
|
||||||
from umap.settings.base import * # pylint: disable=W0614,W0401
|
from umap.settings.base import * # pylint: disable=W0614,W0401
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
|
@ -15,9 +15,9 @@ def staticfiles(settings):
|
||||||
settings.STATIC_ROOT = static_root
|
settings.STATIC_ROOT = static_root
|
||||||
# Make sure settings are properly reset after the test
|
# Make sure settings are properly reset after the test
|
||||||
settings.STORAGES = deepcopy(settings.STORAGES)
|
settings.STORAGES = deepcopy(settings.STORAGES)
|
||||||
settings.STORAGES["staticfiles"][
|
settings.STORAGES["staticfiles"]["BACKEND"] = (
|
||||||
"BACKEND"
|
"umap.storage.UmapManifestStaticFilesStorage"
|
||||||
] = "umap.storage.UmapManifestStaticFilesStorage"
|
)
|
||||||
try:
|
try:
|
||||||
call_command("collectstatic", "--noinput")
|
call_command("collectstatic", "--noinput")
|
||||||
yield
|
yield
|
||||||
|
|
|
@ -101,9 +101,9 @@ def test_map_should_display_custom_tilelayer(map, live_server, tilelayers, page)
|
||||||
url_pattern = re.compile(
|
url_pattern = re.compile(
|
||||||
r"https://[abc]{1}.basemaps.cartocdn.com/rastertiles/voyager/\d+/\d+/\d+.png"
|
r"https://[abc]{1}.basemaps.cartocdn.com/rastertiles/voyager/\d+/\d+/\d+.png"
|
||||||
)
|
)
|
||||||
map.settings["properties"]["tilelayer"][
|
map.settings["properties"]["tilelayer"]["url_template"] = (
|
||||||
"url_template"
|
"https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
||||||
] = "https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"
|
)
|
||||||
map.settings["properties"]["tilelayersControl"] = True
|
map.settings["properties"]["tilelayersControl"] = True
|
||||||
map.save()
|
map.save()
|
||||||
page.goto(f"{live_server.url}{map.get_absolute_url()}")
|
page.goto(f"{live_server.url}{map.get_absolute_url()}")
|
||||||
|
|
|
@ -5,9 +5,9 @@ from umap.settings.base import * # pylint: disable=W0614,W0401
|
||||||
SECRET_KEY = "justfortests"
|
SECRET_KEY = "justfortests"
|
||||||
DEFAULT_FROM_EMAIL = "test@test.org"
|
DEFAULT_FROM_EMAIL = "test@test.org"
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
|
||||||
STORAGES["staticfiles"][
|
STORAGES["staticfiles"]["BACKEND"] = (
|
||||||
"BACKEND"
|
"django.contrib.staticfiles.storage.StaticFilesStorage"
|
||||||
] = "django.contrib.staticfiles.storage.StaticFilesStorage"
|
)
|
||||||
|
|
||||||
if os.environ.get("GITHUB_ACTIONS", False) == "true":
|
if os.environ.get("GITHUB_ACTIONS", False) == "true":
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
|
|
|
@ -320,9 +320,9 @@ class UserDownload(DetailView, SearchMixin):
|
||||||
zip_file.writestr(file_name, geojson_file.getvalue())
|
zip_file.writestr(file_name, geojson_file.getvalue())
|
||||||
|
|
||||||
response = HttpResponse(zip_buffer.getvalue(), content_type="application/zip")
|
response = HttpResponse(zip_buffer.getvalue(), content_type="application/zip")
|
||||||
response[
|
response["Content-Disposition"] = (
|
||||||
"Content-Disposition"
|
'attachment; filename="umap_backup_complete.zip"'
|
||||||
] = 'attachment; filename="umap_backup_complete.zip"'
|
)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
@ -666,9 +666,9 @@ class MapDownload(DetailView):
|
||||||
def render_to_response(self, context, *args, **kwargs):
|
def render_to_response(self, context, *args, **kwargs):
|
||||||
umapjson = self.object.generate_umapjson(self.request)
|
umapjson = self.object.generate_umapjson(self.request)
|
||||||
response = simple_json_response(**umapjson)
|
response = simple_json_response(**umapjson)
|
||||||
response[
|
response["Content-Disposition"] = (
|
||||||
"Content-Disposition"
|
f'attachment; filename="umap_backup_{self.object.slug}.umap"'
|
||||||
] = f'attachment; filename="umap_backup_{self.object.slug}.umap"'
|
)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ middleware here, or combine a Django application with an application of another
|
||||||
framework.
|
framework.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "umap.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "umap.settings")
|
||||||
|
|
Loading…
Reference in a new issue