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 to Black 24 #2879

Merged
merged 5 commits into from
Jan 26, 2024
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 backend/dependencies/RefGeo
2 changes: 1 addition & 1 deletion backend/dependencies/TaxHub
Submodule TaxHub updated 24 files
+31 −5 .github/workflows/pytest.yml
+1 −0 apptax/migrations/versions/188bc535258a_drop_old_status_table.py
+1 −0 apptax/migrations/versions/1b1a3f5cd107_add_table_to_link_bdc_status_and_ref_geo.py
+1 −0 apptax/migrations/versions/23c25552d707_create_bdc_status_table_if_not_exists.py
+1 −0 apptax/migrations/versions/27fd7e2b4b79_add_vm_taxref_list_forautocomplete_index.py
+1 −0 apptax/migrations/versions/32c5ed42bdbd_add_table_t_meta_taxref.py
+1 −0 apptax/migrations/versions/33e20a7682b4_check_group3_inpn_vm_function.py
+1 −0 apptax/migrations/versions/3bd542b72955_optimize_vm_taxref_for_autocomplete.py
+1 −0 apptax/migrations/versions/3fe8c07741be_taxhub_admin.py
+1 −0 apptax/migrations/versions/4a549132d156_add_unique_constraints.py
+1 −0 apptax/migrations/versions/4fb7e197d241_fix_v_bdc_status_view.py
+1 −0 apptax/migrations/versions/64d38dbe7739_taxonomie.py
+1 −0 apptax/migrations/versions/6607b25b2d66_taxref_set_null_to_empty_string.py
+1 −0 apptax/migrations/versions/7540702c6407_cd_ref_utility_functions.py
+1 −0 apptax/migrations/versions/8f3256f60915_group3_inpn_autocomplete.py
+1 −0 apptax/migrations/versions/98035939bc0d_find_all_taxons_parents.py
+1 −0 apptax/migrations/versions/9c2c0254aadc_create_taxonomie_schema.py
+1 −0 apptax/migrations/versions/c4415009f164_taxref_v15_db_structure.py
+1 −0 apptax/migrations/versions/c93cbb35cfe4_set_default_value_for_id_liste.py
+1 −0 apptax/migrations/versions/d768a5da908c_add_bdc_status_indexes.py
+1 −0 apptax/migrations/versions/f2c36312b3de_fix_vm_taxref_for_autocomplete.py
+1 −0 apptax/migrations/versions/fa5a90853c45_taxhub.py
+16 −23 apptax/taxonomie/models.py
+1 −1 requirements-common.in
1 change: 1 addition & 0 deletions backend/geonature/core/gn_commons/medias/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Route permettant de manipuler les fichiers
contenus dans gn_media
"""

from flask import request, redirect, jsonify
from werkzeug.exceptions import NotFound

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Modèles du schéma gn_commons
"""

from sqlalchemy.dialects.postgresql import JSONB

from utils_flask_sqla.serializers import serializable
Expand Down
1 change: 1 addition & 0 deletions backend/geonature/core/gn_commons/models/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Modèles du schéma gn_commons
"""

import os
from pathlib import Path
from collections import defaultdict
Expand Down
8 changes: 5 additions & 3 deletions backend/geonature/core/gn_meta/mtd/mtd_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ def sync_ds(ds, cd_nomenclatures):

ds["id_acquisition_framework"] = af.id_acquisition_framework
ds = {
k: func.ref_nomenclatures.get_id_nomenclature(NOMENCLATURE_MAPPING[k], v)
if k.startswith("id_nomenclature")
else v
k: (
func.ref_nomenclatures.get_id_nomenclature(NOMENCLATURE_MAPPING[k], v)
if k.startswith("id_nomenclature")
else v
)
for k, v in ds.items()
if v is not None
}
Expand Down
25 changes: 13 additions & 12 deletions backend/geonature/core/gn_meta/routes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Routes for gn_meta
"""

import datetime as dt
import json
import logging
Expand Down Expand Up @@ -679,20 +680,20 @@
acquisition_framework["chart"] = request.json["chart"]

