apis-acdhch-default-settings 2.7.0__tar.gz → 2.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. apis_acdhch_default_settings-2.8.0/.github/workflows/linters.yml +67 -0
  2. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/.github/workflows/publish.yml +6 -0
  3. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/.gitignore +1 -0
  4. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/CHANGELOG.md +12 -0
  5. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/PKG-INFO +4 -1
  6. apis_acdhch_default_settings-2.8.0/apis_acdhch_default_settings/locale/de/LC_MESSAGES/django.mo +0 -0
  7. apis_acdhch_default_settings-2.8.0/apis_acdhch_default_settings/locale/de/LC_MESSAGES/django.po +22 -0
  8. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/apis_acdhch_default_settings/settings.py +20 -9
  9. apis_acdhch_default_settings-2.8.0/apis_acdhch_default_settings/templates/base.html +12 -0
  10. apis_acdhch_default_settings-2.8.0/apis_acdhch_default_settings/templates/imprint.html +9 -0
  11. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/apis_acdhch_default_settings/urls.py +1 -3
  12. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/apis_acdhch_default_settings/views.py +4 -2
  13. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/pyproject.toml +35 -1
  14. apis_acdhch_default_settings-2.7.0/apis_acdhch_default_settings/templates/base.html +0 -12
  15. apis_acdhch_default_settings-2.7.0/apis_acdhch_default_settings/templates/imprint.html +0 -11
  16. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/.github/dependabot.yml +0 -0
  17. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/.github/workflows/add-to-project.yml +0 -0
  18. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/.github/workflows/release-please.yml +0 -0
  19. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/LICENSE +0 -0
  20. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/README.md +0 -0
  21. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/apis_acdhch_default_settings/__init__.py +0 -0
  22. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/apis_acdhch_default_settings/ldapauth.py +0 -0
  23. {apis_acdhch_default_settings-2.7.0 → apis_acdhch_default_settings-2.8.0}/apis_acdhch_default_settings/querysets.py +0 -0
@@ -0,0 +1,67 @@
1
+ # SPDX-FileCopyrightText: 2024 Birger Schacht <birger.schacht@oeaw.ac.at>
2
+ # SPDX-License-Identifier: MIT
3
+ name: Run linters
4
+
5
+ on:
6
+ - push
7
+
8
+ jobs:
9
+ ruff-format:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Install uv
16
+ uses: astral-sh/setup-uv@v6
17
+
18
+ - name: Run ruff format
19
+ run: uv run --only-dev ruff format --check .
20
+
21
+ ruff-check:
22
+ runs-on: ubuntu-latest
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+
27
+ - name: Install uv
28
+ uses: astral-sh/setup-uv@v6
29
+
30
+ - name: Run ruff check
31
+ run: uv run --only-dev ruff check .
32
+
33
+ djlint-formatter:
34
+ runs-on: ubuntu-latest
35
+
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: Install uv
40
+ uses: astral-sh/setup-uv@v6
41
+
42
+ - name: Run ruff check
43
+ run: uv run --only-dev djlint --check .
44
+
45
+ djlint-linter:
46
+ runs-on: ubuntu-latest
47
+
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+
51
+ - name: Install uv
52
+ uses: astral-sh/setup-uv@v6
53
+
54
+ - name: Run ruff check
55
+ run: uv run --only-dev djlint --lint .
56
+
57
+ deptry:
58
+ runs-on: ubuntu-latest
59
+
60
+ steps:
61
+ - uses: actions/checkout@v4
62
+
63
+ - name: Install uv
64
+ uses: astral-sh/setup-uv@v6
65
+
66
+ - name: Run deptry
67
+ run: uv run --only-dev deptry .
@@ -16,6 +16,12 @@ jobs:
16
16
  uses: actions/setup-python@v5
17
17
  with:
18
18
  python-version: "3.x"
19
+ - name: Install gettext
20
+ run: sudo apt-get update && sudo apt-get -f install gettext
21
+ - name: Install django
22
+ run: python3 -m pip install django --user
23
+ - name: Compile messages
24
+ run: django-admin compilemessages
19
25
  - name: Install pypa/build
20
26
  run: >-
21
27
  python3 -m
@@ -5,3 +5,4 @@
5
5
  dist
6
6
  **/__pycache__
