Skip to content

Commit 3afbb3d

Browse files
authored
Merge branch 'master' into issue/change-default-filter-backend
2 parents b42f73b + f606ef9 commit 3afbb3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1155
-253
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# Black update
1+
# style: apply ruff isort and format
22
de05ba4ccf2c9a3c929705cee6f517bf74361a2c
3+
c2675d07be248a07b111faead0623af9aa3ea6d3

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,15 @@ jobs:
8989
docker compose exec --user root web pip install factory-boy
9090
cat performance_test/create_data.py | docker compose exec -T web src/manage.py shell
9191
92+
- name: Run Locust tests
93+
run: |
94+
pip install locust
95+
locust --config performance_test/locust.conf
96+
9297
- name: Run tests
9398
run: |
9499
pip install -r requirements/ci.txt
95-
pytest performance_test/ --benchmark-json output.json
100+
pytest -v performance_test/test_objects_list.py --benchmark-json output.json
96101
97102
docs:
98103
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ local.py
3030
/static/
3131
/mail/
3232
/log/*.log*
33+
/log/*.jsonl*
3334
/log/nginx/*.log*
3435
.env
3536

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.11.10
5+
hooks:
6+
# Run the linter.
7+
- id: ruff
8+
# Run the formatter.
9+
- id: ruff-format

CHANGELOG.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ Change history
2828

2929
* Upgrade dev dependencies
3030

31-
* django-webtest to 1.9.13
31+
* django-webtest to 1.9.13
3232

3333
* Upgrade npm packages to fix vulnerabilities
3434
* Fixed admin logout button
3535
* [:objects-api:`550`] Implement cache for objecttypes
36-
* [:objects-api:`550`] add OBJECTTYPE_VERSION_CACHE_TIMEOUT environment variable `documentation <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config.html#cache>`_
37-
* [:objects-api:`572`] Add db connection pooling environment variables `documentation <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config.html#database>`_
36+
* [:objects-api:`550`] add OBJECTTYPE_VERSION_CACHE_TIMEOUT environment variable (see `documentation for environment variables for caching <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config.html#cache>`_)
37+
* [:objects-api:`572`] Add db connection pooling environment variables (see `documentation for environment variables for database <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config.html#database>`_)
3838

3939
* DB_POOL_ENABLED
4040
* DB_POOL_MIN_SIZE
@@ -46,7 +46,7 @@ Change history
4646
* DB_POOL_RECONNECT_TIMEOUT
4747
* DB_POOL_NUM_WORKERS
4848

49-
* [:objects-api:`566`] Add DB_CONN_MAX_AGE environment variable `documentation <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config.html#database>`_
49+
* [:objects-api:`566`] Add DB_CONN_MAX_AGE environment variable (see `documentation for environment variables for database <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config.html#database>`_)
5050

5151
3.0.3 (2025-04-03)
5252
------------------
@@ -132,8 +132,7 @@ Change history
132132
.. warning::
133133

134134
Previous configuration files used for ``setup_configuration`` do not work.
135-
See the `documentation <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config_cli.html>`_
136-
for the available settings that can now be configured through ``setup_configuration``.
135+
See :ref:`installation_config_cli` for the available settings that can now be configured through ``setup_configuration``.
137136

138137
* added support for configuring permissions through ``django-setup-configuration``
139138
version ``0.4.0`` [#497]
@@ -246,7 +245,7 @@ Change history
246245
* bumped python dependencies due to security issues: django, celery, certifi, maykin-2fa, mozilla-django-oidc-db,
247246
sentry-sdk, webob and others (#428)
248247
* bumped ``zgw-consumers`` to 0.29.0 and updated a code for clients, because of zgw-consumers breaking change.
249-
* paginated ``/api/v2/objects/{uuid}/history``endpoint (#329)
248+
* paginated ``/api/v2/objects/{uuid}/history`` endpoint (#329)
250249
* fixed ``"register_kanalen`` command (#426)
251250
* fixed notification page link (open-zaak/open-notificaties#171)
252251

@@ -307,7 +306,7 @@ Change history
307306
* changed caching backend from LocMem to Redis
308307
* Elastic APM service name can now be configured with ``ELASTIC_APM_SERVICE_NAME`` envvar
309308

310-
** Documentation**
309+
**Documentation**
311310

312311
* added security policy (#390)
313312
* updated Quick start documentation (#348)

CONTRIBUTING.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,22 @@ other developers to give tips even before you start coding.
2121

2222
To keep the code clean and readable, this project uses:
2323

24-
- [`isort`](https://github.com/timothycrosley/isort) to order the imports
25-
- [`black`](https://github.com/psf/black) to format the code and keep diffs for
26-
pull requests small
27-
- [`flake8`](https://github.com/PyCQA/flake8) to clean up code (removing unused
28-
imports, etc.)
29-
30-
Whenever a branch is pushed or a pull request is made, the code will be checked
31-
in CI by the tools mentioned above, so make sure to install these tools and run
32-
them locally before pushing branches/making pull requests.
24+
- [`ruff`](https://docs.astral.sh/ruff/) to format and clean up code (removing unused imports, etc.)
25+
26+
Whenever a branch is pushed or a pull request is made, the code will be checked in CI by Ruff, so
27+
make sure to install and run it locally before pushing branches/making pull requests.
28+
29+
The project includes a [pre-commit](https://pre-commit.com) configuration to automatically
30+
create a pre-commit hook to apply the expected style formatting. After installing
31+
the dev dependencies, simply do:
32+
33+
```
34+
$ pre-commit install
35+
```
36+
37+
Now the various formatting hooks will be run automatically as a pre-commit hook. You
38+
can pass `--no-verify` to `git commit` to disable these checks for a specific commit
39+
during development (but keep in mind CI won't pass until your code conforms).
3340

3441
This project aims to meet the criteria of the
3542
[Standard for Public Code][Standard_for_Public_Code]. Please make sure that

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Stage 1 - Compile needed python dependencies
22
FROM python:3.11-slim-bookworm AS backend-build
33

4-
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
55
pkg-config \
66
build-essential \
77
git \
88
libpq-dev \
9+
# required for (log) routing support in uwsgi
10+
libpcre3 \
11+
libpcre3-dev \
912
&& rm -rf /var/lib/apt/lists/*
1013

1114

@@ -37,13 +40,14 @@ FROM python:3.11-slim-bookworm AS production
3740

3841
# Stage 3.1 - Set up the needed production dependencies
3942
# install all the dependencies for GeoDjango
40-
RUN apt-get update && apt-get install -y --no-install-recommends \
43+
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
4144
postgresql-client \
4245
binutils \
4346
libproj-dev \
4447
gdal-bin \
4548
libgdal-dev \
4649
gettext \
50+
libpcre3 \
4751
&& rm -rf /var/lib/apt/lists/*
4852

4953
RUN pip install pip "setuptools>=70.0.0"
@@ -60,6 +64,7 @@ COPY ./bin/celery_worker.sh /celery_worker.sh
6064
COPY ./bin/celery_flower.sh /celery_flower.sh
6165
COPY ./bin/check_celery_worker_liveness.py ./bin/
6266
COPY ./bin/setup_configuration.sh /setup_configuration.sh
67+
COPY ./bin/uwsgi.ini /
6368
RUN mkdir /app/log /app/config /app/tmp
6469

6570
# copy frontend build statics

INSTALL.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ development machine.
5454
$ virtualenv env
5555
$ source env/bin/activate
5656
$ pip install -r requirements/dev.txt
57+
$ pre-commit install
5758
5859
4. Install all required (frontend) libraries and build static files.
5960

README.NL.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Zie: `Alle versies en wijzigingen <https://github.com/maykinmedia/objects-api/bl
7676
Referentie implementatie
7777
========================
7878

79-
|build-status| |coverage| |black| |docker| |python-versions|
79+
|build-status| |coverage| |ruff| |docker| |python-versions|
8080

8181
De referentie implementatie toont de API in actie en kan gebruikt worden voor
8282
test en demonstratie doeleinden. De referentie implementatie is open source,
@@ -136,9 +136,9 @@ Licensed under the EUPL_
136136
:alt: Coverage
137137
:target: https://codecov.io/gh/maykinmedia/objects-api
138138

139-
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
140-
:alt: Code style
141-
:target: https://github.com/psf/black
139+
.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
140+
:target: https://github.com/astral-sh/ruff
141+
:alt: Ruff
142142

143143
.. |docker| image:: https://images.microbadger.com/badges/image/maykinmedia/objects-api.svg
144144
:alt: Docker image

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ See: `All versions and changes <https://github.com/maykinmedia/objects-api/blob/
7474
Reference implementation
7575
========================
7676

77-
|build-status| |coverage| |black| |docker| |python-versions|
77+
|build-status| |coverage| |ruff| |docker| |python-versions|
7878

7979
The reference implementation is used to demonstrate the API in action and can
8080
be used for test and demo purposes. The reference implementation is open source,
@@ -134,9 +134,9 @@ Licensed under the EUPL_
134134
:alt: Coverage
135135
:target: https://codecov.io/gh/maykinmedia/objects-api
136136

137-
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
138-
:alt: Code style
139-
:target: https://github.com/psf/black
137+
.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
138+
:target: https://github.com/astral-sh/ruff
139+
:alt: Ruff
140140

141141
.. |docker| image:: https://images.microbadger.com/badges/image/maykinmedia/objects-api.svg
142142
:alt: Docker image

0 commit comments

Comments
 (0)