if acquisition_framework:
acquisition_framework[
"nomenclature_territorial_level"
] = af.nomenclature_territorial_level.as_dict()
acquisition_framework[
"nomenclature_financing_type"
] = af.nomenclature_financing_type.as_dict()
acquisition_framework["nomenclature_territorial_level"] = (
af.nomenclature_territorial_level.as_dict()
)
acquisition_framework["nomenclature_financing_type"] = (
af.nomenclature_financing_type.as_dict()
)
if acquisition_framework["acquisition_framework_start_date"]:
acquisition_framework[
"acquisition_framework_start_date"
] = af.acquisition_framework_start_date.strftime("%d/%m/%Y")
acquisition_framework["acquisition_framework_start_date"] = (
af.acquisition_framework_start_date.strftime("%d/%m/%Y")
)
if acquisition_framework["acquisition_framework_end_date"]:
acquisition_framework[
"acquisition_framework_end_date"
] = af.acquisition_framework_end_date.strftime("%d/%m/%Y")
acquisition_framework["acquisition_framework_end_date"] = (

Check warning on line 694 in backend/geonature/core/gn_meta/routes.py

View check run for this annotation

Codecov / codecov/patch

backend/geonature/core/gn_meta/routes.py#L694

Added line #L694 was not covered by tests
af.acquisition_framework_end_date.strftime("%d/%m/%Y")
)
acquisition_framework["css"] = {
"logo": "Logo_pdf.png",
"bandeau": "Bandeau_pdf.png",
Expand Down
1 change: 1 addition & 0 deletions backend/geonature/core/gn_permissions/decorators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Decorators to protects routes with permissions
"""

from functools import wraps
from warnings import warn

Expand Down
1 change: 1 addition & 0 deletions backend/geonature/core/gn_permissions/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Models of gn_permissions schema
"""

from packaging import version

import sqlalchemy as sa
Expand Down
1 change: 1 addition & 0 deletions backend/geonature/core/gn_synthese/utils/process.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
functions to insert update or delete data in table gn_synthese.synthese
"""

from sqlalchemy.exc import IntegrityError, ProgrammingError
from geonature.utils.env import DB
from geonature.utils.errors import GeonatureApiError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
https://docs.sqlalchemy.org/en/latest/core/tutorial.html#selecting
much more efficient
"""

import datetime
import unicodedata
import uuid
Expand Down
1 change: 1 addition & 0 deletions backend/geonature/core/notifications/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Models of gn_notifications schema
"""

import datetime

import sqlalchemy as sa
Expand Down
1 change: 1 addition & 0 deletions backend/geonature/core/users/register_post_actions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Action triggered after register action (create temp user, change password etc...)
"""

import datetime
from warnings import warn

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-02-21 17:17:03.016130

"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Create Date: 2023-04-13 14:24:21.124669

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-07-13 12:34:42.450453

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-03-17 10:57:34.730596

"""

from alembic import op
import sqlalchemy as sa
from utils_flask_sqla.migrations.utils import logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-01-13 09:55:53.525869

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-01-25 18:01:06.482391

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Create Date: 2021-09-27 22:58:27.235271

"""

import os.path
from zipfile import ZipFile
from urllib.parse import urlsplit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-02-15 17:45:54.259412

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-10-26 10:28:03.196912

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-10-06 15:55:37.365073

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-08-24 11:10:08.973033

"""

import importlib.resources

from alembic import op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-11-25 12:58:47.583031

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-01-21 10:51:15.288875

"""

from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import InternalError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-09-22 09:58:19.055808

"""

import datetime
from alembic import op
from sqlalchemy import Column, ForeignKey, Integer, Unicode, UnicodeText, DateTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Create Date: 2021-09-27 18:00:45.818766

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-04-05 16:22:57.078076

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-09-25 10:09:39.126531

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-01-04 16:02:45.953579

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-09-21 18:11:27.597095

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-12-05 14:46:04.206294

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-08-08 16:23:53.059110

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-02-20 17:49:03.156681

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-10-07 15:27:06.364487

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-16 15:26:52.658472

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-02-15 15:23:08.732729

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-01-03 15:36:45.053127

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-09-27 22:33:47.462525

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-11-08 10:59:23.047142

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-05-19 15:07:04.613778

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-04-27 17:00:38.070394

"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Create Date: 2021-11-22

"""

import csv
import importlib.resources
from functools import lru_cache, partial
Expand Down
Loading
Loading