7
7
  *.lock
8
+ *.mo
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.8.0](https://github.com/acdh-oeaw/apis-acdhch-default-settings/compare/v2.7.0...v2.8.0) (2025-05-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * **settings:** add LocaleMiddleware to the list of middlewares ([e803775](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/e8037759d1739ad8c72e91fa1cd96debd2dba4f3))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **locales:** add translation for `Imprint` ([4a90552](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/4a90552ea34cb126f496027b4cc5a376d4594ae3))
14
+
3
15
  ## [2.7.0](https://github.com/acdh-oeaw/apis-acdhch-default-settings/compare/v2.6.0...v2.7.0) (2025-05-13)
4
16
 
5
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apis-acdhch-default-settings
3
- Version: 2.7.0
3
+ Version: 2.8.0
4
4
  Summary: Default settings for APIS instances at the ACDH-CH
5
5
  Project-URL: source, https://github.com/acdh-oeaw/apis-acdhch-default-settings
6
6
  Project-URL: changelog, https://github.com/acdh-oeaw/apis-acdhch-default-settings/blob/main/CHANGELOG.md
@@ -9,11 +9,13 @@ Author-email: Birger Schacht <birger.schacht@oeaw.ac.at>
9
9
  License-Expression: MIT
10
10
  License-File: LICENSE
11
11
  Requires-Python: >=3.11
12
+ Requires-Dist: apis-core-rdf>=0.40.0
12
13
  Requires-Dist: dj-database-url<3.0,>=2.0.0
13
14
  Requires-Dist: django-allow-cidr<0.8,>=0.6
14
15
  Requires-Dist: django-auth-ldap<6.0,>=4.6.0
15
16
  Requires-Dist: django-csp<4.0,>=3.7
16
17
  Requires-Dist: django-removals<=2.0,>=1.0.5
18
+ Requires-Dist: django>=5
17
19
  Requires-Dist: opentelemetry-distro
18
20
  Requires-Dist: opentelemetry-exporter-otlp
19
21
  Requires-Dist: opentelemetry-instrumentation-asgi
@@ -21,6 +23,7 @@ Requires-Dist: opentelemetry-instrumentation-django
21
23
  Requires-Dist: opentelemetry-instrumentation-logging
22
24
  Requires-Dist: opentelemetry-instrumentation-psycopg2
23
25
  Requires-Dist: opentelemetry-instrumentation-wsgi
26
+ Requires-Dist: requests>=2
24
27
  Requires-Dist: whitenoise<7.0,>=5.2
25
28
  Description-Content-Type: text/markdown
26
29
 
@@ -0,0 +1,22 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the PACKAGE package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: PACKAGE VERSION\n"
10
+ "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2025-05-16 09:37+0000\n"
12
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "Language: \n"
16
+ "MIME-Version: 1.0\n"
17
+ "Content-Type: text/plain; charset=UTF-8\n"
18
+ "Content-Transfer-Encoding: 8bit\n"
19
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
+ #: apis_acdhch_default_settings/templates/base.html
21
+ msgid "Imprint"
22
+ msgstr "Impressum"
@@ -51,7 +51,7 @@ SPECTACULAR_SETTINGS: Dict[str, Any] = {
51
51
  "TITLE": "APIS generic API",
52
52
  "LICENSE": {"name": "MIT License", "url": "https://www.mit.edu/~amini/LICENSE.md"},
53
53
  "VERSION": "0.13",
54
- "DEFAULT_GENERATOR_CLASS": 'apis_core.generic.generators.CustomSchemaGenerator'
54
+ "DEFAULT_GENERATOR_CLASS": "apis_core.generic.generators.CustomSchemaGenerator",
55
55
  }
56
56
 
57
57
  # django-csp settings
@@ -66,7 +66,13 @@ CSP_DEFAULT_SRC = (
66
66
  "unpkg.com",
67
67
  "*.openstreetmap.org",
68
68
  )
69
- CSP_IMG_SRC = ["'self'", "*.acdh.oeaw.ac.at", "data:", "*.openstreetmap.org", "cdnjs.cloudflare.com"]
69
+ CSP_IMG_SRC = [
70
+ "'self'",
71
+ "*.acdh.oeaw.ac.at",
72
+ "data:",
73
+ "*.openstreetmap.org",
74
+ "cdnjs.cloudflare.com",
75
+ ]
70
76
 
71
77
  # Content Security Policy settings
72
78
  CSP_FRAME_ANCESTORS = ["https://*.pages.oeaw.ac.at/"]
@@ -102,6 +108,7 @@ MIDDLEWARE = [
102
108
  "django.middleware.security.SecurityMiddleware",
103
109
  "whitenoise.middleware.WhiteNoiseMiddleware",
104
110
  "django.contrib.sessions.middleware.SessionMiddleware",
111
+ "django.middleware.locale.LocaleMiddleware",
105
112
  "django.middleware.common.CommonMiddleware",
106
113
  "django.middleware.csrf.CsrfViewMiddleware",
107
114
  "django.contrib.auth.middleware.AuthenticationMiddleware",
@@ -135,7 +142,9 @@ TEMPLATES = [
135
142
 
136
143
  # https://docs.djangoproject.com/en/stable/ref/settings/#auth-password-validators
137
144
  AUTH_PASSWORD_VALIDATORS = [
138
- {"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
145
+ {
146
+ "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
147
+ },
139
148
  {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
140
149
  {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
141
150
  {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
@@ -143,7 +152,7 @@ AUTH_PASSWORD_VALIDATORS = [
143
152
 
144
153
  # Default primary key field type
145
154
  # https://docs.djangoproject.com/en/stable/ref/settings/#default-auto-field
146
- DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
155
+ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
147
156
 
148
157
  # Internationalization
149
158
  # https://docs.djangoproject.com/en/stable/topics/i18n/
@@ -179,7 +188,9 @@ ALLOWED_CIDR_NETS = ["10.0.0.0/8", "127.0.0.0/8"]
179
188
 
180
189
  # https://docs.djangoproject.com/en/stable/ref/settings/#databases
181
190
  # https://github.com/jazzband/dj-database-url
182
- DATABASES = {'default': dj_database_url.config(default='sqlite:///db.sqlite3', conn_max_age=600)}
191
+ DATABASES = {
192
+ "default": dj_database_url.config(default="sqlite:///db.sqlite3", conn_max_age=600)
193
+ }
183
194
 
184
195
  # https://docs.djangoproject.com/en/stable/ref/settings/#allowed-hosts
185
196
  ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
@@ -205,10 +216,10 @@ if os.environ.get("AUTH_LDAP_USER_LIST", False):
205
216
  LOGGING = {
206
217
  "version": 1,
207
218
  "disable_existing_loggers": False,
208
- 'formatters': {
209
- 'verbose': {
210
- 'format': '%(asctime)s %(name)-6s %(levelname)-8s %(message)s',
211
- },
219
+ "formatters": {
220
+ "verbose": {
221
+ "format": "%(asctime)s %(name)-6s %(levelname)-8s %(message)s",
222
+ },
212
223
  },
213
224
  "handlers": {
214
225
  "console": {
@@ -0,0 +1,12 @@
1
+ {% extends "base.html" %}
2
+ {% load i18n %}
3
+ {% block meta %}
4
+ {{ block.super }}
5
+ <meta name="monitoring" content="Icinga Check">
6
+ {% endblock meta %}
7
+ {% block imprint %}
8
+ {% url "imprint" as imprint_url %}
9
+ {% if imprint_url %}
10
+ <a href="{{ imprint_url }}">{% translate "Imprint" %}</a>
11
+ {% endif %}
12
+ {% endblock imprint %}
@@ -0,0 +1,9 @@
1
+ {% extends basetemplate|default:"base.html" %}
2
+ {% block title %}Imprint{% endblock %}
3
+ {% block content %}
4
+ <div class="container">
5
+ <div class="card imprint">
6
+ <div class="card-body">{{ imprint|safe }}</div>
7
+ </div>
8
+ </div>
9
+ {% endblock %}
@@ -12,9 +12,7 @@ from apis_core.apis_entities.api_views import GetEntityGeneric
12
12
  urlpatterns = [
13
13
  path("apis/", include("apis_core.urls", namespace="apis")),
14
14
  path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
15
- path(
16
- "entity/<int:pk>/", GetEntityGeneric.as_view(), name="GetEntityGenericRoot"
17
- ),
15
+ path("entity/<int:pk>/", GetEntityGeneric.as_view(), name="GetEntityGenericRoot"),
18
16
  path("admin/", admin.site.urls),
19
17
  ]
20
18
  urlpatterns += staticfiles_urlpatterns()
@@ -7,13 +7,15 @@ from django.utils.decorators import method_decorator
7
7
  from django.conf import settings
8
8
 
9
9
 
10
- @method_decorator(cache_page(60 * 5), name='dispatch')
10
+ @method_decorator(cache_page(60 * 5), name="dispatch")
11
11
  class Imprint(TemplateView):
12
12
  template_name = "imprint.html"
13
13
 
14
14
  def get_context_data(self) -> str:
15
15
  ctx = super().get_context_data()
16
- base_url = getattr(settings, "ACDH_IMPRINT_URL", "https://imprint.acdh.oeaw.ac.at/")
16
+ base_url = getattr(
17
+ settings, "ACDH_IMPRINT_URL", "https://imprint.acdh.oeaw.ac.at/"
18
+ )
17
19
  redmine_id = getattr(settings, "REDMINE_ID", os.getenv("SERVICE_ID", ""))
18
20
 
19
21
  r = requests.get(f"{base_url}{redmine_id}")
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "apis-acdhch-default-settings"
3
- version = "2.7.0"
3
+ version = "2.8.0"
4
4
  description = "Default settings for APIS instances at the ACDH-CH"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -20,12 +20,46 @@ dependencies = [
20
20
  "opentelemetry-exporter-otlp",
21
21
  "opentelemetry-distro",
22
22
  "django-removals>=1.0.5,<=2.0",
23
+ "django>=5",
24
+ "apis-core-rdf>=0.40.0",
25
+ "requests>=2",
23
26
  ]
24
27
  [project.urls]
25
28
  source = "https://github.com/acdh-oeaw/apis-acdhch-default-settings"
26
29
  changelog = "https://github.com/acdh-oeaw/apis-acdhch-default-settings/blob/main/CHANGELOG.md"
27
30
  issues = "https://github.com/acdh-oeaw/apis-acdhch-default-settings/issues"
28
31
 
32
+ [tool.uv]
33
+ dev-dependencies = [
34
+ "deptry==0.23",
35
+ "djlint==1.36.4",
36
+ "ruff==0.11.2",
37
+ ]
38
+
29
39
  [build-system]
30
40
  requires = ["hatchling"]
31
41
  build-backend = "hatchling.build"
42
+
43
+ [tool.hatch.build.targets.wheel]
44
+ artifacts = ["**/*.mo"]
45
+
46
+ [tool.hatch.build.targets.sdist]
47
+ artifacts = ["**/*.mo"]
48
+
49
+ [tool.deptry.per_rule_ignores]
50
+ DEP002 = [
51
+ "django-allow-cidr",
52
+ "django-csp",
53
+ "whitenoise",
54
+ "django-removals",
55
+ "opentelemetry-instrumentation-asgi",
56
+ "opentelemetry-instrumentation-wsgi",
57
+ "opentelemetry-instrumentation-django",
58
+ "opentelemetry-instrumentation-logging",
59
+ "opentelemetry-instrumentation-psycopg2",
60
+ "opentelemetry-exporter-otlp",
61
+ "opentelemetry-distro"
62
+ ]
63
+
64
+ [tool.deptry.package_module_name_map]
65
+ apis-core-rdf = "apis_core"
@@ -1,12 +0,0 @@
1
- {% extends "base.html" %}
2
- {% load i18n %}
3
-
4
- {% block meta %}
5
- {{ block.super }}
6
- <meta name="monitoring" content="Icinga Check">
7
- {% endblock meta %}
8
-
9
- {% block imprint %}
10
- {% url "imprint" as imprint_url %}
11
- {% if imprint_url %}<a href="{{ imprint_url }}">{% translate "Imprint" %}</a>{% endif %}
12
- {% endblock imprint %}
@@ -1,11 +0,0 @@
1
- {% extends basetemplate|default:"base.html" %}
2
-
3
- {% block title %}Imprint{% endblock %}
4
-
5
- {% block content %}
6
- <div class="container">
7
- <div class="card imprint">
8
- <div class="card-body">{{ imprint|safe }}</div>
9
- </div>
10
- </div>
11
- {% endblock %}