From ad357e3f2a5a1729b1296786aedfb835bae29671 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 15:07:32 +0100 Subject: [PATCH 01/35] fix: rollback to postgis image for postgres container, the trawlwatcher if in private repository and maybe not conform with alembic --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 17bfdeef..6a61dc6a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,7 +26,7 @@ services: postgres: container_name: postgres_bloom - image: docker.pkg.github.com/wbarillon/docker-packages/trawlwatcher_local_db:0.2 + image: ${POSTGIS_IMAGE:-postgis/postgis:14-3.3-alpine} environment: <<: *common-env ports: From df83846abca416412fa67ea93dd020a303394935 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Fri, 8 Mar 2024 11:07:32 +0100 Subject: [PATCH 02/35] feat: add BLOOM_CONFIG management in bloom.config # Conflicts: # bloom/bloom/config.py --- bloom/bloom/config.py | 120 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 99 insertions(+), 21 deletions(-) diff --git a/bloom/bloom/config.py b/bloom/bloom/config.py index 0464462f..6d89434c 100644 --- a/bloom/bloom/config.py +++ b/bloom/bloom/config.py @@ -1,30 +1,108 @@ import os +from pathlib import Path from pydantic import BaseSettings -class Settings(BaseSettings): - postgres_user = os.environ.get("POSTGRES_USER") - postgres_password = os.environ.get("POSTGRES_PASSWORD") - postgres_hostname = os.environ.get("POSTGRES_HOSTNAME") - postgres_port = os.environ.get("POSTGRES_PORT") - postgres_db = os.environ.get("POSTGRES_DB") - - #print("db_url: ", f"postgresql://{postgres_user}:{postgres_password}@{postgres_hostname}:" - # f"{postgres_port}/{postgres_db}") +def extract_values_from_env(config:dict,allow_extend:bool=False) -> dict: + """ function that extrat key=value pairs from a file + Parameters: + - config: dict to extend/update with new key/value pairs found in environment + - allow_extend: allows to extend extracted keys with new keys that are not in + actuel config if True, restrict to already existing keys in config of False + Returns a dict contains key/value + """ + for k,v in os.environ.items(): + # Processing of indirect affectation via [ATTR]_FILE=VALUE_PATH => ATTR=VALUE + if k.lower() in [f"{k}_FILE".lower() for k in config.keys()]\ + and ( k.removesuffix('_FILE').lower() in config.keys() or allow_extend == True)\ + and Path(v).is_file(): + with Path.open(v, mode='r') as file: + config[k.removesuffix('_FILE').lower()]=file.readline().strip() + # Processing of direct affectation via ATTR=VALUE + # if extracted key already exist in config OR if allowed to add new keys to config + # Then adding/updating key/value + if k.lower() in [k.lower() for k in config.keys()] or allow_extend == True: + config[k.lower()]=v + return config - db_url = ( - "postgresql://" - f"{postgres_user}" - ":" - f"{postgres_password}" - "@" - f"{postgres_hostname}" - ":" - f"{postgres_port}" - "/" - f"{postgres_db}" - ) +def extract_values_from_file(filename:str,config:dict, + allow_extend:bool=False, + env_priority:bool=True + )-> dict: + """ function that extrat key=value pairs from a file + Parameters: + - filename: filename/filepath from which to extract key/value pairs found in .env.* file + - config: dict to extend/update with new key/value pairs + - allow_extend: allows to extend extracted keys with new keys that are not in actuel + config if True, restrict to already existing keys in config of False + Returns a dict contains key/value + """ + filepath=Path(Path(__file__).parent).joinpath(filename) + with Path.open(filepath) as file: + for line in file: + # Split line at first occurence of '='. + # This allows to have values containing '=' character + split=line.strip().split('=',1) + # if extraction contains 2 items and strictly 2 items + split_succeed=2 + if(len(split)==split_succeed): + k=split[0] + v=split[1] + # Processing of indirect affectation via [ATTR]_FILE=VALUE_PATH => ATTR=VALUE + if k.lower() in [f"{k}_FILE".lower() for k in config.keys()]\ + and ( k.removesuffix('_FILE').lower() in config.keys() or allow_extend == True)\ + and Path(v).is_file(): + with Path(v).open( mode='r') as file_value: + config[k.removesuffix('_FILE').lower()]=file_value.readline().strip() + # if extracted key already exist in config OR if allowed to add new keys to + # config then adding/updating key/value + if k.lower() in [k.lower() for k in config.keys()] or allow_extend == True: + config[k.lower()]=v + # If env priority True, then overriding all values with ENV values before ending + if env_priority: + extract_values_from_env(config,allow_extend=False) + return config + +class Settings(BaseSettings): + # Déclaration des attributs/paramètres disponibles au sein de la class settings + postgres_user:str = None + postgres_password:str = None + postgres_hostname:str = None + postgres_port:str = None + postgres_db:str = None srid: int = 4326 + db_url:str = None + spire_toekn:str = None + + def __init__(self): + super().__init__(self) + # Default values + srid: int = 4326 + + # Si le fichier de configuration à charger est précisé par la variable d'environnement + # BLOOM_CONFIG alors on charge ce fichier, sinon par défaut c'est ../.env + BLOOM_CONFIG=os.getenv('BLOOM_CONFIG',"../../.env") + + # Ici on charge les paramètres à partir du fichier BLOOM_CONFIG + # et on mets à jour directement les valeurs des paramètres en tant qu'attribut de la + # la classe courante Settings en attanquant le self.__dict__ + # Ces variables sont systmétiquement convertie en lower case + # + # allow_extend=False précise que seuls les attributs déjà existants dans la config + # passée en paramètres (ici self.__dict__) sont mis à jour. Pas de nouveau paramètres + # Cela singifie que pour rendre accessible un nouveau paramètre il faut le déclaré + # dans la liste des attributs de la classe Settings + # + # env_priority=true signifie que si un paramètres est présent dans la classe Settings, + # mas aussi dans le fichier BLOOM_CONFIG ainsi qu'en tant que variable d'environnement + # alors c'est la valeur de la variable d'environnement qui sera chargée au final + # La priorité est donnée aux valeur de l'environnement selon le standard Docker + extract_values_from_file(APP_CONFIG,self.__dict__,allow_extend=False,env_priority=True) + + self.db_url = ( f"postgresql://{self.postgres_user}:" + f"{self.postgres_password}@{self.postgres_host}:" + f"{self.postgres_port}/{self.postgres_db}") + settings = Settings() From 744d2f14f96b56bc8011af5b97ccee44e7f3a32e Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 14:52:24 +0100 Subject: [PATCH 03/35] =?UTF-8?q?fix:=20some=20mixed=20values,=20d=C3=A9fi?= =?UTF-8?q?ne=20standard=20POSTGRES=5FHOSTNAME=20=3D>=20POSTGRES=5FHOST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bloom/.env.template | 2 +- bloom/Makefile | 4 ++-- bloom/docs/notes/database.initialisation.md | 2 +- bloom/docs/notes/development.environment.md | 2 +- docker-compose.yaml | 2 +- tox.ini | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bloom/.env.template b/bloom/.env.template index 32778649..42ee3f6e 100644 --- a/bloom/.env.template +++ b/bloom/.env.template @@ -1,5 +1,5 @@ # these values are used in the local docker env. You can use "localhost" hostname if you run the application without docker -POSTGRES_HOSTNAME=postgres_bloom +POSTGRES_HOST=postgres_bloom POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom POSTGRES_DB=bloom_db diff --git a/bloom/Makefile b/bloom/Makefile index 1db006e2..47286bf2 100644 --- a/bloom/Makefile +++ b/bloom/Makefile @@ -48,7 +48,7 @@ launch-production-app: $(BLOOM_PRODUCTION_DOCKER) --name bloom-production-app --rm d4g/bloom:${VERSION} /venv/bin/python3 app.py dump-dev-db: - $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' + $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOST -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' dump-db: - @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file + @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOST -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file diff --git a/bloom/docs/notes/database.initialisation.md b/bloom/docs/notes/database.initialisation.md index 51cb8e08..205c55e2 100644 --- a/bloom/docs/notes/database.initialisation.md +++ b/bloom/docs/notes/database.initialisation.md @@ -15,4 +15,4 @@ The second step is to load the [distance-from-port-v20201104.tiff](https://globa - install psql and raster2pgsql. - install raster type in db with postgis-raster using `create extension postgis_raster` -- adapt this command for each file : `raster2pgsql -t auto -I -C -M /PATH_TO/distance-from-shore.tif public.distance_shore | PGPASSWORD='POSTGRES_PASSWORD' psql -h POSTGRES_HOSTNAME -d POSTGRES_DB -U POSTGRES_USER -p POSTGRES_PORT` +- adapt this command for each file : `raster2pgsql -t auto -I -C -M /PATH_TO/distance-from-shore.tif public.distance_shore | PGPASSWORD='POSTGRES_PASSWORD' psql -h POSTGRES_HOST -d POSTGRES_DB -U POSTGRES_USER -p POSTGRES_PORT` diff --git a/bloom/docs/notes/development.environment.md b/bloom/docs/notes/development.environment.md index 9d3ebcf5..2ab32d34 100644 --- a/bloom/docs/notes/development.environment.md +++ b/bloom/docs/notes/development.environment.md @@ -15,7 +15,7 @@ If you work with Mac m1, the containers may not work as expected ## Local Database -You will need to source the .env.template file but before you should modify it according to your local configuration, for example using POSTGRES_HOSTNAME=localhost +You will need to source the .env.template file but before you should modify it according to your local configuration, for example using POSTGRES_HOST=localhost ## Development Database diff --git a/docker-compose.yaml b/docker-compose.yaml index 6a61dc6a..86968790 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,7 @@ x-common-infos: # Env variables stored in a .env file at same level than docker-compose.yaml environment: &common-env - POSTGRES_HOSTNAME: ${POSTGRES_HOSTNAME} + POSTGRES_HOST: ${POSTGRES_HOST} POSTGRES_PORT: ${POSTGRES_PORT} POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} diff --git a/tox.ini b/tox.ini index f764c039..12dac3ab 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ commands = setenv = POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom - POSTGRES_HOSTNAME=postgres + POSTGRES_HOST=postgres POSTGRES_DB=bloom_db POSTGRES_PORT=5432 SLACK_URL=https://hooks.slack.com/services/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 From 587f9a188c213fb965c62ad8d7d925b1b3b99633 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 14:58:52 +0100 Subject: [PATCH 04/35] fix: conformisation of POSTGRES_HOSTNAME instead of POSTGRES_HOST --- bloom/.env.template | 2 +- bloom/Makefile | 4 ++-- bloom/bloom/config.py | 2 +- bloom/docs/notes/database.initialisation.md | 2 +- bloom/docs/notes/development.environment.md | 2 +- docker-compose.yaml | 2 +- tox.ini | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bloom/.env.template b/bloom/.env.template index 42ee3f6e..32778649 100644 --- a/bloom/.env.template +++ b/bloom/.env.template @@ -1,5 +1,5 @@ # these values are used in the local docker env. You can use "localhost" hostname if you run the application without docker -POSTGRES_HOST=postgres_bloom +POSTGRES_HOSTNAME=postgres_bloom POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom POSTGRES_DB=bloom_db diff --git a/bloom/Makefile b/bloom/Makefile index 47286bf2..1db006e2 100644 --- a/bloom/Makefile +++ b/bloom/Makefile @@ -48,7 +48,7 @@ launch-production-app: $(BLOOM_PRODUCTION_DOCKER) --name bloom-production-app --rm d4g/bloom:${VERSION} /venv/bin/python3 app.py dump-dev-db: - $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOST -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' + $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' dump-db: - @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOST -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file + @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file diff --git a/bloom/bloom/config.py b/bloom/bloom/config.py index 6d89434c..8d297d0a 100644 --- a/bloom/bloom/config.py +++ b/bloom/bloom/config.py @@ -101,7 +101,7 @@ def __init__(self): extract_values_from_file(APP_CONFIG,self.__dict__,allow_extend=False,env_priority=True) self.db_url = ( f"postgresql://{self.postgres_user}:" - f"{self.postgres_password}@{self.postgres_host}:" + f"{self.postgres_password}@{self.postgres_hostname}:" f"{self.postgres_port}/{self.postgres_db}") diff --git a/bloom/docs/notes/database.initialisation.md b/bloom/docs/notes/database.initialisation.md index 205c55e2..51cb8e08 100644 --- a/bloom/docs/notes/database.initialisation.md +++ b/bloom/docs/notes/database.initialisation.md @@ -15,4 +15,4 @@ The second step is to load the [distance-from-port-v20201104.tiff](https://globa - install psql and raster2pgsql. - install raster type in db with postgis-raster using `create extension postgis_raster` -- adapt this command for each file : `raster2pgsql -t auto -I -C -M /PATH_TO/distance-from-shore.tif public.distance_shore | PGPASSWORD='POSTGRES_PASSWORD' psql -h POSTGRES_HOST -d POSTGRES_DB -U POSTGRES_USER -p POSTGRES_PORT` +- adapt this command for each file : `raster2pgsql -t auto -I -C -M /PATH_TO/distance-from-shore.tif public.distance_shore | PGPASSWORD='POSTGRES_PASSWORD' psql -h POSTGRES_HOSTNAME -d POSTGRES_DB -U POSTGRES_USER -p POSTGRES_PORT` diff --git a/bloom/docs/notes/development.environment.md b/bloom/docs/notes/development.environment.md index 2ab32d34..9d3ebcf5 100644 --- a/bloom/docs/notes/development.environment.md +++ b/bloom/docs/notes/development.environment.md @@ -15,7 +15,7 @@ If you work with Mac m1, the containers may not work as expected ## Local Database -You will need to source the .env.template file but before you should modify it according to your local configuration, for example using POSTGRES_HOST=localhost +You will need to source the .env.template file but before you should modify it according to your local configuration, for example using POSTGRES_HOSTNAME=localhost ## Development Database diff --git a/docker-compose.yaml b/docker-compose.yaml index 86968790..6a61dc6a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,7 @@ x-common-infos: # Env variables stored in a .env file at same level than docker-compose.yaml environment: &common-env - POSTGRES_HOST: ${POSTGRES_HOST} + POSTGRES_HOSTNAME: ${POSTGRES_HOSTNAME} POSTGRES_PORT: ${POSTGRES_PORT} POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} diff --git a/tox.ini b/tox.ini index 12dac3ab..f764c039 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ commands = setenv = POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom - POSTGRES_HOST=postgres + POSTGRES_HOSTNAME=postgres POSTGRES_DB=bloom_db POSTGRES_PORT=5432 SLACK_URL=https://hooks.slack.com/services/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 From d6a5ad9b85cd5696e55921ab522a202455f50d6f Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 15:08:27 +0100 Subject: [PATCH 05/35] feat: add bloom config managerment for futur use (deployment) --- bloom/bloom/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bloom/bloom/config.py b/bloom/bloom/config.py index 8d297d0a..4315f9c2 100644 --- a/bloom/bloom/config.py +++ b/bloom/bloom/config.py @@ -82,7 +82,7 @@ def __init__(self): # Si le fichier de configuration à charger est précisé par la variable d'environnement # BLOOM_CONFIG alors on charge ce fichier, sinon par défaut c'est ../.env - BLOOM_CONFIG=os.getenv('BLOOM_CONFIG',"../../.env") + BLOOM_CONFIG=os.getenv('BLOOM_CONFIG',Path(__file__).parent.joinpath(".env")) # Ici on charge les paramètres à partir du fichier BLOOM_CONFIG # et on mets à jour directement les valeurs des paramètres en tant qu'attribut de la @@ -98,7 +98,10 @@ def __init__(self): # mas aussi dans le fichier BLOOM_CONFIG ainsi qu'en tant que variable d'environnement # alors c'est la valeur de la variable d'environnement qui sera chargée au final # La priorité est donnée aux valeur de l'environnement selon le standard Docker - extract_values_from_file(APP_CONFIG,self.__dict__,allow_extend=False,env_priority=True) + if Path(BLOOM_CONFIG).exists(): + extract_values_from_file(BLOOM_CONFIG,self.__dict__,allow_extend=False,env_priority=True) + else: + extract_values_from_env(self.__dict__,allow_extend=False) self.db_url = ( f"postgresql://{self.postgres_user}:" f"{self.postgres_password}@{self.postgres_hostname}:" From b19ca68610754b6d08de30b73dc31236c30dfdba Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 15:07:14 +0100 Subject: [PATCH 06/35] feat: add init container in docker compose file --- docker-compose.yaml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 6a61dc6a..a59ba9af 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,8 +9,11 @@ x-common-infos: services: bloom: - container_name: bloom-test - build: ./bloom/ + container_name: bloom + image: d4g/bloom:${VERSION:-latest} + build: + context: ./bloom/ + command: streamlit run Trawlwatcher.py volumes: - ./bloom:/source_code @@ -21,8 +24,8 @@ services: networks: - bloom_net depends_on: - postgres: - condition: service_healthy # The service is working and still running + init: + condition: service_completed_successfully postgres: container_name: postgres_bloom @@ -40,6 +43,31 @@ services: retries: 140 start_period: 0s + init: + container_name: init_bloom + hostname: init_bloom + image: d4g/bloom:${VERSION:-latest} + + # Nominal start: + command: alembic check + # Debug start: + #command: bash + #tty: true + #stdin_open: true + + environment: + <<: *common-env + volumes: + - ./bloom/data:/source_code/data + - ./bloom/alembic:/source_code/alembic + - ./bloom/alembic.ini:/source_code/alembic.ini + #- ./bloom/bloom:/source_code/bloom + networks: + - bloom_net + depends_on: + postgres: + condition: service_healthy # The service is working and still running + networks: bloom_net: name: bloom_net \ No newline at end of file From cc1f2d4e0f68c3d740bc43691480bf25d5ffb03c Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 14:52:24 +0100 Subject: [PATCH 07/35] fix: remove requirements.txt & rearrange pytoml + typo --- bloom/bloom/config.py | 2 +- pyproject.toml | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bloom/bloom/config.py b/bloom/bloom/config.py index 4315f9c2..392d28b3 100644 --- a/bloom/bloom/config.py +++ b/bloom/bloom/config.py @@ -73,7 +73,7 @@ class Settings(BaseSettings): postgres_db:str = None srid: int = 4326 db_url:str = None - spire_toekn:str = None + spire_token:str = None def __init__(self): super().__init__(self) diff --git a/pyproject.toml b/pyproject.toml index 3bd53d6b..1a36901f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,33 +9,33 @@ description = "Bloom scrapping application" authors = ["Your Name "] [tool.poetry.dependencies] -python = "^3.10" -poetry = "^1.8" +alembic = "^1.10.2" autopep8 = "1.5.4" -pandas = "1.4.4" -selenium = "4.18.1" -undetected-chromedriver = "3.4.6" +dependency-injector = "^4.41.0" +dependency_injection = "1.2.0" +folium = "^0.14.0" +geoalchemy2 = "^0.13.1" +geopandas = "0.14.3" +geopy = "^2.4.0" +gql = "^3.4.0" +matplotlib = "^3.8.0" openpyxl = "^3.1.0" +pandas = "1.4.4" +poetry = "^1.8" +psycopg2-binary = "^2.9.6" pydantic = "1.10.14" +python = "^3.10" +python-dotenv = "^1.0.0" pyyaml = "^6.0" -shapely = "2.0.1" -geopandas = "0.14.3" -sqlalchemy = "^2.0" -alembic = "^1.10.2" -geoalchemy2 = "^0.13.1" -psycopg2-binary = "^2.9.6" -dependency-injector = "^4.41.0" -dependency_injection = "1.2.0" requests = "^2.31" -gql = "^3.4.0" requests-toolbelt = "^1.0" +selenium = "4.18.1" +shapely = "2.0.1" slack-sdk = "^3.21.3" -folium = "^0.14.0" -matplotlib = "^3.8.0" -geopy = "^2.4.0" +sqlalchemy = "^2.0" streamlit = "^1.27.2" streamlit-folium = "^0.15.0" -python-dotenv = "^1.0.0" +undetected-chromedriver = "3.4.6" [tool.poetry.group.dev.dependencies] From 2e78ff71047653ca7b79ae5243bacd714d605f25 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 15:05:22 +0100 Subject: [PATCH 08/35] fix: conformization of settings acces via bloom.config --- bloom/alembic/env.py | 27 +++---------------- bloom/alembic/init_script/load_amp_data.py | 25 +++-------------- .../init_script/load_positions_data.py | 23 ++-------------- .../alembic/init_script/load_vessels_data.py | 22 ++------------- 4 files changed, 10 insertions(+), 87 deletions(-) diff --git a/bloom/alembic/env.py b/bloom/alembic/env.py index 1d2331a6..8d6eb49c 100644 --- a/bloom/alembic/env.py +++ b/bloom/alembic/env.py @@ -5,6 +5,8 @@ from alembic import context +from bloom.config import settings + # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config @@ -18,30 +20,7 @@ # for 'autogenerate' support target_metadata = None -# other values from the config, defined by the needs of env.py, -# can be acquired: -# ... etc. - -postgres_user = os.environ.get("POSTGRES_USER") -postgres_password = os.environ.get("POSTGRES_PASSWORD") -postgres_hostname = os.environ.get("POSTGRES_HOSTNAME") -postgres_db = os.environ.get("POSTGRES_DB") -postgres_port = os.environ.get("POSTGRES_PORT") - -db_url = ( - "postgresql://" - + postgres_user - + ":" - + postgres_password - + "@" - + postgres_hostname - + ":" - + postgres_port - + "/" - + postgres_db -) - -config.set_main_option("sqlalchemy.url", db_url) +config.set_main_option("sqlalchemy.url", settings.db_url) def run_migrations_offline() -> None: diff --git a/bloom/alembic/init_script/load_amp_data.py b/bloom/alembic/init_script/load_amp_data.py index af65396d..7917d8ba 100644 --- a/bloom/alembic/init_script/load_amp_data.py +++ b/bloom/alembic/init_script/load_amp_data.py @@ -6,32 +6,13 @@ import pandas as pd from shapely import wkb from sqlalchemy import create_engine +from bloom.config import settings + logging.basicConfig() logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO) -postgres_user = os.environ.get("POSTGRES_USER") -postgres_password = os.environ.get("POSTGRES_PASSWORD") -postgres_hostname = os.environ.get("POSTGRES_HOSTNAME") -postgres_db = os.environ.get("POSTGRES_DB") -postgres_port = os.environ.get("POSTGRES_PORT") - - -# The db url is configured with the db connexion variables declared in the db.yaml file. -db_url = ( - "postgresql://" - + postgres_user - + ":" - + postgres_password - + "@" - + postgres_hostname - + ":" - + postgres_port - + "/" - + postgres_db -) - -engine = create_engine(db_url, echo=False) +engine = create_engine(settings.db_url, echo=False) df = pd.read_csv( Path(__file__).parent.joinpath("../../data/zones_subset_02022024.csv"), diff --git a/bloom/alembic/init_script/load_positions_data.py b/bloom/alembic/init_script/load_positions_data.py index 9e06b42a..632d452f 100644 --- a/bloom/alembic/init_script/load_positions_data.py +++ b/bloom/alembic/init_script/load_positions_data.py @@ -4,31 +4,12 @@ import pandas as pd from sqlalchemy import create_engine +from bloom.config import settings logging.basicConfig() logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO) -postgres_user = os.environ.get("POSTGRES_USER") -postgres_password = os.environ.get("POSTGRES_PASSWORD") -postgres_hostname = os.environ.get("POSTGRES_HOSTNAME") -postgres_db = os.environ.get("POSTGRES_DB") -postgres_port = os.environ.get("POSTGRES_PORT") - -# The db url is configured with the db connexion variables declared in the db.yaml file. -db_url = ( - "postgresql://" - + postgres_user - + ":" - + postgres_password - + "@" - + postgres_hostname - + ":" - + postgres_port - + "/" - + postgres_db -) - -engine = create_engine(db_url) +engine = create_engine(settings.db_url) df = pd.read_csv( Path(__file__).parent.joinpath("../../data/spire_positions_subset_02022024.csv"), diff --git a/bloom/alembic/init_script/load_vessels_data.py b/bloom/alembic/init_script/load_vessels_data.py index 16e9ef4e..bedb78e3 100644 --- a/bloom/alembic/init_script/load_vessels_data.py +++ b/bloom/alembic/init_script/load_vessels_data.py @@ -4,30 +4,12 @@ import pandas as pd from sqlalchemy import create_engine +from bloom.config import settings logging.basicConfig() logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO) -postgres_user = os.environ.get("POSTGRES_USER") -postgres_password = os.environ.get("POSTGRES_PASSWORD") -postgres_hostname = os.environ.get("POSTGRES_HOSTNAME") -postgres_db = os.environ.get("POSTGRES_DB") -postgres_port = os.environ.get("POSTGRES_PORT") - -# The db url is configured with the db connexion variables declared in the db.yaml file. -db_url = ( - "postgresql://" - + postgres_user - + ":" - + postgres_password - + "@" - + postgres_hostname - + ":" - + postgres_port - + "/" - + postgres_db -) -engine = create_engine(db_url) +engine = create_engine(settings.db_url) df = pd.read_csv( Path(__file__).parent.joinpath("../../data/chalutiers_pelagiques.csv"), sep=";", From 6f6e060687532dbf3a8213064d6c9de25bb10f3d Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 19:09:06 +0100 Subject: [PATCH 09/35] fix: docker compose + contener init --- docker-compose.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index a59ba9af..c9586d13 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,7 +14,12 @@ services: build: context: ./bloom/ + # Nominal start: command: streamlit run Trawlwatcher.py + # Debug start: + #command: bash + #tty: true + #stdin_open: true volumes: - ./bloom:/source_code environment: @@ -49,7 +54,7 @@ services: image: d4g/bloom:${VERSION:-latest} # Nominal start: - command: alembic check + command: /bin/bash -c "sleep 20 && alembic upgrade head" # Debug start: #command: bash #tty: true @@ -58,10 +63,7 @@ services: environment: <<: *common-env volumes: - - ./bloom/data:/source_code/data - - ./bloom/alembic:/source_code/alembic - - ./bloom/alembic.ini:/source_code/alembic.ini - #- ./bloom/bloom:/source_code/bloom + - ./bloom:/source_code networks: - bloom_net depends_on: From c4508965a273c0b690ab41d9658accf2bfce5f25 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 14:52:24 +0100 Subject: [PATCH 10/35] =?UTF-8?q?fix:=20some=20mixed=20values,=20d=C3=A9fi?= =?UTF-8?q?ne=20standard=20POSTGRES=5FHOSTNAME=20=3D>=20POSTGRES=5FHOST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bloom/.env.template | 2 +- bloom/Makefile | 4 ++-- bloom/docs/notes/database.initialisation.md | 2 +- bloom/docs/notes/development.environment.md | 2 +- docker-compose.yaml | 2 +- tox.ini | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bloom/.env.template b/bloom/.env.template index 32778649..42ee3f6e 100644 --- a/bloom/.env.template +++ b/bloom/.env.template @@ -1,5 +1,5 @@ # these values are used in the local docker env. You can use "localhost" hostname if you run the application without docker -POSTGRES_HOSTNAME=postgres_bloom +POSTGRES_HOST=postgres_bloom POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom POSTGRES_DB=bloom_db diff --git a/bloom/Makefile b/bloom/Makefile index 1db006e2..47286bf2 100644 --- a/bloom/Makefile +++ b/bloom/Makefile @@ -48,7 +48,7 @@ launch-production-app: $(BLOOM_PRODUCTION_DOCKER) --name bloom-production-app --rm d4g/bloom:${VERSION} /venv/bin/python3 app.py dump-dev-db: - $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' + $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOST -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' dump-db: - @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file + @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOST -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file diff --git a/bloom/docs/notes/database.initialisation.md b/bloom/docs/notes/database.initialisation.md index 51cb8e08..205c55e2 100644 --- a/bloom/docs/notes/database.initialisation.md +++ b/bloom/docs/notes/database.initialisation.md @@ -15,4 +15,4 @@ The second step is to load the [distance-from-port-v20201104.tiff](https://globa - install psql and raster2pgsql. - install raster type in db with postgis-raster using `create extension postgis_raster` -- adapt this command for each file : `raster2pgsql -t auto -I -C -M /PATH_TO/distance-from-shore.tif public.distance_shore | PGPASSWORD='POSTGRES_PASSWORD' psql -h POSTGRES_HOSTNAME -d POSTGRES_DB -U POSTGRES_USER -p POSTGRES_PORT` +- adapt this command for each file : `raster2pgsql -t auto -I -C -M /PATH_TO/distance-from-shore.tif public.distance_shore | PGPASSWORD='POSTGRES_PASSWORD' psql -h POSTGRES_HOST -d POSTGRES_DB -U POSTGRES_USER -p POSTGRES_PORT` diff --git a/bloom/docs/notes/development.environment.md b/bloom/docs/notes/development.environment.md index 9d3ebcf5..2ab32d34 100644 --- a/bloom/docs/notes/development.environment.md +++ b/bloom/docs/notes/development.environment.md @@ -15,7 +15,7 @@ If you work with Mac m1, the containers may not work as expected ## Local Database -You will need to source the .env.template file but before you should modify it according to your local configuration, for example using POSTGRES_HOSTNAME=localhost +You will need to source the .env.template file but before you should modify it according to your local configuration, for example using POSTGRES_HOST=localhost ## Development Database diff --git a/docker-compose.yaml b/docker-compose.yaml index c9586d13..171a42fd 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,7 @@ x-common-infos: # Env variables stored in a .env file at same level than docker-compose.yaml environment: &common-env - POSTGRES_HOSTNAME: ${POSTGRES_HOSTNAME} + POSTGRES_HOST: ${POSTGRES_HOST} POSTGRES_PORT: ${POSTGRES_PORT} POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} diff --git a/tox.ini b/tox.ini index f764c039..12dac3ab 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ commands = setenv = POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom - POSTGRES_HOSTNAME=postgres + POSTGRES_HOST=postgres POSTGRES_DB=bloom_db POSTGRES_PORT=5432 SLACK_URL=https://hooks.slack.com/services/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 From 034c6f00ee16c047277c261d8fd10a45cbf05248 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 14:58:52 +0100 Subject: [PATCH 11/35] fix: conformisation of POSTGRES_HOSTNAME instead of POSTGRES_HOST --- bloom/.env.template | 2 +- bloom/Makefile | 4 ++-- bloom/docs/notes/database.initialisation.md | 2 +- bloom/docs/notes/development.environment.md | 2 +- docker-compose.yaml | 2 +- tox.ini | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bloom/.env.template b/bloom/.env.template index 42ee3f6e..32778649 100644 --- a/bloom/.env.template +++ b/bloom/.env.template @@ -1,5 +1,5 @@ # these values are used in the local docker env. You can use "localhost" hostname if you run the application without docker -POSTGRES_HOST=postgres_bloom +POSTGRES_HOSTNAME=postgres_bloom POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom POSTGRES_DB=bloom_db diff --git a/bloom/Makefile b/bloom/Makefile index 47286bf2..1db006e2 100644 --- a/bloom/Makefile +++ b/bloom/Makefile @@ -48,7 +48,7 @@ launch-production-app: $(BLOOM_PRODUCTION_DOCKER) --name bloom-production-app --rm d4g/bloom:${VERSION} /venv/bin/python3 app.py dump-dev-db: - $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOST -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' + $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' dump-db: - @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOST -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file + @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file diff --git a/bloom/docs/notes/database.initialisation.md b/bloom/docs/notes/database.initialisation.md index 205c55e2..51cb8e08 100644 --- a/bloom/docs/notes/database.initialisation.md +++ b/bloom/docs/notes/database.initialisation.md @@ -15,4 +15,4 @@ The second step is to load the [distance-from-port-v20201104.tiff](https://globa - install psql and raster2pgsql. - install raster type in db with postgis-raster using `create extension postgis_raster` -- adapt this command for each file : `raster2pgsql -t auto -I -C -M /PATH_TO/distance-from-shore.tif public.distance_shore | PGPASSWORD='POSTGRES_PASSWORD' psql -h POSTGRES_HOST -d POSTGRES_DB -U POSTGRES_USER -p POSTGRES_PORT` +- adapt this command for each file : `raster2pgsql -t auto -I -C -M /PATH_TO/distance-from-shore.tif public.distance_shore | PGPASSWORD='POSTGRES_PASSWORD' psql -h POSTGRES_HOSTNAME -d POSTGRES_DB -U POSTGRES_USER -p POSTGRES_PORT` diff --git a/bloom/docs/notes/development.environment.md b/bloom/docs/notes/development.environment.md index 2ab32d34..9d3ebcf5 100644 --- a/bloom/docs/notes/development.environment.md +++ b/bloom/docs/notes/development.environment.md @@ -15,7 +15,7 @@ If you work with Mac m1, the containers may not work as expected ## Local Database -You will need to source the .env.template file but before you should modify it according to your local configuration, for example using POSTGRES_HOST=localhost +You will need to source the .env.template file but before you should modify it according to your local configuration, for example using POSTGRES_HOSTNAME=localhost ## Development Database diff --git a/docker-compose.yaml b/docker-compose.yaml index 171a42fd..c9586d13 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,7 @@ x-common-infos: # Env variables stored in a .env file at same level than docker-compose.yaml environment: &common-env - POSTGRES_HOST: ${POSTGRES_HOST} + POSTGRES_HOSTNAME: ${POSTGRES_HOSTNAME} POSTGRES_PORT: ${POSTGRES_PORT} POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} diff --git a/tox.ini b/tox.ini index 12dac3ab..f764c039 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ commands = setenv = POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom - POSTGRES_HOST=postgres + POSTGRES_HOSTNAME=postgres POSTGRES_DB=bloom_db POSTGRES_PORT=5432 SLACK_URL=https://hooks.slack.com/services/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 From f8a616230c0dbe22211ba56a5e1a9aca479e6817 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 15:04:12 +0100 Subject: [PATCH 12/35] feat: paramterizing PYTHON IMAGE for action testing multiple python versions --- bloom/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bloom/Dockerfile b/bloom/Dockerfile index a23d2922..a5c17fd7 100644 --- a/bloom/Dockerfile +++ b/bloom/Dockerfile @@ -1,4 +1,5 @@ -FROM python:3.10-slim-bullseye +ARG IMAGE_PYTHON=${IMAGE_PYTHON:-python:3.10-slim-bullseye} +FROM ${IMAGE_PYTHON} RUN apt-get update RUN apt-get -y install wget gcc g++ From a6ee6dda0d3dcef5d4d13b86dd9ff5979bfb367a Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 15:04:48 +0100 Subject: [PATCH 13/35] fix: docker remove data from container, must be mounted via volume --- bloom/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/bloom/Dockerfile b/bloom/Dockerfile index a5c17fd7..2530ccb2 100644 --- a/bloom/Dockerfile +++ b/bloom/Dockerfile @@ -8,7 +8,6 @@ RUN apt-get install -y rsyslog # Define working directory WORKDIR /source_code COPY bloom/ ./bloom/ -COPY data/ ./data/ COPY app.py . COPY container.py . COPY docker-env/rsyslog.conf /etc/rsyslog.conf From 4182114663ff67de8422eb21c558f27cafd9e7ac Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 19:22:39 +0100 Subject: [PATCH 14/35] fix: move of README + merge of docker compose procedure --- bloom/README.md => README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) rename bloom/README.md => README.md (92%) diff --git a/bloom/README.md b/README.md similarity index 92% rename from bloom/README.md rename to README.md index d7a30067..810838a5 100644 --- a/bloom/README.md +++ b/README.md @@ -12,6 +12,20 @@ **BLOOM** is a non-profit organization founded in 2005 that works to preserve the marine environment and species from unnecessary destruction and to increase social benefits in the fishing sector. **BLOOM** wages awareness and advocacy campaigns in order to accelerate the adoption of concrete solutions for the ocean, humans and the climate. **BLOOM** carries out scientific research projects, independent studies and evaluations that highlight crucial and unaddressed issues such as the financing mechanisms of the fishing sector. **BLOOM**’s actions are meant for the general public as well as policy-makers and economic stakeholders. +## Installing Trawl Watch with Docker Compose + +* git clone https://github.com/dataforgoodfr/12_bloom.git +* cd 12_bloom +* docker compose build +* docker compose pull +* copy and paste bloom/env.template at the same level than docker-compose.yaml and rename it .env +* docker compose run --service-ports bloom /bin/bash +* streamlit run Trawlwatcher.py +* working mmsi : 261084090 + +2. Ensure [Docker](https://docs.docker.com/get-docker/) is installed. + + ## Installing Trawl Watch with `poetry` ### Prerequisites: From bc395bffb22a12a4893b97b2132023ad7ccda1fd Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Mon, 4 Mar 2024 19:24:32 +0100 Subject: [PATCH 15/35] fix: move of README + merge of docker compose procedure --- README.md | 2 +- README.txt | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 README.txt diff --git a/README.md b/README.md index 810838a5..e67956a6 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ ## Installing Trawl Watch with Docker Compose +* Ensure [Docker](https://docs.docker.com/get-docker/) is installed. * git clone https://github.com/dataforgoodfr/12_bloom.git * cd 12_bloom * docker compose build @@ -23,7 +24,6 @@ * streamlit run Trawlwatcher.py * working mmsi : 261084090 -2. Ensure [Docker](https://docs.docker.com/get-docker/) is installed. ## Installing Trawl Watch with `poetry` diff --git a/README.txt b/README.txt deleted file mode 100644 index a2213cb0..00000000 --- a/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -Yet another readme :D - -Quickstart : - -git clone https://github.com/dataforgoodfr/12_bloom.git - -docker compose build - -docker compose pull - -copy and paste bloom/env.template at the same level than docker-compose.yaml and rename it .env - -docker compose run --service-ports bloom /bin/bash - -streamlit run Trawlwatcher.py - -working mmsi : 261084090 From 92bd686f41e69a939067273a3e057659e99dfa2d Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Fri, 8 Mar 2024 11:11:23 +0100 Subject: [PATCH 16/35] feat: add BLOOM_CONFIG management in bloom.config # Conflicts: # bloom/bloom/config.py --- bloom/Trawlwatcher.py | 13 ++++++++----- bloom/bloom/usecase/GetVesselsFromSpire.py | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bloom/Trawlwatcher.py b/bloom/Trawlwatcher.py index ca26e8bf..cce9fe14 100644 --- a/bloom/Trawlwatcher.py +++ b/bloom/Trawlwatcher.py @@ -3,6 +3,8 @@ import streamlit as st from dotenv import load_dotenv +from bloom.config import settings + st.set_page_config( page_title="Bloom Trawlwatcher Demo app", @@ -15,17 +17,18 @@ def __init__(self, env_path:str) -> None: super().__init__(f"Couldn't find .env file at {env_path}") # FILL IN YOUR CREDENTIALS .env file HERE !! -env_path = Path('.') / '.env.template2' -if not env_path.is_file(): - raise EnvFileNotFoundError(env_path.absolute()) -load_dotenv(env_path) + +#env_path = Path('.') / '.env.template' +#if not env_path.is_file(): +# raise FileNotFoundError(f"Couldn't find .env file at {env_path.absolute()}") +#load_dotenv(env_path) def local_css(file_name: str) -> None: with Path.open(file_name) as f: st.markdown(f"", unsafe_allow_html=True) return -local_css(Path("styles.css")) +local_css(Path(__file__).parent.joinpath("./styles.css")) st.write("![](https://upload.wikimedia.org/wikipedia/fr/e/e8/Logo_BLOOM.jpg)") st.write("## Welcome to Bloom Trawlwatcher Demo app! 🐟") diff --git a/bloom/bloom/usecase/GetVesselsFromSpire.py b/bloom/bloom/usecase/GetVesselsFromSpire.py index 8f512d1d..6b69aac0 100644 --- a/bloom/bloom/usecase/GetVesselsFromSpire.py +++ b/bloom/bloom/usecase/GetVesselsFromSpire.py @@ -10,6 +10,7 @@ from bloom.infra.http.spire_api_utils import Paging from bloom.infra.repositories.repository_vessel import RepositoryVessel from bloom.logger import logger +from bloom.config import settings class GetVesselsFromSpire: @@ -19,7 +20,7 @@ def __init__( ) -> None: self.vessel_repository: RepositoryVessel = vessel_repository - spire_token = os.environ.get("SPIRE_TOKEN") + spire_token = settings.spire_token self.transport = RequestsHTTPTransport( url="https://api.spire.com/graphql", From b053f77174feffc4c8ee19a4a5a4ea65c51eb62c Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Tue, 5 Mar 2024 20:57:11 +0100 Subject: [PATCH 17/35] fix: Trawlwatcher loading data from settings.data_folder --- bloom/bloom/infra/repositories/repository_vessel.py | 2 +- bloom/pages/1_Vessel_Exploration.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bloom/bloom/infra/repositories/repository_vessel.py b/bloom/bloom/infra/repositories/repository_vessel.py index 91ac0ac5..47d3101e 100644 --- a/bloom/bloom/infra/repositories/repository_vessel.py +++ b/bloom/bloom/infra/repositories/repository_vessel.py @@ -23,7 +23,7 @@ def __init__( session_factory: Callable, ) -> Callable[..., AbstractContextManager]: self.session_factory = session_factory - self.vessels_path = Path.joinpath(Path.cwd(), "data/chalutiers_pelagiques.csv") + self.vessels_path = Path(settings.data_folder).joinpath("./chalutiers_pelagiques.csv") def load_vessel_metadata(self) -> list[Vessel]: with self.session_factory() as session: diff --git a/bloom/pages/1_Vessel_Exploration.py b/bloom/pages/1_Vessel_Exploration.py index b4221e97..ebdd15e4 100644 --- a/bloom/pages/1_Vessel_Exploration.py +++ b/bloom/pages/1_Vessel_Exploration.py @@ -2,6 +2,7 @@ import streamlit as st from dotenv import load_dotenv from streamlit_folium import st_folium +from pathlib import Path from bloom.config import settings from bloom.infra.database.database_manager import Database @@ -31,7 +32,7 @@ def load_trajectory(mmsi, mpa): # @st.cache_data # 👈 Add the caching decorator def load_trawlers(): - trawlers = pd.read_csv("data/chalutiers_pelagiques.csv", sep=";") + trawlers = pd.read_csv(Path(settings.data_folder).joinpath("./chalutiers_pelagiques.csv"), sep=";") return trawlers From 49c844e754b95b729ee15e92b4adfad285fd7577 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Fri, 8 Mar 2024 11:14:16 +0100 Subject: [PATCH 18/35] feat: complete folder redisign # Conflicts: # .gitignore # .pre-commit-config.yaml # bloom/.gitignore # bloom/.pre-commit-config.yaml # src/.gitignore # src/.pre-commit-config.yaml # src/alembic/init_script/load_amp_data.py # src/alembic/init_script/load_positions_data.py # src/alembic/init_script/load_vessels_data.py --- bloom/.env.template => .env.template | 3 + .gitignore | 2 +- bloom/Makefile => Makefile | 14 ++-- bloom/docker-env/Dockerfile | 63 ------------------ {bloom/data => data}/_info_subset_data.docx | Bin .../data => data}/chalutiers_pelagiques.csv | 0 .../data => data}/vessels_subset_02022024.csv | 0 docker-compose.yaml | 9 +-- {bloom => docker}/Dockerfile | 10 +-- .../docker-compose-db.yaml | 0 {bloom/docker-env => docker}/entrypoint.sh | 0 .../pgadmin-servers.json | 0 {bloom/docker-env => docker}/pgpassfile | 0 {bloom/docker-env => docker}/rsyslog.conf | 0 {bloom/docs => docs}/.gitignore | 0 {bloom/docs => docs}/dendron.code-workspace | 0 {bloom/docs => docs}/dendron.yml | 0 {bloom/docs => docs}/notes/ais.md | 0 .../notes/database.initialisation.md | 0 .../notes/database.versioning.md | 0 .../notes/development.environment.md | 0 .../docs => docs}/notes/development.poetry.md | 0 {bloom/docs => docs}/notes/mpa.md | 0 {bloom/docs => docs}/notes/root.md | 0 {bloom/docs => docs}/notes/root.schema.yml | 0 {bloom/docs => docs}/notes/shom.md | 0 {bloom/docs => docs}/notes/sql.examples.md | 0 {bloom => src}/Trawlwatcher.py | 0 {bloom => src}/alembic.ini | 0 {bloom => src}/alembic/README | 0 {bloom => src}/alembic/env.py | 0 .../alembic/init_script/load_amp_data.py | 4 +- .../init_script/load_positions_data.py | 4 +- .../alembic/init_script/load_vessels_data.py | 2 +- {bloom => src}/alembic/script.py.mako | 0 .../1fd83d22bd1e_create_alert_table.py | 0 ...68c9f220a07f_add_columns_in_spire_table.py | 0 .../versions/961cee5426d6_create_amp_table.py | 0 ...1c_create_marine_traffic_positions_and_.py | 0 {bloom => src}/app.py | 0 {bloom => src}/bloom/config.py | 6 +- {bloom => src}/bloom/domain/alert.py | 0 {bloom => src}/bloom/domain/rules.py | 0 {bloom => src}/bloom/domain/vessel.py | 0 .../bloom/domain/vessels/vessel_trajectory.py | 0 .../domain/vessels/visualize_trajectory.py | 0 {bloom => src}/bloom/domain/zones/mpa.py | 0 {bloom => src}/bloom/enums.py | 0 .../bloom/infra/database/database_manager.py | 0 {bloom => src}/bloom/infra/database/errors.py | 0 .../bloom/infra/database/sql_model.py | 0 .../infra/http/marine_traffic_scraper.py | 0 .../bloom/infra/http/spire_api_utils.py | 0 .../infra/repositories/repository_alert.py | 0 .../infra/repositories/repository_raster.py | 0 .../infra/repositories/repository_vessel.py | 0 {bloom => src}/bloom/logger.py | 0 {bloom => src}/bloom/scheduler.py | 0 .../bloom/usecase/GenerateAlerts.py | 0 .../bloom/usecase/GetVesselsFromSpire.py | 0 .../usecase/ScrapVesselsFromMarineTraffic.py | 0 {bloom => src}/container.py | 0 {bloom => src}/images/banner.png | Bin {bloom => src}/pages/1_Vessel_Exploration.py | 0 {bloom => src}/styles.css | 0 {bloom => src}/tests/test_alert.py | 0 .../tests/test_marine_traffic_scrapper.py | 0 67 files changed, 30 insertions(+), 87 deletions(-) rename bloom/.env.template => .env.template (84%) rename bloom/Makefile => Makefile (78%) delete mode 100644 bloom/docker-env/Dockerfile rename {bloom/data => data}/_info_subset_data.docx (100%) rename {bloom/data => data}/chalutiers_pelagiques.csv (100%) rename {bloom/data => data}/vessels_subset_02022024.csv (100%) rename {bloom => docker}/Dockerfile (93%) rename {bloom/docker-env => docker}/docker-compose-db.yaml (100%) rename {bloom/docker-env => docker}/entrypoint.sh (100%) rename {bloom/docker-env => docker}/pgadmin-servers.json (100%) rename {bloom/docker-env => docker}/pgpassfile (100%) rename {bloom/docker-env => docker}/rsyslog.conf (100%) rename {bloom/docs => docs}/.gitignore (100%) rename {bloom/docs => docs}/dendron.code-workspace (100%) rename {bloom/docs => docs}/dendron.yml (100%) rename {bloom/docs => docs}/notes/ais.md (100%) rename {bloom/docs => docs}/notes/database.initialisation.md (100%) rename {bloom/docs => docs}/notes/database.versioning.md (100%) rename {bloom/docs => docs}/notes/development.environment.md (100%) rename {bloom/docs => docs}/notes/development.poetry.md (100%) rename {bloom/docs => docs}/notes/mpa.md (100%) rename {bloom/docs => docs}/notes/root.md (100%) rename {bloom/docs => docs}/notes/root.schema.yml (100%) rename {bloom/docs => docs}/notes/shom.md (100%) rename {bloom/docs => docs}/notes/sql.examples.md (100%) rename {bloom => src}/Trawlwatcher.py (100%) rename {bloom => src}/alembic.ini (100%) rename {bloom => src}/alembic/README (100%) rename {bloom => src}/alembic/env.py (100%) rename {bloom => src}/alembic/init_script/load_amp_data.py (91%) rename {bloom => src}/alembic/init_script/load_positions_data.py (78%) rename {bloom => src}/alembic/init_script/load_vessels_data.py (85%) rename {bloom => src}/alembic/script.py.mako (100%) rename {bloom => src}/alembic/versions/1fd83d22bd1e_create_alert_table.py (100%) rename {bloom => src}/alembic/versions/68c9f220a07f_add_columns_in_spire_table.py (100%) rename {bloom => src}/alembic/versions/961cee5426d6_create_amp_table.py (100%) rename {bloom => src}/alembic/versions/e52b9542531c_create_marine_traffic_positions_and_.py (100%) rename {bloom => src}/app.py (100%) rename {bloom => src}/bloom/config.py (97%) rename {bloom => src}/bloom/domain/alert.py (100%) rename {bloom => src}/bloom/domain/rules.py (100%) rename {bloom => src}/bloom/domain/vessel.py (100%) rename {bloom => src}/bloom/domain/vessels/vessel_trajectory.py (100%) rename {bloom => src}/bloom/domain/vessels/visualize_trajectory.py (100%) rename {bloom => src}/bloom/domain/zones/mpa.py (100%) rename {bloom => src}/bloom/enums.py (100%) rename {bloom => src}/bloom/infra/database/database_manager.py (100%) rename {bloom => src}/bloom/infra/database/errors.py (100%) rename {bloom => src}/bloom/infra/database/sql_model.py (100%) rename {bloom => src}/bloom/infra/http/marine_traffic_scraper.py (100%) rename {bloom => src}/bloom/infra/http/spire_api_utils.py (100%) rename {bloom => src}/bloom/infra/repositories/repository_alert.py (100%) rename {bloom => src}/bloom/infra/repositories/repository_raster.py (100%) rename {bloom => src}/bloom/infra/repositories/repository_vessel.py (100%) rename {bloom => src}/bloom/logger.py (100%) rename {bloom => src}/bloom/scheduler.py (100%) rename {bloom => src}/bloom/usecase/GenerateAlerts.py (100%) rename {bloom => src}/bloom/usecase/GetVesselsFromSpire.py (100%) rename {bloom => src}/bloom/usecase/ScrapVesselsFromMarineTraffic.py (100%) rename {bloom => src}/container.py (100%) rename {bloom => src}/images/banner.png (100%) rename {bloom => src}/pages/1_Vessel_Exploration.py (100%) rename {bloom => src}/styles.css (100%) rename {bloom => src}/tests/test_alert.py (100%) rename {bloom => src}/tests/test_marine_traffic_scrapper.py (100%) diff --git a/bloom/.env.template b/.env.template similarity index 84% rename from bloom/.env.template rename to .env.template index 32778649..5d0a2929 100644 --- a/bloom/.env.template +++ b/.env.template @@ -6,3 +6,6 @@ POSTGRES_DB=bloom_db POSTGRES_PORT=5432 SPIRE_TOKEN= SLACK_URL= + +# Folder where data are stored +DATA_FOLDER=/data diff --git a/.gitignore b/.gitignore index 339b6bcf..30ac1a27 100644 --- a/.gitignore +++ b/.gitignore @@ -126,7 +126,7 @@ celerybeat.pid # Environments .env -.env.test +.env.* .venv env/ venv/ diff --git a/bloom/Makefile b/Makefile similarity index 78% rename from bloom/Makefile rename to Makefile index 1db006e2..281dfee7 100644 --- a/bloom/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ VERSION ?= 1.0.0 #BLOOM_DEV_DOCKER = @docker run --name bloom-test --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net -p 8501:8501 -BLOOM_DEV_DOCKER = @docker run --name bloom-test --mount type=bind,source=.,target=/source_code --env-file ./.env.template --network=bloom_net -p 8501:8501 -BLOOM_PRODUCTION_DOCKER = @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env --log-driver json-file --log-opt max-size=10M --log-opt max-file=3 --entrypoint /entrypoint.sh +BLOOM_DEV_DOCKER = @docker run --name bloom-test -v "$(shell pwd)/data:/data" -v "$(shell pwd)/src:/source_code" --env-file ./.env.template --network=bloom_net -p 8501:8501 +BLOOM_PRODUCTION_DOCKER = @docker run -v "$(shell pwd)/data:/data" -v "$(shell pwd)/src:/source_code" --env-file ./.env --log-driver json-file --log-opt max-size=10M --log-opt max-file=3 --entrypoint /entrypoint.sh build: - @docker build -t d4g/bloom:${VERSION} --platform linux/amd64 -f docker-env/Dockerfile . + @docker build -t d4g/bloom:${VERSION} --platform linux/amd64 -f docker/Dockerfile . @docker tag d4g/bloom:${VERSION} d4g/bloom:latest launch-dev-db: - @docker compose -f docker-env/docker-compose-db.yaml up -d + @docker compose -f docker/docker-compose-db.yaml up -d @sleep 20 $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} alembic upgrade head $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 alembic/init_script/load_vessels_data.py @@ -30,8 +30,8 @@ launch-test: $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} tox -vv rm-dev-db: - @docker-compose -f docker-env/docker-compose-db.yaml stop - @docker-compose -f docker-env/docker-compose-db.yaml rm + @docker compose -f docker/docker-compose-db.yaml stop + @docker compose -f docker/docker-compose-db.yaml rm rm-dev-env: @docker stop bloom-test @@ -51,4 +51,4 @@ dump-dev-db: $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' dump-db: - @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file + @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' diff --git a/bloom/docker-env/Dockerfile b/bloom/docker-env/Dockerfile deleted file mode 100644 index b16fffa8..00000000 --- a/bloom/docker-env/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -FROM python:3.10-slim-bullseye - -RUN apt-get update -RUN apt-get -y install wget gcc g++ -RUN apt-get install -y rsyslog - -# Define working directory -WORKDIR /source_code -COPY bloom/ ./bloom/ -COPY data/ ./data/ -COPY app.py . -COPY container.py . -COPY docker-env/rsyslog.conf /etc/rsyslog.conf - -# Install requirements package for python with poetry -ARG POETRY_VERSION=1.8.1 -ENV POETRY_VERSION=${POETRY_VERSION} -RUN pip install --user "poetry==$POETRY_VERSION" -ENV PATH="${PATH}:/root/.local/bin" -COPY pyproject.toml poetry.lock ./ - -RUN python -m venv /venv -ENV PATH=/venv/bin:$PATH \ - VIRTUAL_ENV=/venv -RUN poetry install - - -# Install chrome in the latest version -ARG CHROME_VERSION="112.0.5615.165-1" -RUN wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb -RUN apt-get install -y --fix-missing /tmp/chrome.deb -RUN rm -f google-chrome-stable_current_amd64.deb - - -# Launch cron services -RUN DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -y cron \ - # Remove package lists for smaller image sizes - && rm -rf /var/lib/apt/lists/* \ - && which cron \ - && rm -rf /etc/cron.*/* - -# Create cron task inside container -# Due to the fact that cron process doesn't access to declared ENV vars and doesn't load user profiles -# The entrypoint.sh script stores ENV vars at runtime in the ~/.env file as key=value pairs -# Then the cron line include some command to load these ENV vars from file before launching app.py -# This mecanism allows to give access to the same ENV vars for app.py launch in terminal and launch via cron -RUN echo "*/15 * * * * root export \$(cat ~/.env | grep -v '#' | xargs);/venv/bin/python3 /source_code/app.py 2>&1 | /usr/bin/logger -t bloom" >> ./cron_scrapper -RUN chmod 744 ./cron_scrapper - -# Move cron tab into the right directory -RUN mv ./cron_scrapper /etc/cron.d/cron_scrapper - -# Run file -RUN crontab /etc/cron.d/cron_scrapper - -COPY docker-env/entrypoint.sh /entrypoint.sh -RUN ["chmod", "+x", "/entrypoint.sh"] - -ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] -# https://manpages.ubuntu.com/manpages/trusty/man8/cron.8.html -# -f | Stay in foreground mode, don't daemonize. -# -L loglevel | Tell cron what to log about jobs (errors are logged regardless of this value) as the sum of the following values: -CMD ["cron","-f", "-L", "2"] diff --git a/bloom/data/_info_subset_data.docx b/data/_info_subset_data.docx similarity index 100% rename from bloom/data/_info_subset_data.docx rename to data/_info_subset_data.docx diff --git a/bloom/data/chalutiers_pelagiques.csv b/data/chalutiers_pelagiques.csv similarity index 100% rename from bloom/data/chalutiers_pelagiques.csv rename to data/chalutiers_pelagiques.csv diff --git a/bloom/data/vessels_subset_02022024.csv b/data/vessels_subset_02022024.csv similarity index 100% rename from bloom/data/vessels_subset_02022024.csv rename to data/vessels_subset_02022024.csv diff --git a/docker-compose.yaml b/docker-compose.yaml index c9586d13..c816aa33 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,7 +12,8 @@ services: container_name: bloom image: d4g/bloom:${VERSION:-latest} build: - context: ./bloom/ + context: . + dockerfile: ./docker/Dockerfile # Nominal start: command: streamlit run Trawlwatcher.py @@ -21,7 +22,7 @@ services: #tty: true #stdin_open: true volumes: - - ./bloom:/source_code + - ./src:/source_code environment: <<: *common-env ports: @@ -63,7 +64,7 @@ services: environment: <<: *common-env volumes: - - ./bloom:/source_code + - ./src:/source_code networks: - bloom_net depends_on: @@ -72,4 +73,4 @@ services: networks: bloom_net: - name: bloom_net \ No newline at end of file + name: bloom_net diff --git a/bloom/Dockerfile b/docker/Dockerfile similarity index 93% rename from bloom/Dockerfile rename to docker/Dockerfile index 2530ccb2..d729d91f 100644 --- a/bloom/Dockerfile +++ b/docker/Dockerfile @@ -7,10 +7,10 @@ RUN apt-get install -y rsyslog # Define working directory WORKDIR /source_code -COPY bloom/ ./bloom/ -COPY app.py . -COPY container.py . -COPY docker-env/rsyslog.conf /etc/rsyslog.conf +COPY src/bloom/ ./bloom/ +COPY src/app.py . +COPY src/container.py . +COPY docker/rsyslog.conf /etc/rsyslog.conf # Install requirements package for python with poetry ARG POETRY_VERSION=1.8.1 @@ -53,7 +53,7 @@ RUN mv ./cron_scrapper /etc/cron.d/cron_scrapper # Run file RUN crontab /etc/cron.d/cron_scrapper -COPY docker-env/entrypoint.sh /entrypoint.sh +COPY docker/entrypoint.sh /entrypoint.sh RUN ["chmod", "+x", "/entrypoint.sh"] # ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] diff --git a/bloom/docker-env/docker-compose-db.yaml b/docker/docker-compose-db.yaml similarity index 100% rename from bloom/docker-env/docker-compose-db.yaml rename to docker/docker-compose-db.yaml diff --git a/bloom/docker-env/entrypoint.sh b/docker/entrypoint.sh similarity index 100% rename from bloom/docker-env/entrypoint.sh rename to docker/entrypoint.sh diff --git a/bloom/docker-env/pgadmin-servers.json b/docker/pgadmin-servers.json similarity index 100% rename from bloom/docker-env/pgadmin-servers.json rename to docker/pgadmin-servers.json diff --git a/bloom/docker-env/pgpassfile b/docker/pgpassfile similarity index 100% rename from bloom/docker-env/pgpassfile rename to docker/pgpassfile diff --git a/bloom/docker-env/rsyslog.conf b/docker/rsyslog.conf similarity index 100% rename from bloom/docker-env/rsyslog.conf rename to docker/rsyslog.conf diff --git a/bloom/docs/.gitignore b/docs/.gitignore similarity index 100% rename from bloom/docs/.gitignore rename to docs/.gitignore diff --git a/bloom/docs/dendron.code-workspace b/docs/dendron.code-workspace similarity index 100% rename from bloom/docs/dendron.code-workspace rename to docs/dendron.code-workspace diff --git a/bloom/docs/dendron.yml b/docs/dendron.yml similarity index 100% rename from bloom/docs/dendron.yml rename to docs/dendron.yml diff --git a/bloom/docs/notes/ais.md b/docs/notes/ais.md similarity index 100% rename from bloom/docs/notes/ais.md rename to docs/notes/ais.md diff --git a/bloom/docs/notes/database.initialisation.md b/docs/notes/database.initialisation.md similarity index 100% rename from bloom/docs/notes/database.initialisation.md rename to docs/notes/database.initialisation.md diff --git a/bloom/docs/notes/database.versioning.md b/docs/notes/database.versioning.md similarity index 100% rename from bloom/docs/notes/database.versioning.md rename to docs/notes/database.versioning.md diff --git a/bloom/docs/notes/development.environment.md b/docs/notes/development.environment.md similarity index 100% rename from bloom/docs/notes/development.environment.md rename to docs/notes/development.environment.md diff --git a/bloom/docs/notes/development.poetry.md b/docs/notes/development.poetry.md similarity index 100% rename from bloom/docs/notes/development.poetry.md rename to docs/notes/development.poetry.md diff --git a/bloom/docs/notes/mpa.md b/docs/notes/mpa.md similarity index 100% rename from bloom/docs/notes/mpa.md rename to docs/notes/mpa.md diff --git a/bloom/docs/notes/root.md b/docs/notes/root.md similarity index 100% rename from bloom/docs/notes/root.md rename to docs/notes/root.md diff --git a/bloom/docs/notes/root.schema.yml b/docs/notes/root.schema.yml similarity index 100% rename from bloom/docs/notes/root.schema.yml rename to docs/notes/root.schema.yml diff --git a/bloom/docs/notes/shom.md b/docs/notes/shom.md similarity index 100% rename from bloom/docs/notes/shom.md rename to docs/notes/shom.md diff --git a/bloom/docs/notes/sql.examples.md b/docs/notes/sql.examples.md similarity index 100% rename from bloom/docs/notes/sql.examples.md rename to docs/notes/sql.examples.md diff --git a/bloom/Trawlwatcher.py b/src/Trawlwatcher.py similarity index 100% rename from bloom/Trawlwatcher.py rename to src/Trawlwatcher.py diff --git a/bloom/alembic.ini b/src/alembic.ini similarity index 100% rename from bloom/alembic.ini rename to src/alembic.ini diff --git a/bloom/alembic/README b/src/alembic/README similarity index 100% rename from bloom/alembic/README rename to src/alembic/README diff --git a/bloom/alembic/env.py b/src/alembic/env.py similarity index 100% rename from bloom/alembic/env.py rename to src/alembic/env.py diff --git a/bloom/alembic/init_script/load_amp_data.py b/src/alembic/init_script/load_amp_data.py similarity index 91% rename from bloom/alembic/init_script/load_amp_data.py rename to src/alembic/init_script/load_amp_data.py index 7917d8ba..7ba517a6 100644 --- a/bloom/alembic/init_script/load_amp_data.py +++ b/src/alembic/init_script/load_amp_data.py @@ -15,7 +15,7 @@ engine = create_engine(settings.db_url, echo=False) df = pd.read_csv( - Path(__file__).parent.joinpath("../../data/zones_subset_02022024.csv"), + Path(settings.data_folder).joinpath("./zones_subset_02022024.csv"), sep=",", ) @@ -33,4 +33,4 @@ gdf = gpd.GeoDataFrame(df, crs='epsg:4326') gdf.head() -gdf.to_postgis("mpa_fr_with_mn", con=engine, if_exists="replace", index=False) \ No newline at end of file +gdf.to_postgis("mpa_fr_with_mn", con=engine, if_exists="replace", index=False) diff --git a/bloom/alembic/init_script/load_positions_data.py b/src/alembic/init_script/load_positions_data.py similarity index 78% rename from bloom/alembic/init_script/load_positions_data.py rename to src/alembic/init_script/load_positions_data.py index 632d452f..24609500 100644 --- a/bloom/alembic/init_script/load_positions_data.py +++ b/src/alembic/init_script/load_positions_data.py @@ -12,8 +12,8 @@ engine = create_engine(settings.db_url) df = pd.read_csv( - Path(__file__).parent.joinpath("../../data/spire_positions_subset_02022024.csv"), + Path(settings.data_folder).joinpath("./spire_positions_subset_02022024.csv"), sep="," ) -df.to_sql("spire_vessel_positions", engine, if_exists="append", index=False) \ No newline at end of file +df.to_sql("spire_vessel_positions", engine, if_exists="append", index=False) diff --git a/bloom/alembic/init_script/load_vessels_data.py b/src/alembic/init_script/load_vessels_data.py similarity index 85% rename from bloom/alembic/init_script/load_vessels_data.py rename to src/alembic/init_script/load_vessels_data.py index bedb78e3..5d6a2d69 100644 --- a/bloom/alembic/init_script/load_vessels_data.py +++ b/src/alembic/init_script/load_vessels_data.py @@ -11,7 +11,7 @@ engine = create_engine(settings.db_url) df = pd.read_csv( - Path(__file__).parent.joinpath("../../data/chalutiers_pelagiques.csv"), + Path(settings.data_folder).joinpath("./chalutiers_pelagiques.csv"), sep=";", dtype={"loa": float, "IMO": str}, ) diff --git a/bloom/alembic/script.py.mako b/src/alembic/script.py.mako similarity index 100% rename from bloom/alembic/script.py.mako rename to src/alembic/script.py.mako diff --git a/bloom/alembic/versions/1fd83d22bd1e_create_alert_table.py b/src/alembic/versions/1fd83d22bd1e_create_alert_table.py similarity index 100% rename from bloom/alembic/versions/1fd83d22bd1e_create_alert_table.py rename to src/alembic/versions/1fd83d22bd1e_create_alert_table.py diff --git a/bloom/alembic/versions/68c9f220a07f_add_columns_in_spire_table.py b/src/alembic/versions/68c9f220a07f_add_columns_in_spire_table.py similarity index 100% rename from bloom/alembic/versions/68c9f220a07f_add_columns_in_spire_table.py rename to src/alembic/versions/68c9f220a07f_add_columns_in_spire_table.py diff --git a/bloom/alembic/versions/961cee5426d6_create_amp_table.py b/src/alembic/versions/961cee5426d6_create_amp_table.py similarity index 100% rename from bloom/alembic/versions/961cee5426d6_create_amp_table.py rename to src/alembic/versions/961cee5426d6_create_amp_table.py diff --git a/bloom/alembic/versions/e52b9542531c_create_marine_traffic_positions_and_.py b/src/alembic/versions/e52b9542531c_create_marine_traffic_positions_and_.py similarity index 100% rename from bloom/alembic/versions/e52b9542531c_create_marine_traffic_positions_and_.py rename to src/alembic/versions/e52b9542531c_create_marine_traffic_positions_and_.py diff --git a/bloom/app.py b/src/app.py similarity index 100% rename from bloom/app.py rename to src/app.py diff --git a/bloom/bloom/config.py b/src/bloom/config.py similarity index 97% rename from bloom/bloom/config.py rename to src/bloom/config.py index 392d28b3..219edc9f 100644 --- a/bloom/bloom/config.py +++ b/src/bloom/config.py @@ -74,12 +74,14 @@ class Settings(BaseSettings): srid: int = 4326 db_url:str = None spire_token:str = None + data_folder:str=None def __init__(self): super().__init__(self) # Default values - srid: int = 4326 - + self.srid = 4326 + self.data_folder = Path(__file__).parent.parent.parent.joinpath('./data') + # Si le fichier de configuration à charger est précisé par la variable d'environnement # BLOOM_CONFIG alors on charge ce fichier, sinon par défaut c'est ../.env BLOOM_CONFIG=os.getenv('BLOOM_CONFIG',Path(__file__).parent.joinpath(".env")) diff --git a/bloom/bloom/domain/alert.py b/src/bloom/domain/alert.py similarity index 100% rename from bloom/bloom/domain/alert.py rename to src/bloom/domain/alert.py diff --git a/bloom/bloom/domain/rules.py b/src/bloom/domain/rules.py similarity index 100% rename from bloom/bloom/domain/rules.py rename to src/bloom/domain/rules.py diff --git a/bloom/bloom/domain/vessel.py b/src/bloom/domain/vessel.py similarity index 100% rename from bloom/bloom/domain/vessel.py rename to src/bloom/domain/vessel.py diff --git a/bloom/bloom/domain/vessels/vessel_trajectory.py b/src/bloom/domain/vessels/vessel_trajectory.py similarity index 100% rename from bloom/bloom/domain/vessels/vessel_trajectory.py rename to src/bloom/domain/vessels/vessel_trajectory.py diff --git a/bloom/bloom/domain/vessels/visualize_trajectory.py b/src/bloom/domain/vessels/visualize_trajectory.py similarity index 100% rename from bloom/bloom/domain/vessels/visualize_trajectory.py rename to src/bloom/domain/vessels/visualize_trajectory.py diff --git a/bloom/bloom/domain/zones/mpa.py b/src/bloom/domain/zones/mpa.py similarity index 100% rename from bloom/bloom/domain/zones/mpa.py rename to src/bloom/domain/zones/mpa.py diff --git a/bloom/bloom/enums.py b/src/bloom/enums.py similarity index 100% rename from bloom/bloom/enums.py rename to src/bloom/enums.py diff --git a/bloom/bloom/infra/database/database_manager.py b/src/bloom/infra/database/database_manager.py similarity index 100% rename from bloom/bloom/infra/database/database_manager.py rename to src/bloom/infra/database/database_manager.py diff --git a/bloom/bloom/infra/database/errors.py b/src/bloom/infra/database/errors.py similarity index 100% rename from bloom/bloom/infra/database/errors.py rename to src/bloom/infra/database/errors.py diff --git a/bloom/bloom/infra/database/sql_model.py b/src/bloom/infra/database/sql_model.py similarity index 100% rename from bloom/bloom/infra/database/sql_model.py rename to src/bloom/infra/database/sql_model.py diff --git a/bloom/bloom/infra/http/marine_traffic_scraper.py b/src/bloom/infra/http/marine_traffic_scraper.py similarity index 100% rename from bloom/bloom/infra/http/marine_traffic_scraper.py rename to src/bloom/infra/http/marine_traffic_scraper.py diff --git a/bloom/bloom/infra/http/spire_api_utils.py b/src/bloom/infra/http/spire_api_utils.py similarity index 100% rename from bloom/bloom/infra/http/spire_api_utils.py rename to src/bloom/infra/http/spire_api_utils.py diff --git a/bloom/bloom/infra/repositories/repository_alert.py b/src/bloom/infra/repositories/repository_alert.py similarity index 100% rename from bloom/bloom/infra/repositories/repository_alert.py rename to src/bloom/infra/repositories/repository_alert.py diff --git a/bloom/bloom/infra/repositories/repository_raster.py b/src/bloom/infra/repositories/repository_raster.py similarity index 100% rename from bloom/bloom/infra/repositories/repository_raster.py rename to src/bloom/infra/repositories/repository_raster.py diff --git a/bloom/bloom/infra/repositories/repository_vessel.py b/src/bloom/infra/repositories/repository_vessel.py similarity index 100% rename from bloom/bloom/infra/repositories/repository_vessel.py rename to src/bloom/infra/repositories/repository_vessel.py diff --git a/bloom/bloom/logger.py b/src/bloom/logger.py similarity index 100% rename from bloom/bloom/logger.py rename to src/bloom/logger.py diff --git a/bloom/bloom/scheduler.py b/src/bloom/scheduler.py similarity index 100% rename from bloom/bloom/scheduler.py rename to src/bloom/scheduler.py diff --git a/bloom/bloom/usecase/GenerateAlerts.py b/src/bloom/usecase/GenerateAlerts.py similarity index 100% rename from bloom/bloom/usecase/GenerateAlerts.py rename to src/bloom/usecase/GenerateAlerts.py diff --git a/bloom/bloom/usecase/GetVesselsFromSpire.py b/src/bloom/usecase/GetVesselsFromSpire.py similarity index 100% rename from bloom/bloom/usecase/GetVesselsFromSpire.py rename to src/bloom/usecase/GetVesselsFromSpire.py diff --git a/bloom/bloom/usecase/ScrapVesselsFromMarineTraffic.py b/src/bloom/usecase/ScrapVesselsFromMarineTraffic.py similarity index 100% rename from bloom/bloom/usecase/ScrapVesselsFromMarineTraffic.py rename to src/bloom/usecase/ScrapVesselsFromMarineTraffic.py diff --git a/bloom/container.py b/src/container.py similarity index 100% rename from bloom/container.py rename to src/container.py diff --git a/bloom/images/banner.png b/src/images/banner.png similarity index 100% rename from bloom/images/banner.png rename to src/images/banner.png diff --git a/bloom/pages/1_Vessel_Exploration.py b/src/pages/1_Vessel_Exploration.py similarity index 100% rename from bloom/pages/1_Vessel_Exploration.py rename to src/pages/1_Vessel_Exploration.py diff --git a/bloom/styles.css b/src/styles.css similarity index 100% rename from bloom/styles.css rename to src/styles.css diff --git a/bloom/tests/test_alert.py b/src/tests/test_alert.py similarity index 100% rename from bloom/tests/test_alert.py rename to src/tests/test_alert.py diff --git a/bloom/tests/test_marine_traffic_scrapper.py b/src/tests/test_marine_traffic_scrapper.py similarity index 100% rename from bloom/tests/test_marine_traffic_scrapper.py rename to src/tests/test_marine_traffic_scrapper.py From 5160b791d40810cd3c311731ecb98adcf617a87b Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Tue, 5 Mar 2024 00:04:58 +0100 Subject: [PATCH 19/35] fix: Trawlwatcher loading data from settings.data_folder --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index c816aa33..9350359d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -23,6 +23,7 @@ services: #stdin_open: true volumes: - ./src:/source_code + - ./data:/data environment: <<: *common-env ports: From ee51e9b973012e129af8cc9a7128f8398fa74869 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Tue, 5 Mar 2024 23:34:57 +0100 Subject: [PATCH 20/35] feat: docker-compose add build args for python and poetry version (for actions and future version validation) --- .env.template | 19 +++++++++++++++++++ docker-compose.yaml | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.env.template b/.env.template index 5d0a2929..4c2acf0b 100644 --- a/.env.template +++ b/.env.template @@ -1,3 +1,8 @@ +############################################################################################### +# BLOOM VARIABLES +############################################################################################### +# these values are used in the local docker env. You can use "localhost" hostname +# if you run the application without docker # these values are used in the local docker env. You can use "localhost" hostname if you run the application without docker POSTGRES_HOSTNAME=postgres_bloom POSTGRES_USER=bloom_user @@ -9,3 +14,17 @@ SLACK_URL= # Folder where data are stored DATA_FOLDER=/data + + +############################################################################################### +# DOCKER SPECIFIC VARIABLES +############################################################################################### +# IMAGE_PYTHON (Optional) +# Default is set in docker-compose.yaml and/or in dockerfile directly ARG IMAGE_PYTHON +# Changing this value will change the version python image used to build Docker image of Bloom +#IMAGE_PYTHON=python:3.10-slim-bullseye + +# POETRY_VERSION (Optional) +# Default is set in docker-compose.yaml and/or in dockerfile directly ARG POETRY_VERSION +# Changing this value will change the version poetry used to build Docker image of Bloom +#POETRY_VERSION=1.8.1 diff --git a/docker-compose.yaml b/docker-compose.yaml index 9350359d..c262bbe8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,7 +14,9 @@ services: build: context: . dockerfile: ./docker/Dockerfile - + args: + IMAGE_PYTHON: ${IMAGE_PYTHON:-python:3.10-slim-bullseye} + POETRY_VERSION: ${POETRY_VERSION:-1.8.1} # Nominal start: command: streamlit run Trawlwatcher.py # Debug start: From 3cc066dfd5b1fc5ff5db5f33371528be80aa1b00 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Tue, 5 Mar 2024 23:37:33 +0100 Subject: [PATCH 21/35] feat: add STREAMLIT_SERVER_ADDRESS parameters in template and docker-compose --- .env.template | 10 +++++++++- docker-compose.yaml | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.env.template b/.env.template index 4c2acf0b..0c6b05da 100644 --- a/.env.template +++ b/.env.template @@ -3,7 +3,6 @@ ############################################################################################### # these values are used in the local docker env. You can use "localhost" hostname # if you run the application without docker -# these values are used in the local docker env. You can use "localhost" hostname if you run the application without docker POSTGRES_HOSTNAME=postgres_bloom POSTGRES_USER=bloom_user POSTGRES_PASSWORD=bloom @@ -28,3 +27,12 @@ DATA_FOLDER=/data # Default is set in docker-compose.yaml and/or in dockerfile directly ARG POETRY_VERSION # Changing this value will change the version poetry used to build Docker image of Bloom #POETRY_VERSION=1.8.1 + + +############################################################################################### +# STREAMLIT SPECIFIC VARIABLES +############################################################################################### +# STREAMLIT_SERVER_ADDRESS (Optional) +# Default is set in docker-compose.yaml +# Changing this value will change the listening addess of streamlit server +#STREAMLIT_SERVER_ADDRESS=0.0.0.0 \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index c262bbe8..b77829c2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -28,6 +28,7 @@ services: - ./data:/data environment: <<: *common-env + STREAMLIT_SERVER_ADDRESS: ${STREAMLIT_SERVER_ADDRESS:-0.0.0.0} ports: - 8501:8501 networks: From c2f697a021eb0b4d87841a6f7cc4c11684d21076 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Tue, 5 Mar 2024 21:25:25 +0100 Subject: [PATCH 22/35] fix: python 3.12 build geos_c.h: No such file or directory --- BLOOM_CONFIG.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 BLOOM_CONFIG.txt diff --git a/BLOOM_CONFIG.txt b/BLOOM_CONFIG.txt new file mode 100644 index 00000000..edaf83e9 --- /dev/null +++ b/BLOOM_CONFIG.txt @@ -0,0 +1,19 @@ + +De mon côté, je voulais mettre en place mon mécanisme de gestion des configurations qui me permet d'avoir une seule config pour du déploiement natif et de la surcharger à la marge directement dans le docker-compose pour du déploiement Docker et je n'y arrivais pas. @Samuel Enguehard a émis ce besoin pour pouvoir lancer en natif et utiliser les outils de débogage intégré à l'éditeur graphique j'imagine, ce qui est quand même bcp plus confort, mais de mon côté je l'utilise tous les jours et je trouve ça vraiment pratique d'avoir une seule conf sans se poser de question si c'est du natif ou du docker. + +Au final j'ai trouvé pourquoi, c'est parce que le mécanisme de chargement automatique du fichier .env activé dans docker-compose est prioritaire sur les sections "environment:" décrites dans le fichier docker-compose.yaml et vient donc écraser les valeurs qui ont pu être mises dans le fichier (je l'utilise par exemple pour forcer la valeur POSTGRES_HOSTNAME|PORT:postgres:5432 dans le fichier docker-compose peu importe la valeur du fichier .env initial mais avec ce mécanisme, c'est la valeur du .env qui mise systématiquement. Du coup quand on passe du natif à docker on est quand même obligé de venir modifier la valeur des paramètres dans le fichier de .env POSTGRES_HOST/PORT mais aussi mettre des chemins typé "Docker" pour les secrets: /run/secrets/postgres_password au lieu POSTGRES_PASSWORD_FILE=./secrets/postges_password quand on passe de l'un à l'autre... c'est un peu dommage mais soit +Ca devient donc impossible d'avoir une conf native par fichier+surcharge Docker au niveau du docker compose au sein des ces sections "environment" + +Bref ça me rappelle pourquoi je n'utilise jamais le chargement .env par défaut de docker-compose autant pour le dev mais surtout pour le déploiement en compose, c'est pas flexible (https://docs.docker.com/compose/environment-variables/envvars-precedence/) + +De ce fait on en arrive à privilégier un déploiement des paramètres par variable d'environnement et non pas par fichier au niveau d'application (comme certain préféraient dans nos discussions) puisque c'est le mode un peu forcé si on utilise le chargement des fichiers .env de docker-compose et que c'est préférable que le fonctionnement de l'application soit équivalent en natif comme en Docker. +Perso, dans tous mes projets, je mets en place un chargement hybride des settings par fichier + env avec priorité pour l'env (standard Docker mais c'est hyper pratique) donc je fais les deux mais de manière maitrisée, mais l'idée là est juste qu'on se fixe officiellement pour le projet bloom, c'est pour ça que je voulais savoir si au final ce sera déployé en natif ou en Docker pour valider que c'était pratique sur toute la chaine et non pas que pour les développeurs + +Pour ce qui est de la flexibilité pour lancer en natif @Samuel Enguehard, pour ceux qui alternent natif/docker ou ceux qui alternent dev/test/prod/... j'aurais une proposition qui n'impacte pas le fonctionnement par défaut utilisant le .env et docker-compose: +on utilise une variable (optionnelle) d'environnement BLOOM_CONFIG=.env.dev par exemple (.env par défaut) (qui peut d'ailleurs se trouver hors du dépôt Git dans ce cas, ce qui est très utile dans le cas des déploiement automatisés Docker comme natif avec une conf locale au serveur en dehors du dossier gitlab/github +Dans cette solution il suffit d'exporter la variable COMPOSE_ENV_FILES qui précise le nom du fichier par environnement à charger (par défaut c'est bien .env) et lui donner la valeur de BLOOM_CONFIG à savoir " export COMPOSE_ENV_FILES=${BLOOM_CONFIG}" sous Linux et set COMPOSE_ENV_FILES=%BLOOM_CONFIG% sous windows et de faire simplement +export BLOOM_CONFIG=.env.dev ; +puis, pour Docker: docker compose up (il prend automatiquement la valeur COMPOSE_ENV_FILES qui est égale à la valeur de BLOOM_CONFIG +puis, pour du natif charge à l'application d'aller chercher les valeurs du fichier BLOOM_CONFIG si cette variable est définie, sinon on charge le .env par défaut (=> évolution de bloom.config) +Dans les deux cas Docker/Natif, bloom.config doit charger le fichier BLOOM_CONFIG si présent sinon .env, puis surcharger les éventuelles valeurs qui seraient aussi présentes dans les variables d'environnement +Je précise que ce mécanisme apporte de la flexibilité pour ceux qui alternent entre natif et docker (il suffit de faire BLOOM_CONFIG=.env.docker et BLOOM_CONFIG=.env.local) et en vue des contraintes de déploiement natif/Docker (BLOOM_CONFIG=/my/secured/folder/.env.prod), cependant pour les développeurs qui utilisent toujours le même environnement, il suffit de laisser la config par défaut (.env) sans modifier la valeur COMPOSE_ENV_FILES et/ou exporter BLOOM_CONFIG, ça utilisera le .env partout comme actuellement \ No newline at end of file From b919447628f31e317f4f1401644890aadc250da0 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 00:36:01 +0100 Subject: [PATCH 23/35] fix: python 3.11 build geos_c.h: No such file or directory --- docker/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d729d91f..53a1ad08 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,8 +2,10 @@ ARG IMAGE_PYTHON=${IMAGE_PYTHON:-python:3.10-slim-bullseye} FROM ${IMAGE_PYTHON} RUN apt-get update -RUN apt-get -y install wget gcc g++ -RUN apt-get install -y rsyslog +RUN apt-get -y install wget gcc &&\ + apt-get install -y rsyslog &&\ +# added for python 3.11/12 compliance + apt-get install -y g++ libgeos-dev # Define working directory WORKDIR /source_code From 9b0a89e4616bee57aa26e26ac174250f4a84c68b Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 12:49:28 +0100 Subject: [PATCH 24/35] =?UTF-8?q?fix:=20nettoyage=20r=C3=A9pertoire=20/dat?= =?UTF-8?q?a/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 ++++++ data/README.md | 0 data/_info_subset_data.docx | Bin 14194 -> 0 bytes data/vessels_subset_02022024.csv | 11 ----------- 4 files changed, 6 insertions(+), 11 deletions(-) create mode 100644 data/README.md delete mode 100644 data/_info_subset_data.docx delete mode 100644 data/vessels_subset_02022024.csv diff --git a/.gitignore b/.gitignore index 30ac1a27..55af72a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ +# APP BLOOM + +/data/ +!/data/README.md + + # From https://github.com/github/gitignore/blob/main/Python.gitignore # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/data/README.md b/data/README.md new file mode 100644 index 00000000..e69de29b diff --git a/data/_info_subset_data.docx b/data/_info_subset_data.docx deleted file mode 100644 index 5d89b7004ecdda3cb07a8eda4b8e6ae559283343..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14194 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ð{wKGTRWhZ&LYYC}oAwgBD zhkl=%RbJHeeNF{Y-|Fq*{es=d#V^lVuTd8kj-_KZSAD`Q)NpQU=3TiyH&pmP(}7D3 z>aR|dA3Zh($`9sDP)(ZMCwy@jtr>=CQ53>IuUM9EEb3Q|C_$!TT@fr0150lTv3=!$_5 zIGEpdl39q&WCS)jUHwuy-nK}1CfutdW)9*L1kU5kFDXtXX)yDFd4xE08su6CQfF?*2c8IpXq;_k({VYMq-H~bbF*xKHB0K>x zpQ?x2H73|o|87Qhq5vCX3!M`$Hw=5$fsnj}b08nRmkw!v5t)>Z)r3m~sf~*&hK&QP zlb%{dqDX^YgvdS{WZ<(4!pj38SvwC-BEE}j>ar*DE3rbUKmIPb1glQiPHlm>x_5Xh z1et3Lf^}={R2Vk=1@|EbG9=_j>gK|?)gNaMKP19NsO#8UyIwWFQG?tw<(98mFMLXt4l^E^$*kvDE^ZXskLO@Jz=V^C5@DT&Ym@_bZB*mv z3sNgDiqCJ3lR>!zQ5>g}M@StsD+dl}w!Hyn`vl@hq7x-co)TF z`X53hlNGv^g5Qp|4^wW*mV3xZv*BO|2IGEghvAbdE;-crsjz~(Up_w!_nDHy`*ONp zAM9+=MmDnU(&Q11jdnh6Rruz3ojt!C-__vwS`S5Xz3xuxc09ktzA4bcYHVLe=y_PG2> z-l)g9)_iE?)AwLlH+z=_JTHXHbRyKvIWiW%r>JST?Rjo(Wy{?vI!S@2A6_X#YeEO# znp|r4cGs<->}9Pe0wJ)NY~}3Oq3i>S3icL33?mn@1z_6G67fv~qKh0u*|3EwNigCB z2{Rb-B#FSf$E-nmHbSg#Z8@<;tdH97zX|m&@y!+^DfUI7O-to3j-U@P#jXl6)Wvh9 zUFGT9;rGno7mpoA*CMc_AA8wMbwZgBp51zL#7YyT8W{+l;Sc`&Mw1DG7*V1!K@|RT zan#@genb|Ql!iFnRZuCwTElv#>PU zcmfvs86xy`Wifk&`Rg6?c+-`a%5au4gK2V<_71QTgZgDYE)X^DwHfv0d?2(%r-s>0oH-`H3hlLIhcnKQ61BWJ0a};nJPUs0KThyV@Ww)F9gsp& zh7NypxL_u_o{$L^p6Sico3%C0>qgb_A06gDN^dzYio#pPD-<1(EqngnUUGJ5J;>Co z{l%)LtR*L=1Qw~)j!}H4mo8w`(EC2gdu>e1VoI@iu~6RD3qrSos4fM|%-}Z5kj+sU zcNS*4VK-)r^dr+Y`N2mDMSM&WYF9F}5TDdBhFt-d_%MaE9Em&JkKwI?;xJ!wT!Ez- zY<4BIPcI3H7pT0wQf74BNw+W2;dfKwE1@0Bkd9A01C&F@{jT|$I9%Wkqc()}$hvh@ zz&;`3tImHy%z-`|i?BSjut$!*qh3N3cEZdXh)$5*BiCwHb#i!`l3H*zzD3Jqhe=Lc zf13C1jLY~&JWh=k*2aALu-&KqlU+r9omH)<%#(Y8IknYhh5GUpO&~_2DUDy6zDaIW zMB1W64PhrmGkC9w^GAbi;7zGAT7O;jY-cpu%E<+dkPlk<97eK$Vz4gtC(u#V1ap$9 zg3%KPSq?@SjkA}8joW|-Tx1E@Zq{i>&_5rdp=d)ZB;U}HS*N0 z@1S*>XULcWHA<$cKyPfivF@Wy-u#b0nb$5@_~o{@1nD1YV)i&inG51Nv`kD@S7|CvzK9$KOI>gUW_&0ULr3 z@8N4`*j*BzpU7%)1&MXFHgkIgaYf?UxF4j-3-D60xr_7LQ#33bd!q(1_YE=q)wmZU zPAu>J#bx^R^v9G42%fuu$Z*!)4g}(@mDW4&dd$g=`0rto}C>+jHmL-it+0 zmasM!Ajn!pm1&-h^U_C8<)!q3M*>V~z-o}gaUr6uHy8=A){HbDmT@HPc|zweb`0Vj zIU-}7DnA=a&>0oP@`Q?{#VE=nkXzmy5q~CiXn%_)(+Fv8!tf3!pT%n_7ccmP6GS_~&iWCeLZOf17#W^`&0s3xt#nZ%X;Eoi!r?JJ9gxXwC)|}G<|iPj@FSW% zK{vBNl+Ab z*AcYj-fUD@UK<1gVqy=wEnK*`#IvEV)Ejx3{j&+`4RpfJv;+%%bSQXAqqbc?WFyDb z;OFDeHgwIMLhAr4{&kNt19YM=x^pt-HFG~NUF~egUYA5OgCU!Nc0bY=EhHw5Otd^( zE{BH}ywxpsu*RMtvH3l?PqCbQ^g@SFm_GpR7%3@2%&aYSmTe*qoENt^Kb0xX21|fb zr}3!XlJc!NoJi$oqEj6q^Gjoiw0IHrPRhp_(FXW&V?U>)>gE)l&P?TKmv6P4Fnjae zE>_tR4{g-@P?e62#s6To$gpAfX-#)WwlvQ{7h1Me7IaSh6ldFq15J(UlIG19yoBL) z7ukc#u@b*AyHp%V?a*XaJ1~I?-_*Z^WC%PkfE4tE7&1#8-HDVGflYG`_8dGc?!mv= zU(Y=XPTX}sCxN`00VbpgeOSv&g(_rD9^rYl9?s#}(a{-GJX08GNO`-gLuGc#szn{w zYaH7;)dKy(uC5*0!;llbZG;k4pzg$}Bb8clxocf3RgK2VYR~ml(hYuAaCfBpUtPjE z6uFGdI}hjc?iP^$oFTg!8z}zGD`d^+TK3W*050x&x&(*Yi${>jRrFzobO!ZSz{3vb zLWo-vA}h{j&X>y^?+xw}-tM+(@UM0!mUcdVz_@NjhgFRCTTnyq9v*mFv7q}1DZC49 zJS|9b%V*Hq(wWYx4t%T{7B8#N8&NWLsHH?dpPp1mX%`Wq7Pvo-6sQXZ>1TM!b5YidKq^Bb3L+8% zss30u)fHf+rfPF|nAgs=!4So2DGz&@Nyqh^E^DrJ^M3>r|6ZOTO8;ys$;o%H6!cx=JQ402}Xi_nMh!gT4} zOLEFSaq0b?A&F*+R)^Wi)N07WHRwvEnY@MP^`ZMmQ+G(=&UFXw@;ABYkW_>+2f+)DxA@#9K9@Gtmvz9}obM?nTnD}e<6f_2 zgf2|)(m@5pI&{gr$K@Kubv{z?-JMLT~kNiH5K9SnyPPS_kW7| z{>uJ1vJ^&T-Z}ja!b^Dhvns_>sPd+2Im91d3lxB}s67+a*qV&7W?#88i-YiNb{ZIu zu_vuyj=e4GWMSkv+eb`i2qvc_N*bzEA0*vbTPNz%f|PsNA}gN#=yk8I7#G3z>4~E0 z2_dmm-4hdZ8BmP_tHKm5G>?>M8VC?!m>rdih}StDrt_sw^2tzP?jWlKm@fnM)+uRt zXMBZ|6SKSTHE_5N?a98}h!E|_t`(+Jq-y8^Ll;T*CbbFcAaDZ~BQObbfsUcw9QlQP zn8D{&Yt4la7^Xiwc)37Y1#Jy_78Hp!XuOsh+f6Hzd-6Pvx4G+W6Y^oWknsk{giZ{i z_XajO@oG<@8Bv9CKx|~K!a}$xps&h#=spkAX!w>>NVVZCkNHEQ#OP zA=}B68J~a_N8MY9v|p76cj?b3cnb{n_w#%t>~VTzvb0p%Fnwid1MRw%O`JrX3Fz7$ z>|!6`?!b6`FP8Xs62S*NVGjTU0021y0Pn=mf077}PVQF5zfW^JvR52d*pNcbn=Ll{ ziz=2P`%T&HqZy4kFP9tbe}rd^GYbiz&g13n_Jn#rg7QfOtbz=Hd3q(PB|Q@Q;rf0Y z54?WDoh*yOao2%J&W^cVKaU~E8K6L1dO1AUU)ybmFDNBbPoXPg@Zs>-8aRlR^?h48 zmn9W`AaF-C=TpflygW41Nr_C%&L+sYN-Uau|?o zKv77h>vHSrI#d9bc$ZhYB-Q_1A5oEHS`@u8+&U|ijN?%9jGK>Nyp4P5OrHNvN#D=4I zRGK=ytD3X!hsoFB+*6mC;Azs+V4;EBhbZMbsoTIr}4 z7fIAzx>s37H(s(@sM)bEE0>t&R%Z}LH>4+|Hf3hMJo=WjN6u9|D%K2&JSnxiD3HRx z(Byh6UjoaL6!~mBHCVb7vA%Y6jR%i72e4s#KQCHkT_|aV6K$nm^;pp$y;@Gx=Yq=4 zue^0Mkl3>HmycX;fDai~q*5i&PSWe9CFO05r(ty3lJI57sv2}UV!dt*INhsoa(Gl=M{ih&4%s#qz}q$wMm|uw z64eQnm_50-VDYUDUbY~PU#7v1U%Ek#U#fwQU$Oy>UrISK4Kc<}f0|?xwv#}4GRb3H zg6FF5%xr%_M;u)95rf#a;r$R~-%R>UcXs=XGq{#B(buw4?~3l~SvTl-T%_VuWu1~7 zsLi5SKBhEWkiZLH@LgyWaT8GzX`B#bucOjoGAwB9Fl*B7-5Dv$SaFmhW5m``WFw7@gSL|z zUQ*%XbP>lBkyny1RgARKhvTKql1Dl+cbG@S?}paoqw}bMA!Vy7I1tRUW{{hx_gMl* zV(4J1ja`g>hsz5WP{wa%kFP`0ZHOBcVYHhMrLMNXy!f-i4 zsIj_PaYx`z!)WdTXzjCny5#_2-9m(@Q7wvX%Ye-_!xGh0wb@a+I5V}Tw552b6sLY& zIa)*C+Th3*qm{LvWIUP?i`fv;*ru%syX8*dH?LzAINQYx=2exNdL;8JOd@{Dq6l2G z?-z5U0sC!Kp6F6-N($wqIa7$F#??oydm26)65mIE>V6-{Lg}5CzzTZ}ecX)(o`%(g zIh(37A}E+X9c@p7#F(zat3I>o5^=TAACY3DWBTf-oI*it$YT1z_i3Qy?X&r2I!!=5 zTK;+tVm3})Ei}JfT$wlpKEa`J@i&lR`q`ha1G>c#yO6M_Ec-W|9K@sqGHPw5XxJd@ z-`y|8_i+Q};&xv$cYCwY@)_o^A;;LQ)s$x5F5KM8pNa_*7zH;fzUTNhNNQtAhhlX} zEq;a7B~W9&+3Fe74VbXm3~_Y<7M)vy9*z)jqs;@mDs5}uk-u|wyIiJ=5@QLHP%&4LyIuSV!D;0_`$C+>kRoa)G4b;?Ju*lN2D(6@x3|=&mW~3JDoV+3 z%k_Y*cB}dD{d9LUOP5dV2V9V0S{Uk^U%>?zWs#$fKF3v0SMF}2uXJ^?>DX_|*a=b0 z+0Q0c&c2U#2*;#8JQF;k{wfgkOz^->$i}ZRW8=uo2yb6n*%h7%FrSc@>>Y54E*60uotZ=xRKainj7Y)%;Psy6C%l+Atq(x#I`rM8+? z44(Srk$wA2akg*FlwLD&+n#oLHvi4Irwg&kJJi~cXZ;+aeJi~5yRqO_AM$qKYmbYF zEeLI{`yqr*4G{}LtcOUicTBTrwdycd{17+c77y=rR0Gdi*vZd6(-htYnV{|Jhx+nM zuEg^eOVp|WP1hCXc$Ii-#f$e#Yc*nyNJGa)K>5rhSDqiTUzN)maX}eS;?7(|CfHQaQJIqh)jUEw9?L({2O`r_llKQMYCJ8^f#p zNw&>%*t+{r>_N8QbC^#0H>?;5aUY5E)g94m83i8@4$U6I4>X!RZdy$Nm-tIi3IcU= ze#(Bh)1K^`qMxIo5X}nU)X47<$qE84@CpQ=mP--*Stx|wThR2_3VPkL>7MsiKSU5&XV*FSr1XCix5DoID9`=6n`dkyGbUg0}B!j=V;eW7J z3gdh4DklQE#V-{C~#wAINW)Bc*s;-~JlC_EmkW&|&+y54`XEjOUQgo206Aflo`U zLwjl9`~0Wkx$VI9f8?c(7j{|OQ|mFGe- zHNzDDgjo^5dx8ZyQTEA2+MN{%**#R7aV;98Vxq75bEEiHW#u#kVWf{4S?Z7B#U)xHBsm`f9;6$C%1ScrXn@9{Tz&f?aS`Bq}l z3X70K)V*1Jt3XST{luoEbe}aG@_{ReLlM-d`KwYgw#$iCnRxSRJbVOnF0I}iPVv!71Bsb;ZO*C*)`n(bx%*0BVRqcq#g+FYb~2UsdG48J33yVv z=4b=NlB44xQ7@JEWUsUDBl+2>>kLY~yYU9?Ne%E`xHr#pYvmCOTQ{5u7F;{#q_gh! zUVA;4cBit!f&GHhiwk7i$wP$JO7P9Bu1_1HW0lfND{S^ril>GaW`%RZyhglo_T#M2 z4fCa8qF+;^e6tya<;^wjLOSAo*+W@fTh%aQh5X|SG|et-1#cDVYpeth<+1CX%jp7f zhlj6*?^P}Fi{A%Sg*?Yg}_wYiFj(f!z~U%htk8 zgSO3Xc!@rXb4{*vWoYVQr?;;9^bMocBmef6kBsiDqwr$5fe{NU60>NT+wRI9;#FH8 zOJRwpDt78KqEq9;$Yc{uS6y>S#gnvx0CA&vXLn>iGaB_91<%WS$54q2n1kHTVBK(fY+o+p?ETEXsfZ{i6$+x4N$Wxk zb1xSvLQWD;A=`Tb*zHx1ScsyNnh3)yOxg5H|3Qm0Rvxv8dzC;3vS) z7wsbo2PZ{CR%%2t;bVNiP_(fQ*-^~V24WM;sDvbb1W1uq(uZA?03rIT3hMcM z&!qd3E=G5gm_cBoLgTLVpv(M9a$R~|gA)y2yp|HYYh(3XS@ylL<|JSHunXCKf^H$$ zqNyL*>7D#1va|tbNdikWhh6F<{u(pAY?IrHEqU5q-DK^iNtLc`~VpvC5muI*1dG3x0&!T zIzvB3U8ZPI(a2Zx9bP&(SpeQ4X)xuBBnruq%IK*B&a`DpaYZU1H8dd8N_Wo34uD>1 zg-=~yGtyr&3E5Rj%)Nx084?V!%)G8mA$k}XlV?<2wn&*??(Mce8*=QoQG={bj+Y+*aj^C$^Y_NojY`U)48Ykc+{!}tCw#Jpt3%Pd z+8yIkG38b4#g789MIciN!GNYP!sZ@nEG3{2_!7C+i9Ep#wGT4UYyYVmp_*+Kb2sIF z!T|O77I6kPz~3T53yDfp_u^Hl;c8l-1ucYjz*Cd>y!5-nZb-#|g?+2U+w-NWZZ;R| zr{bA&J?mGwvTAqNJp@W`0}s)Jg^w53urDgb$*thlh}SBdRv;Z(Gq%2W^G+Pt#fJ;P zn$RBkOT&D;<^ie^7i&d_+DV`LLTN_qB^w=fvOgY8cC~@NepT&LAMaENqM^*fWh znk;LZNrxVKo_LELcTOF`mmoqs*TnL@&^)wyW+H~Z2eT>uG-zk#ywRUYGYq-7EYyB; za`L|CJdpkl-cufwvlv#DL2#N{1SnBySIdUs`o-9pQPls7&|aZJg7Lvu7!S2BU)K#P zDB>!}&)rPW{ESK(nzX%BQwfj;Hp=5fOsEpj23rcY0{qvL*4~22rQy4lI`*CrhEXM@ zeFv6gX=LockTQ)7 z<+aUnQmh2A0cVJ}ruiPAh1-Bj3_Xb@pHGJC^a2O&BU=w_6W8Ci9w7J6!5lx(wT_R< zC$-#RwsrLL#@eyM)2;)zALeE_LVtbi*abvVly|1y?67Mjq- z(NszC)?foHb92MV754OMbelDU7ci`5{UC-%FZvL!3gs*bV$=lj@QGn+|Czc^`*FfB zeGg4u&Ngj9iXivC8$1`I6>L_foaT5sTvy#*Kr{wh%N0vjvQZLjolYaECEDz8J>i3M! zf8Sj6Cs+CB=YQF1Bq#Y#0sq|o@F(!M&)oOa(cd;h{0jVMUHIRD-S3rI|Gz5nUnTuo z8vK_muy>>TSE2B)@L!9;{(>vMbA-Rce=QCBRm86e^uI(Hp#I4+{w;C#EBx1F+h1^J z%s=42q~3m&@XvJ7Uw8oE1`7cASMumr_&+)Pzr%BJ{s#Yp(f<|wE35h!UK0P$r~e<0 z^;ht(v#h_sZq$E(|1szK75}S${R`hk{|Ejb-d0W$^j*CG?<_D30O(yqHJN_9`hP{) BdQ1QS diff --git a/data/vessels_subset_02022024.csv b/data/vessels_subset_02022024.csv deleted file mode 100644 index cf71a418..00000000 --- a/data/vessels_subset_02022024.csv +++ /dev/null @@ -1,11 +0,0 @@ -"id","country_iso3","cfr","IMO","registration_number","external_marking","ship_name","ircs","mmsi","loa","type","mt_activated" -621,"ESP","27678 ESP","8516043","3VI-5-1-15","3VI-5-1-15","PARADANTA PRIMERO","EAAB",224378000,"58.38",">25m",False -784,"FRA","FRA000919999","9828936","919999","CC919999","SCOMBRUS","FLVN",226347000,"81.37",">25m",False -795,"FRA","NLD198300393","8224406","716900","FC716900","PRINS BERNHARD","FKHH",227302000,"88.24",">25m",False -835,"FRA","FRA000932206","9741097","932206","CC932206","GEVRED","FIUO",228066900,"77",">25m",False -863,"FRA","FRA000914221","9352913","914221","MA914221","VENT DU NORD II","FMEU",228215800,"41.92",">25m",False -920,"GBR",NULL,"9877389","GY127",NULL,"HENDRIKA JACOBA",NULL,232031183,NULL,"Demersal seiners",False -1194,"NLD","FRA000544858","7928835","FRA000544858","SL-9","JOHANNA","PHOE",244938000,"34.3",">25m",False -1280,"NLD","NLD201001155","9599731","NLD201001155","UK-153","LUB SENIOR","PCGC",246749000,"28.5",">25m",False -1431,"POL","IRL000I13000","9204556","PL02315","GDY-151","ANNELIES ILENA","SPG4839",261084090,"144.6",">25m",False -1507,"PRT","PRT000023094","9297694","PTAVE-117345-N","PTAVE-117345-N","FRANÇA MORTE","CUFE7",263581000,"73.8",">25m",False From b904e478a1e8f9aff6098a3aecb169106b91e602 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 14:16:00 +0100 Subject: [PATCH 25/35] =?UTF-8?q?feat:=20pyproject.toml=20gestion=20des=20?= =?UTF-8?q?versions=20python=20support=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- poetry.lock | 353 ++++++++++++++++++++++++++----------------------- pyproject.toml | 2 +- 2 files changed, 191 insertions(+), 164 deletions(-) diff --git a/poetry.lock b/poetry.lock index a9acc0bd..20fcb19e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -894,6 +894,7 @@ certifi = "*" click = ">=8.0,<9.0" click-plugins = ">=1.0" cligj = ">=0.5" +importlib-metadata = {version = "*", markers = "python_version < \"3.10\""} setuptools = "*" six = "*" @@ -1251,6 +1252,24 @@ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.link perf = ["ipython"] testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] +[[package]] +name = "importlib-resources" +version = "6.1.2" +description = "Read resources from Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "importlib_resources-6.1.2-py3-none-any.whl", hash = "sha256:9a0a862501dc38b68adebc82970140c9e4209fc99601782925178f8386339938"}, + {file = "importlib_resources-6.1.2.tar.gz", hash = "sha256:308abf8474e2dba5f867d279237cd4076482c3de7104a40b41426370e891549b"}, +] + +[package.dependencies] +zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)", "zipp (>=3.17)"] + [[package]] name = "installer" version = "0.7.0" @@ -1636,6 +1655,7 @@ files = [ contourpy = ">=1.0.1" cycler = ">=0.10" fonttools = ">=4.22.0" +importlib-resources = {version = ">=3.2.0", markers = "python_version < \"3.10\""} kiwisolver = ">=1.3.1" numpy = ">=1.21,<2" packaging = ">=20.0" @@ -1728,6 +1748,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, + {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] [[package]] @@ -1958,7 +1979,12 @@ files = [ ] [package.dependencies] -numpy = {version = ">=1.21.0", markers = "python_version >= \"3.10\""} +numpy = [ + {version = ">=1.18.5", markers = "(platform_machine != \"aarch64\" and platform_machine != \"arm64\") and python_version < \"3.10\""}, + {version = ">=1.19.2", markers = "platform_machine == \"aarch64\" and python_version < \"3.10\""}, + {version = ">=1.20.0", markers = "platform_machine == \"arm64\" and python_version < \"3.10\""}, + {version = ">=1.21.0", markers = "python_version >= \"3.10\""}, +] python-dateutil = ">=2.8.1" pytz = ">=2020.1" @@ -2066,17 +2092,17 @@ xmp = ["defusedxml"] [[package]] name = "pkginfo" -version = "1.9.6" +version = "1.10.0" description = "Query metadata from sdists / bdists / installed packages." optional = false python-versions = ">=3.6" files = [ - {file = "pkginfo-1.9.6-py3-none-any.whl", hash = "sha256:4b7a555a6d5a22169fcc9cf7bfd78d296b0361adad412a346c1226849af5e546"}, - {file = "pkginfo-1.9.6.tar.gz", hash = "sha256:8fd5896e8718a4372f0ea9cc9d96f6417c9b986e23a4d116dda26b62cc29d046"}, + {file = "pkginfo-1.10.0-py3-none-any.whl", hash = "sha256:889a6da2ed7ffc58ab5b900d888ddce90bce912f2d2de1dc1c26f4cb9fe65097"}, + {file = "pkginfo-1.10.0.tar.gz", hash = "sha256:5df73835398d10db79f8eecd5cd86b1f6d29317589ea70796994d49399af6297"}, ] [package.extras] -testing = ["pytest", "pytest-cov"] +testing = ["pytest", "pytest-cov", "wheel"] [[package]] name = "platformdirs" @@ -2110,13 +2136,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "poetry" -version = "1.8.1" +version = "1.8.2" description = "Python dependency management and packaging made easy." optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "poetry-1.8.1-py3-none-any.whl", hash = "sha256:cf133946661025822672422769567980f8e489ed5b6fc170d1025a4d6c9aac29"}, - {file = "poetry-1.8.1.tar.gz", hash = "sha256:23519cc45eb3cf48e899145bc762425a141e3afd52ecc53ec443ca635122327f"}, + {file = "poetry-1.8.2-py3-none-any.whl", hash = "sha256:b42b400d9a803af6e788a30a6f3e9998020b77860e28df20647eb10b6f414910"}, + {file = "poetry-1.8.2.tar.gz", hash = "sha256:49cceb3838104647c3e1021f3a4f13c6053704cc18d33f849a90fe687a29cb73"}, ] [package.dependencies] @@ -2126,6 +2152,7 @@ cleo = ">=2.1.0,<3.0.0" crashtest = ">=0.4.1,<0.5.0" dulwich = ">=0.21.2,<0.22.0" fastjsonschema = ">=2.18.0,<3.0.0" +importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} installer = ">=0.7.0,<0.8.0" keyring = ">=24.0.0,<25.0.0" packaging = ">=23.1" @@ -2458,13 +2485,13 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pyparsing" -version = "3.1.1" +version = "3.1.2" description = "pyparsing module - Classes and methods to define and execute parsing grammars" optional = false python-versions = ">=3.6.8" files = [ - {file = "pyparsing-3.1.1-py3-none-any.whl", hash = "sha256:32c7c0b711493c72ff18a981d24f28aaf9c1fb7ed5e9667c9e84e3db623bdbfb"}, - {file = "pyparsing-3.1.1.tar.gz", hash = "sha256:ede28a1a32462f5a9705e07aea48001a08f7cf81a021585011deba701581a0db"}, + {file = "pyparsing-3.1.2-py3-none-any.whl", hash = "sha256:f9db75911801ed778fe61bb643079ff86601aca99fcae6345aa67292038fb742"}, + {file = "pyparsing-3.1.2.tar.gz", hash = "sha256:a1bac0ce561155ecc3ed78ca94d3c9378656ad4c94c1270de543f621420f94ad"}, ] [package.extras] @@ -2556,13 +2583,13 @@ files = [ [[package]] name = "python-dateutil" -version = "2.9.0" +version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ - {file = "python-dateutil-2.9.0.tar.gz", hash = "sha256:78e73e19c63f5b20ffa567001531680d939dc042bf7850431877645523c66709"}, - {file = "python_dateutil-2.9.0-py2.py3-none-any.whl", hash = "sha256:cbf2f1da5e6083ac2fbfd4da39a25f34312230110440f424a14c7558bb85d82e"}, + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, ] [package.dependencies] @@ -2666,101 +2693,101 @@ files = [ [[package]] name = "rapidfuzz" -version = "3.6.1" +version = "3.6.2" description = "rapid fuzzy string matching" optional = false python-versions = ">=3.8" files = [ - {file = "rapidfuzz-3.6.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ac434fc71edda30d45db4a92ba5e7a42c7405e1a54cb4ec01d03cc668c6dcd40"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2a791168e119cfddf4b5a40470620c872812042f0621e6a293983a2d52372db0"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5a2f3e9df346145c2be94e4d9eeffb82fab0cbfee85bd4a06810e834fe7c03fa"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23de71e7f05518b0bbeef55d67b5dbce3bcd3e2c81e7e533051a2e9401354eb0"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d056e342989248d2bdd67f1955bb7c3b0ecfa239d8f67a8dfe6477b30872c607"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01835d02acd5d95c1071e1da1bb27fe213c84a013b899aba96380ca9962364bc"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ed0f712e0bb5fea327e92aec8a937afd07ba8de4c529735d82e4c4124c10d5a0"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96cd19934f76a1264e8ecfed9d9f5291fde04ecb667faef5f33bdbfd95fe2d1f"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e06c4242a1354cf9d48ee01f6f4e6e19c511d50bb1e8d7d20bcadbb83a2aea90"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:d73dcfe789d37c6c8b108bf1e203e027714a239e50ad55572ced3c004424ed3b"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:06e98ff000e2619e7cfe552d086815671ed09b6899408c2c1b5103658261f6f3"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:08b6fb47dd889c69fbc0b915d782aaed43e025df6979b6b7f92084ba55edd526"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a1788ebb5f5b655a15777e654ea433d198f593230277e74d51a2a1e29a986283"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-win32.whl", hash = "sha256:c65f92881753aa1098c77818e2b04a95048f30edbe9c3094dc3707d67df4598b"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-win_amd64.whl", hash = "sha256:4243a9c35667a349788461aae6471efde8d8800175b7db5148a6ab929628047f"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-win_arm64.whl", hash = "sha256:f59d19078cc332dbdf3b7b210852ba1f5db8c0a2cd8cc4c0ed84cc00c76e6802"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:fbc07e2e4ac696497c5f66ec35c21ddab3fc7a406640bffed64c26ab2f7ce6d6"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:40cced1a8852652813f30fb5d4b8f9b237112a0bbaeebb0f4cc3611502556764"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:82300e5f8945d601c2daaaac139d5524d7c1fdf719aa799a9439927739917460"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edf97c321fd641fea2793abce0e48fa4f91f3c202092672f8b5b4e781960b891"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7420e801b00dee4a344ae2ee10e837d603461eb180e41d063699fb7efe08faf0"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:060bd7277dc794279fa95522af355034a29c90b42adcb7aa1da358fc839cdb11"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7e3375e4f2bfec77f907680328e4cd16cc64e137c84b1886d547ab340ba6928"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a490cd645ef9d8524090551016f05f052e416c8adb2d8b85d35c9baa9d0428ab"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:2e03038bfa66d2d7cffa05d81c2f18fd6acbb25e7e3c068d52bb7469e07ff382"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:2b19795b26b979c845dba407fe79d66975d520947b74a8ab6cee1d22686f7967"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:064c1d66c40b3a0f488db1f319a6e75616b2e5fe5430a59f93a9a5e40a656d15"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:3c772d04fb0ebeece3109d91f6122b1503023086a9591a0b63d6ee7326bd73d9"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:841eafba6913c4dfd53045835545ba01a41e9644e60920c65b89c8f7e60c00a9"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-win32.whl", hash = "sha256:266dd630f12696ea7119f31d8b8e4959ef45ee2cbedae54417d71ae6f47b9848"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:d79aec8aeee02ab55d0ddb33cea3ecd7b69813a48e423c966a26d7aab025cdfe"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-win_arm64.whl", hash = "sha256:484759b5dbc5559e76fefaa9170147d1254468f555fd9649aea3bad46162a88b"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:b2ef4c0fd3256e357b70591ffb9e8ed1d439fb1f481ba03016e751a55261d7c1"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:588c4b20fa2fae79d60a4e438cf7133d6773915df3cc0a7f1351da19eb90f720"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7142ee354e9c06e29a2636b9bbcb592bb00600a88f02aa5e70e4f230347b373e"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1dfc557c0454ad22382373ec1b7df530b4bbd974335efe97a04caec936f2956a"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:03f73b381bdeccb331a12c3c60f1e41943931461cdb52987f2ecf46bfc22f50d"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b0ccc2ec1781c7e5370d96aef0573dd1f97335343e4982bdb3a44c133e27786"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:da3e8c9f7e64bb17faefda085ff6862ecb3ad8b79b0f618a6cf4452028aa2222"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fde9b14302a31af7bdafbf5cfbb100201ba21519be2b9dedcf4f1048e4fbe65d"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c1a23eee225dfb21c07f25c9fcf23eb055d0056b48e740fe241cbb4b22284379"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e49b9575d16c56c696bc7b06a06bf0c3d4ef01e89137b3ddd4e2ce709af9fe06"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:0a9fc714b8c290261669f22808913aad49553b686115ad0ee999d1cb3df0cd66"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:a3ee4f8f076aa92184e80308fc1a079ac356b99c39408fa422bbd00145be9854"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f056ba42fd2f32e06b2c2ba2443594873cfccc0c90c8b6327904fc2ddf6d5799"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-win32.whl", hash = "sha256:5d82b9651e3d34b23e4e8e201ecd3477c2baa17b638979deeabbb585bcb8ba74"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:dad55a514868dae4543ca48c4e1fc0fac704ead038dafedf8f1fc0cc263746c1"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-win_arm64.whl", hash = "sha256:3c84294f4470fcabd7830795d754d808133329e0a81d62fcc2e65886164be83b"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e19d519386e9db4a5335a4b29f25b8183a1c3f78cecb4c9c3112e7f86470e37f"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01eb03cd880a294d1bf1a583fdd00b87169b9cc9c9f52587411506658c864d73"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:be368573255f8fbb0125a78330a1a40c65e9ba3c5ad129a426ff4289099bfb41"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b3e5af946f419c30f5cb98b69d40997fe8580efe78fc83c2f0f25b60d0e56efb"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f382f7ffe384ce34345e1c0b2065451267d3453cadde78946fbd99a59f0cc23c"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be156f51f3a4f369e758505ed4ae64ea88900dcb2f89d5aabb5752676d3f3d7e"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1936d134b6c513fbe934aeb668b0fee1ffd4729a3c9d8d373f3e404fbb0ce8a0"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12ff8eaf4a9399eb2bebd838f16e2d1ded0955230283b07376d68947bbc2d33d"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ae598a172e3a95df3383634589660d6b170cc1336fe7578115c584a99e0ba64d"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:cd4ba4c18b149da11e7f1b3584813159f189dc20833709de5f3df8b1342a9759"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:0402f1629e91a4b2e4aee68043a30191e5e1b7cd2aa8dacf50b1a1bcf6b7d3ab"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:1e12319c6b304cd4c32d5db00b7a1e36bdc66179c44c5707f6faa5a889a317c0"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0bbfae35ce4de4c574b386c43c78a0be176eeddfdae148cb2136f4605bebab89"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-win32.whl", hash = "sha256:7fec74c234d3097612ea80f2a80c60720eec34947066d33d34dc07a3092e8105"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:a553cc1a80d97459d587529cc43a4c7c5ecf835f572b671107692fe9eddf3e24"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:757dfd7392ec6346bd004f8826afb3bf01d18a723c97cbe9958c733ab1a51791"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2963f4a3f763870a16ee076796be31a4a0958fbae133dbc43fc55c3968564cf5"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d2f0274595cc5b2b929c80d4e71b35041104b577e118cf789b3fe0a77b37a4c5"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f211e366e026de110a4246801d43a907cd1a10948082f47e8a4e6da76fef52"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a59472b43879012b90989603aa5a6937a869a72723b1bf2ff1a0d1edee2cc8e6"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a03863714fa6936f90caa7b4b50ea59ea32bb498cc91f74dc25485b3f8fccfe9"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5dd95b6b7bfb1584f806db89e1e0c8dbb9d25a30a4683880c195cc7f197eaf0c"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7183157edf0c982c0b8592686535c8b3e107f13904b36d85219c77be5cefd0d8"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ad9d74ef7c619b5b0577e909582a1928d93e07d271af18ba43e428dc3512c2a1"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:b53137d81e770c82189e07a8f32722d9e4260f13a0aec9914029206ead38cac3"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:49b9ed2472394d306d5dc967a7de48b0aab599016aa4477127b20c2ed982dbf9"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:dec307b57ec2d5054d77d03ee4f654afcd2c18aee00c48014cb70bfed79597d6"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4381023fa1ff32fd5076f5d8321249a9aa62128eb3f21d7ee6a55373e672b261"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-win32.whl", hash = "sha256:8d7a072f10ee57c8413c8ab9593086d42aaff6ee65df4aa6663eecdb7c398dca"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:ebcfb5bfd0a733514352cfc94224faad8791e576a80ffe2fd40b2177bf0e7198"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-win_arm64.whl", hash = "sha256:1c47d592e447738744905c18dda47ed155620204714e6df20eb1941bb1ba315e"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:eef8b346ab331bec12bbc83ac75641249e6167fab3d84d8f5ca37fd8e6c7a08c"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53251e256017e2b87f7000aee0353ba42392c442ae0bafd0f6b948593d3f68c6"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6dede83a6b903e3ebcd7e8137e7ff46907ce9316e9d7e7f917d7e7cdc570ee05"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e4da90e4c2b444d0a171d7444ea10152e07e95972bb40b834a13bdd6de1110c"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:ca3dfcf74f2b6962f411c33dd95b0adf3901266e770da6281bc96bb5a8b20de9"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:bcc957c0a8bde8007f1a8a413a632a1a409890f31f73fe764ef4eac55f59ca87"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:692c9a50bea7a8537442834f9bc6b7d29d8729a5b6379df17c31b6ab4df948c2"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:76c23ceaea27e790ddd35ef88b84cf9d721806ca366199a76fd47cfc0457a81b"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b155e67fff215c09f130555002e42f7517d0ea72cbd58050abb83cb7c880cec"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:3028ee8ecc48250607fa8a0adce37b56275ec3b1acaccd84aee1f68487c8557b"}, - {file = "rapidfuzz-3.6.1.tar.gz", hash = "sha256:35660bee3ce1204872574fa041c7ad7ec5175b3053a4cb6e181463fc07013de7"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a5637e6bf11b15b5aff6ee818c76bdec99ad208511b78985e6209ba648a6e3ee"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:380586664f2f63807050ddb95e7702888b4f0b425abf17655940c411f39287ad"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3168ff565d4b8c239cf11fb604dd2507d30e9bcaac76a4077c0ac23cf2c866ed"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be69f7fd46b5c6467fe5e2fd4cff3816b0c03048eed8a4becb9a73e6000960e7"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cbd5894f23fdf5697499cf759523639838ac822bd1600e343fdce7313baa02ae"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:85a5b6e026393fe39fb61146b9c17c5af66fffbe1410e992c4bb06d9ec327bd3"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab269adfc64480f209e99f253391a10735edd5c09046e04899adab5fb132f20e"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35aeac852bca06023d6bbd50c1fc504ca5a9a3613d5e75a140f0be7601fa34ef"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e706f302c6a3ae0d74edd0d6ace46aee1ae07c563b436ccf5ff04db2b3571e60"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bec353f022011e6e5cd28ccb8700fbd2a33918197af0d4e0abb3c3f4845cc864"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:ef3925daaa93eed20401012e219f569ff0c039ed5bf4ce2d3737b4f75d441622"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:6ee98d88ae9ccc77ff61992ed33b2496478def5dc0da55c9a9aa06fcb725a352"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:423c7c588b09d618601097b7a0017dfcb91132a2076bef29023c5f3cd2dc3de1"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-win32.whl", hash = "sha256:c17c5efee347a40a6f4c1eec59e3d7d1e22f7613a97f8b8a07733ef723483a04"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-win_amd64.whl", hash = "sha256:4209816626d8d6ff8ae7dc248061c6059e618b70c6e6f6e4d7444ae3740b2b85"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-win_arm64.whl", hash = "sha256:1c54d3c85e522d3ac9ee39415f183c8fa184c4f87e7e5a37938f15a6d50e853a"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:e06f6d270112f5db001f1cba5a97e1a48aee3d3dbdcbea3ec027c230462dbf9b"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:080cb71b50cb6aff11d1c6aeb157f273e2da0b2bdb3f9d7b01257e49e69a8576"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a7895e04a22d6515bc91a850e0831f2405547605aa311d1ffec51e4818abc3c1"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd82f9838519136b7083dd1e3149ee80344521f3dc37f744f227505ff0883efb"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a945567c2b0b6e069454c9782d5234b0b6795718adf7a9f868bd3144afa6a023"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:673ba2c343644805acdae1cb949c6a4de71aa2f62a998978551ebea59603af3f"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9d457c89bac1471442002e70551e8268e639b3870b4a4521eae363c07253be87"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:495c0d8e14e6f12520eb7fc71b9ba9fcaafb47fc23a654e6e89b6c7985ec0020"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6d67b649bf3e1b1722d04eca44d37919aef88305ce7ad05564502d013cf550fd"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:e48dde8ca83d11daa00900cf6a5d281a1297aef9b7bfa73801af6e8822be5019"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:824cc381cf81cbf8d158f6935664ec2a69e6ac3b1d39fa201988bf81a257f775"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:1dfe4c24957474ce0ac75d886387e30e292b4be39228a6d71f76de414dc187db"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d57b98013b802621bbc8b12a46bfc9d36ac552ab51ca207f7ce167ad46adabeb"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-win32.whl", hash = "sha256:9a07dffac439223b4f1025dbfc68f4445a3460a859309c9858c2a3fa29617cdc"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-win_amd64.whl", hash = "sha256:95a49c6b8bf1229743ae585dd5b7d57f0d15a7eb6e826866d5c9965ba958503c"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-win_arm64.whl", hash = "sha256:af7c19ec86e11488539380d3db1755be5d561a3c0e7b04ff9d07abd7f9a8e9d8"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:de8adc12161bf282c60f12dc9233bb31632f71d446a010fe7469a69b8153427f"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:337e357f693130c4c6be740652542b260e36f622c59e01fa33d58f1d2750c930"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6468f8bc8c3c50604f43631550ef9cfec873515dba5023ca34d461be94669fc8"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:74c6773b11445b5e5cf93ca383171cd0ac0cdeafea11a7b2a5688f8bf8d813e6"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1507fc5769aa109dda4de3a15f822a0f6a03e18d627bd0ba3ddbb253cf70e07"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:617949a70150e6fffdaed19253dd49f7a53528411dc8bf7663d499ba21e0f61e"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f8b77779174b1b40aa70827692571ab457061897846255ad7d5d559e2edb1932"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80e51b22a7da83f9c87a97e92df07ed0612c74c35496590255f4b5d5b4212dfe"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3ae7c86914cb6673e97e187ba431b9c4cf4177d9ae77f8a1e5b2ba9a5628839e"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:ddc380ffaa90f204cc9ddcb779114b9ab6f015246d549de9d47871a97ef9f18a"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:3c1dc078ef371fce09f9f3eec2ca4eaa2a8cd412ec53941015b4f39f14d34407"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:9a74102fc5a2534fe91f7507838623e1f3a149d8e05648389c42bb42e14b1c3f"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:48e1eaea8fcd522fca7f04f0480663f0f0cfb77957092cce60a93f4462864996"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-win32.whl", hash = "sha256:66b008bf2972740cd2dda5d382eb8bdb87265cd88198e71c7797bdc0d1f79d20"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-win_amd64.whl", hash = "sha256:87ac3a87f2251ae2e95fc9478ca5c759de6d141d04c84d3fec9f9cdcfc167b33"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-win_arm64.whl", hash = "sha256:b593cc51aed887e93b78c2f94dfae9008be2b23d17afd3b1f1d3eb3913b58f26"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:7d830bc7a9b586a374147ec60b08b1f9ae5996b43f75cc514f37faef3866b519"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dbee7f5ff11872b76505cbd87c814abc823e8757f11c69062eb3b25130a283da"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:28c011fb31f2c3f82f503aedd6097d3d3854e574e327a119a3b7eb2cf90b79ca"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cda81d0e0ce0c13abfa46b24e10c1e85f9c6acb628f0a9a948f5779f9c2076a2"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c279928651ce0e9e5220dcb25a00cc53b65e592a0861336a38299bcdca3a596"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:35bd4bc9c40e6994c5d6edea4b9319388b4d9711c13c66d543bb4c37624b4184"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d07899506a5a8760448d9df036d528b55a554bf571714173635c79eef4a86e58"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb2e51d01b9c6d6954a3e055c57a80d4685b4fc82719db5519fc153566bcd6bb"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:153d065e353371cc0aeff32b99999a5758266a64e958d1364189367c1c9f6814"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4edcceebb85ebfa49a3ddcde20ad891d36c08dc0fd592efdab0e7d313a4e36af"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3549123fca5bb817341025f98e8e49ca99f84596c7c4f92b658f8e5836040d4a"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:84c1032ae42628465b7a5cc35249906061e18a8193c9c27cbd2db54e9823a9a6"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:9bcc91ebd8fc69a6bd3b5711c8250f5f4e70606b4da75ef415f57ad209978205"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-win32.whl", hash = "sha256:f3a70f341c4c111bad910d2df69c78577a98af140319a996af24c9385939335d"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-win_amd64.whl", hash = "sha256:354ad5fe655beb7b279390cb58334903931c5452ecbad1b1666ffb06786498e2"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1b86b93d93020c2b3edc1665d75c8855784845fc0a739b312c26c3a4bf0c80d5"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:28243086ed0e50808bb56632e5442c457241646aeafafd501ac87901f40a3237"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ed52461ae5a9ea4c400d38e2649c74a413f1a6d8fb8308b66f1fbd122514732f"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a46220f86a5f9cb016af31525e0d0865cad437d02239aa0d8aed2ab8bff1f1c"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:81a630ed2fc3ec5fc7400eb66bab1f87e282b4d47f0abe3e48c6634dfa13b5e4"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d8e5a437b9089df6242a718d9c31ab1742989e9400a0977af012ef483b63b4c2"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16270b5529de83b7bae7457e952e4d9cf3fbf029a837dd32d415bb9e0eb8e599"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5378c04102c7f084cde30a100154fa6d7e2baf0d51a6bdd2f912545559c1fb35"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7f18397c8d6a65fc0b288d2fc29bc7baeea6ba91eeb95163a3cd98f23cd3bc85"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2acd2514defce81e6ff4bbff50252d5e7df8e85a731442c4b83e44c86cf1c916"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:1df2faf80201952e252413b6fac6f3e146080dcebb87bb1bb722508e67558ed8"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:6440ed0b3007c1c9286b0b88fe2ab2d9e83edd60cd62293b3dfabb732b4e8a30"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4fcfa23b5553b27f4016df77c53172ea743454cf12c28cfa7c35a309a2be93b3"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-win32.whl", hash = "sha256:2d580d937146e803c8e5e1b87916cab8d6f84013b6392713e201efcda335c7d8"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-win_amd64.whl", hash = "sha256:fe2a68be734e8e88af23385c68d6467e15818b6b1df1cbfebf7bff577226c957"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-win_arm64.whl", hash = "sha256:6478f7803efebf5f644d0b758439c5b25728550fdfbb19783d150004c46a75a9"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:36ce7b68a7b90b787cdd73480a68d2f1ca63c31a3a9d5a79a8736f978e1e9344"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53597fd72a9340bcdd80d3620f4957c2b92f9b569313b969a3abdaffd193aae6"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4f6de745fe6ce46a422d353ee10599013631d7d714a36d025f164b2d4e8c000"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:62df2136068e2515ed8beb01756381ff62c29384d785e3bf46e3111d4ea3ba1e"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:7382c90170f60c846c81a07ddd80bb2e8c43c8383754486fa37f67391a571897"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:f31314fd2e2f3dc3e519e6f93669462ce7953df2def1c344aa8f5345976d0eb2"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:012221629d54d3bee954148247f711eb86d4d390b589ebfe03172ea0b37a7531"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d41dd59a70decfce6595315367a2fea2af660d92a9d144acc6479030501014d7"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f9fa14136a5b0cba1ec42531f7c3e0b0d3edb7fd6bc5e5ae7b498541f3855ab"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:259364199cbfeca33b1af369fc7951f71717aa285184a3fa5a7b1772da1b89db"}, + {file = "rapidfuzz-3.6.2.tar.gz", hash = "sha256:cf911e792ab0c431694c9bf2648afabfd92099103f2e31492893e078ddca5e1a"}, ] [package.extras] @@ -3142,60 +3169,60 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.27" +version = "2.0.28" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.27-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d04e579e911562f1055d26dab1868d3e0bb905db3bccf664ee8ad109f035618a"}, - {file = "SQLAlchemy-2.0.27-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fa67d821c1fd268a5a87922ef4940442513b4e6c377553506b9db3b83beebbd8"}, - {file = "SQLAlchemy-2.0.27-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c7a596d0be71b7baa037f4ac10d5e057d276f65a9a611c46970f012752ebf2d"}, - {file = "SQLAlchemy-2.0.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:954d9735ee9c3fa74874c830d089a815b7b48df6f6b6e357a74130e478dbd951"}, - {file = "SQLAlchemy-2.0.27-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5cd20f58c29bbf2680039ff9f569fa6d21453fbd2fa84dbdb4092f006424c2e6"}, - {file = "SQLAlchemy-2.0.27-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:03f448ffb731b48323bda68bcc93152f751436ad6037f18a42b7e16af9e91c07"}, - {file = "SQLAlchemy-2.0.27-cp310-cp310-win32.whl", hash = "sha256:d997c5938a08b5e172c30583ba6b8aad657ed9901fc24caf3a7152eeccb2f1b4"}, - {file = "SQLAlchemy-2.0.27-cp310-cp310-win_amd64.whl", hash = "sha256:eb15ef40b833f5b2f19eeae65d65e191f039e71790dd565c2af2a3783f72262f"}, - {file = "SQLAlchemy-2.0.27-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6c5bad7c60a392850d2f0fee8f355953abaec878c483dd7c3836e0089f046bf6"}, - {file = "SQLAlchemy-2.0.27-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a3012ab65ea42de1be81fff5fb28d6db893ef978950afc8130ba707179b4284a"}, - {file = "SQLAlchemy-2.0.27-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dbcd77c4d94b23e0753c5ed8deba8c69f331d4fd83f68bfc9db58bc8983f49cd"}, - {file = "SQLAlchemy-2.0.27-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d177b7e82f6dd5e1aebd24d9c3297c70ce09cd1d5d37b43e53f39514379c029c"}, - {file = "SQLAlchemy-2.0.27-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:680b9a36029b30cf063698755d277885d4a0eab70a2c7c6e71aab601323cba45"}, - {file = "SQLAlchemy-2.0.27-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1306102f6d9e625cebaca3d4c9c8f10588735ef877f0360b5cdb4fdfd3fd7131"}, - {file = "SQLAlchemy-2.0.27-cp311-cp311-win32.whl", hash = "sha256:5b78aa9f4f68212248aaf8943d84c0ff0f74efc65a661c2fc68b82d498311fd5"}, - {file = "SQLAlchemy-2.0.27-cp311-cp311-win_amd64.whl", hash = "sha256:15e19a84b84528f52a68143439d0c7a3a69befcd4f50b8ef9b7b69d2628ae7c4"}, - {file = "SQLAlchemy-2.0.27-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:0de1263aac858f288a80b2071990f02082c51d88335a1db0d589237a3435fe71"}, - {file = "SQLAlchemy-2.0.27-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce850db091bf7d2a1f2fdb615220b968aeff3849007b1204bf6e3e50a57b3d32"}, - {file = "SQLAlchemy-2.0.27-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8dfc936870507da96aebb43e664ae3a71a7b96278382bcfe84d277b88e379b18"}, - {file = "SQLAlchemy-2.0.27-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4fbe6a766301f2e8a4519f4500fe74ef0a8509a59e07a4085458f26228cd7cc"}, - {file = "SQLAlchemy-2.0.27-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:4535c49d961fe9a77392e3a630a626af5baa967172d42732b7a43496c8b28876"}, - {file = "SQLAlchemy-2.0.27-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0fb3bffc0ced37e5aa4ac2416f56d6d858f46d4da70c09bb731a246e70bff4d5"}, - {file = "SQLAlchemy-2.0.27-cp312-cp312-win32.whl", hash = "sha256:7f470327d06400a0aa7926b375b8e8c3c31d335e0884f509fe272b3c700a7254"}, - {file = "SQLAlchemy-2.0.27-cp312-cp312-win_amd64.whl", hash = "sha256:f9374e270e2553653d710ece397df67db9d19c60d2647bcd35bfc616f1622dcd"}, - {file = "SQLAlchemy-2.0.27-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e97cf143d74a7a5a0f143aa34039b4fecf11343eed66538610debc438685db4a"}, - {file = "SQLAlchemy-2.0.27-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7b5a3e2120982b8b6bd1d5d99e3025339f7fb8b8267551c679afb39e9c7c7f1"}, - {file = "SQLAlchemy-2.0.27-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e36aa62b765cf9f43a003233a8c2d7ffdeb55bc62eaa0a0380475b228663a38f"}, - {file = "SQLAlchemy-2.0.27-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:5ada0438f5b74c3952d916c199367c29ee4d6858edff18eab783b3978d0db16d"}, - {file = "SQLAlchemy-2.0.27-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b1d9d1bfd96eef3c3faedb73f486c89e44e64e40e5bfec304ee163de01cf996f"}, - {file = "SQLAlchemy-2.0.27-cp37-cp37m-win32.whl", hash = "sha256:ca891af9f3289d24a490a5fde664ea04fe2f4984cd97e26de7442a4251bd4b7c"}, - {file = "SQLAlchemy-2.0.27-cp37-cp37m-win_amd64.whl", hash = "sha256:fd8aafda7cdff03b905d4426b714601c0978725a19efc39f5f207b86d188ba01"}, - {file = "SQLAlchemy-2.0.27-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ec1f5a328464daf7a1e4e385e4f5652dd9b1d12405075ccba1df842f7774b4fc"}, - {file = "SQLAlchemy-2.0.27-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ad862295ad3f644e3c2c0d8b10a988e1600d3123ecb48702d2c0f26771f1c396"}, - {file = "SQLAlchemy-2.0.27-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:48217be1de7d29a5600b5c513f3f7664b21d32e596d69582be0a94e36b8309cb"}, - {file = "SQLAlchemy-2.0.27-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e56afce6431450442f3ab5973156289bd5ec33dd618941283847c9fd5ff06bf"}, - {file = "SQLAlchemy-2.0.27-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:611068511b5531304137bcd7fe8117c985d1b828eb86043bd944cebb7fae3910"}, - {file = "SQLAlchemy-2.0.27-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b86abba762ecfeea359112b2bb4490802b340850bbee1948f785141a5e020de8"}, - {file = "SQLAlchemy-2.0.27-cp38-cp38-win32.whl", hash = "sha256:30d81cc1192dc693d49d5671cd40cdec596b885b0ce3b72f323888ab1c3863d5"}, - {file = "SQLAlchemy-2.0.27-cp38-cp38-win_amd64.whl", hash = "sha256:120af1e49d614d2525ac247f6123841589b029c318b9afbfc9e2b70e22e1827d"}, - {file = "SQLAlchemy-2.0.27-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d07ee7793f2aeb9b80ec8ceb96bc8cc08a2aec8a1b152da1955d64e4825fcbac"}, - {file = "SQLAlchemy-2.0.27-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cb0845e934647232b6ff5150df37ceffd0b67b754b9fdbb095233deebcddbd4a"}, - {file = "SQLAlchemy-2.0.27-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fc19ae2e07a067663dd24fca55f8ed06a288384f0e6e3910420bf4b1270cc51"}, - {file = "SQLAlchemy-2.0.27-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b90053be91973a6fb6020a6e44382c97739736a5a9d74e08cc29b196639eb979"}, - {file = "SQLAlchemy-2.0.27-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:2f5c9dfb0b9ab5e3a8a00249534bdd838d943ec4cfb9abe176a6c33408430230"}, - {file = "SQLAlchemy-2.0.27-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:33e8bde8fff203de50399b9039c4e14e42d4d227759155c21f8da4a47fc8053c"}, - {file = "SQLAlchemy-2.0.27-cp39-cp39-win32.whl", hash = "sha256:d873c21b356bfaf1589b89090a4011e6532582b3a8ea568a00e0c3aab09399dd"}, - {file = "SQLAlchemy-2.0.27-cp39-cp39-win_amd64.whl", hash = "sha256:ff2f1b7c963961d41403b650842dc2039175b906ab2093635d8319bef0b7d620"}, - {file = "SQLAlchemy-2.0.27-py3-none-any.whl", hash = "sha256:1ab4e0448018d01b142c916cc7119ca573803a4745cfe341b8f95657812700ac"}, - {file = "SQLAlchemy-2.0.27.tar.gz", hash = "sha256:86a6ed69a71fe6b88bf9331594fa390a2adda4a49b5c06f98e47bf0d392534f8"}, + {file = "SQLAlchemy-2.0.28-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0b148ab0438f72ad21cb004ce3bdaafd28465c4276af66df3b9ecd2037bf252"}, + {file = "SQLAlchemy-2.0.28-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:bbda76961eb8f27e6ad3c84d1dc56d5bc61ba8f02bd20fcf3450bd421c2fcc9c"}, + {file = "SQLAlchemy-2.0.28-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:feea693c452d85ea0015ebe3bb9cd15b6f49acc1a31c28b3c50f4db0f8fb1e71"}, + {file = "SQLAlchemy-2.0.28-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5da98815f82dce0cb31fd1e873a0cb30934971d15b74e0d78cf21f9e1b05953f"}, + {file = "SQLAlchemy-2.0.28-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4a5adf383c73f2d49ad15ff363a8748319ff84c371eed59ffd0127355d6ea1da"}, + {file = "SQLAlchemy-2.0.28-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:56856b871146bfead25fbcaed098269d90b744eea5cb32a952df00d542cdd368"}, + {file = "SQLAlchemy-2.0.28-cp310-cp310-win32.whl", hash = "sha256:943aa74a11f5806ab68278284a4ddd282d3fb348a0e96db9b42cb81bf731acdc"}, + {file = "SQLAlchemy-2.0.28-cp310-cp310-win_amd64.whl", hash = "sha256:c6c4da4843e0dabde41b8f2e8147438330924114f541949e6318358a56d1875a"}, + {file = "SQLAlchemy-2.0.28-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:46a3d4e7a472bfff2d28db838669fc437964e8af8df8ee1e4548e92710929adc"}, + {file = "SQLAlchemy-2.0.28-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0d3dd67b5d69794cfe82862c002512683b3db038b99002171f624712fa71aeaa"}, + {file = "SQLAlchemy-2.0.28-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61e2e41656a673b777e2f0cbbe545323dbe0d32312f590b1bc09da1de6c2a02"}, + {file = "SQLAlchemy-2.0.28-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0315d9125a38026227f559488fe7f7cee1bd2fbc19f9fd637739dc50bb6380b2"}, + {file = "SQLAlchemy-2.0.28-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:af8ce2d31679006e7b747d30a89cd3ac1ec304c3d4c20973f0f4ad58e2d1c4c9"}, + {file = "SQLAlchemy-2.0.28-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:81ba314a08c7ab701e621b7ad079c0c933c58cdef88593c59b90b996e8b58fa5"}, + {file = "SQLAlchemy-2.0.28-cp311-cp311-win32.whl", hash = "sha256:1ee8bd6d68578e517943f5ebff3afbd93fc65f7ef8f23becab9fa8fb315afb1d"}, + {file = "SQLAlchemy-2.0.28-cp311-cp311-win_amd64.whl", hash = "sha256:ad7acbe95bac70e4e687a4dc9ae3f7a2f467aa6597049eeb6d4a662ecd990bb6"}, + {file = "SQLAlchemy-2.0.28-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d3499008ddec83127ab286c6f6ec82a34f39c9817f020f75eca96155f9765097"}, + {file = "SQLAlchemy-2.0.28-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9b66fcd38659cab5d29e8de5409cdf91e9986817703e1078b2fdaad731ea66f5"}, + {file = "SQLAlchemy-2.0.28-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bea30da1e76cb1acc5b72e204a920a3a7678d9d52f688f087dc08e54e2754c67"}, + {file = "SQLAlchemy-2.0.28-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:124202b4e0edea7f08a4db8c81cc7859012f90a0d14ba2bf07c099aff6e96462"}, + {file = "SQLAlchemy-2.0.28-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:e23b88c69497a6322b5796c0781400692eca1ae5532821b39ce81a48c395aae9"}, + {file = "SQLAlchemy-2.0.28-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4b6303bfd78fb3221847723104d152e5972c22367ff66edf09120fcde5ddc2e2"}, + {file = "SQLAlchemy-2.0.28-cp312-cp312-win32.whl", hash = "sha256:a921002be69ac3ab2cf0c3017c4e6a3377f800f1fca7f254c13b5f1a2f10022c"}, + {file = "SQLAlchemy-2.0.28-cp312-cp312-win_amd64.whl", hash = "sha256:b4a2cf92995635b64876dc141af0ef089c6eea7e05898d8d8865e71a326c0385"}, + {file = "SQLAlchemy-2.0.28-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e91b5e341f8c7f1e5020db8e5602f3ed045a29f8e27f7f565e0bdee3338f2c7"}, + {file = "SQLAlchemy-2.0.28-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45c7b78dfc7278329f27be02c44abc0d69fe235495bb8e16ec7ef1b1a17952db"}, + {file = "SQLAlchemy-2.0.28-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3eba73ef2c30695cb7eabcdb33bb3d0b878595737479e152468f3ba97a9c22a4"}, + {file = "SQLAlchemy-2.0.28-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:5df5d1dafb8eee89384fb7a1f79128118bc0ba50ce0db27a40750f6f91aa99d5"}, + {file = "SQLAlchemy-2.0.28-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2858bbab1681ee5406650202950dc8f00e83b06a198741b7c656e63818633526"}, + {file = "SQLAlchemy-2.0.28-cp37-cp37m-win32.whl", hash = "sha256:9461802f2e965de5cff80c5a13bc945abea7edaa1d29360b485c3d2b56cdb075"}, + {file = "SQLAlchemy-2.0.28-cp37-cp37m-win_amd64.whl", hash = "sha256:a6bec1c010a6d65b3ed88c863d56b9ea5eeefdf62b5e39cafd08c65f5ce5198b"}, + {file = "SQLAlchemy-2.0.28-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:843a882cadebecc655a68bd9a5b8aa39b3c52f4a9a5572a3036fb1bb2ccdc197"}, + {file = "SQLAlchemy-2.0.28-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:dbb990612c36163c6072723523d2be7c3eb1517bbdd63fe50449f56afafd1133"}, + {file = "SQLAlchemy-2.0.28-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7e4baf9161d076b9a7e432fce06217b9bd90cfb8f1d543d6e8c4595627edb9"}, + {file = "SQLAlchemy-2.0.28-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e0a5354cb4de9b64bccb6ea33162cb83e03dbefa0d892db88a672f5aad638a75"}, + {file = "SQLAlchemy-2.0.28-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:fffcc8edc508801ed2e6a4e7b0d150a62196fd28b4e16ab9f65192e8186102b6"}, + {file = "SQLAlchemy-2.0.28-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aca7b6d99a4541b2ebab4494f6c8c2f947e0df4ac859ced575238e1d6ca5716b"}, + {file = "SQLAlchemy-2.0.28-cp38-cp38-win32.whl", hash = "sha256:8c7f10720fc34d14abad5b647bc8202202f4948498927d9f1b4df0fb1cf391b7"}, + {file = "SQLAlchemy-2.0.28-cp38-cp38-win_amd64.whl", hash = "sha256:243feb6882b06a2af68ecf4bec8813d99452a1b62ba2be917ce6283852cf701b"}, + {file = "SQLAlchemy-2.0.28-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fc4974d3684f28b61b9a90fcb4c41fb340fd4b6a50c04365704a4da5a9603b05"}, + {file = "SQLAlchemy-2.0.28-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:87724e7ed2a936fdda2c05dbd99d395c91ea3c96f029a033a4a20e008dd876bf"}, + {file = "SQLAlchemy-2.0.28-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68722e6a550f5de2e3cfe9da6afb9a7dd15ef7032afa5651b0f0c6b3adb8815d"}, + {file = "SQLAlchemy-2.0.28-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:328529f7c7f90adcd65aed06a161851f83f475c2f664a898af574893f55d9e53"}, + {file = "SQLAlchemy-2.0.28-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:df40c16a7e8be7413b885c9bf900d402918cc848be08a59b022478804ea076b8"}, + {file = "SQLAlchemy-2.0.28-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:426f2fa71331a64f5132369ede5171c52fd1df1bd9727ce621f38b5b24f48750"}, + {file = "SQLAlchemy-2.0.28-cp39-cp39-win32.whl", hash = "sha256:33157920b233bc542ce497a81a2e1452e685a11834c5763933b440fedd1d8e2d"}, + {file = "SQLAlchemy-2.0.28-cp39-cp39-win_amd64.whl", hash = "sha256:2f60843068e432311c886c5f03c4664acaef507cf716f6c60d5fde7265be9d7b"}, + {file = "SQLAlchemy-2.0.28-py3-none-any.whl", hash = "sha256:78bb7e8da0183a8301352d569900d9d3594c48ac21dc1c2ec6b3121ed8b6c986"}, + {file = "SQLAlchemy-2.0.28.tar.gz", hash = "sha256:dd53b6c4e6d960600fd6532b79ee28e2da489322fcf6648738134587faf767b6"}, ] [package.dependencies] @@ -3363,13 +3390,13 @@ files = [ [[package]] name = "tox" -version = "4.13.0" +version = "4.14.0" description = "tox is a generic virtualenv management and test command line tool" optional = false python-versions = ">=3.8" files = [ - {file = "tox-4.13.0-py3-none-any.whl", hash = "sha256:1143c7e2489c68026a55d3d4ae84c02c449f073b28e62f80e3e440a3b72a4afa"}, - {file = "tox-4.13.0.tar.gz", hash = "sha256:dd789a554c16c4b532924ba393c92fc8991323c4b3d466712bfecc8c9b9f24f7"}, + {file = "tox-4.14.0-py3-none-any.whl", hash = "sha256:35976739e39e60e913bef4cf8226be64eb9eed6fdb9a44c6924265ebe11cbcae"}, + {file = "tox-4.14.0.tar.gz", hash = "sha256:286807f8a581e55785dc30ff956a81583016625f6dd296948aa7a43001c1bb00"}, ] [package.dependencies] @@ -3426,13 +3453,13 @@ wsproto = ">=0.14" [[package]] name = "trove-classifiers" -version = "2024.2.23" +version = "2024.3.3" description = "Canonical source for classifiers on PyPI (pypi.org)." optional = false python-versions = "*" files = [ - {file = "trove-classifiers-2024.2.23.tar.gz", hash = "sha256:8385160a12aac69c93fff058fb613472ed773a24a27eb3cd4b144cfbdd79f38c"}, - {file = "trove_classifiers-2024.2.23-py3-none-any.whl", hash = "sha256:3094534b8021dc1822aadb1d11d4c7b62a854d464d19458fd0a49d6fe2b68b77"}, + {file = "trove-classifiers-2024.3.3.tar.gz", hash = "sha256:df7edff9c67ff86b733628998330b180e81d125b1e096536d83ac0fd79673fdc"}, + {file = "trove_classifiers-2024.3.3-py3-none-any.whl", hash = "sha256:3a84096861b385ec422c79995d1f6435dde47a9b63adaa3c886e53232ba7e6e0"}, ] [[package]] @@ -3880,5 +3907,5 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" -python-versions = "^3.10" -content-hash = "78b2ae98e2f866db7243e21ac56f8ebc1b2e0f819badfe4c27ced49ade59520e" +python-versions = ">=3.9,<3.9.7 || >3.9.7,<3.12" +content-hash = "b53d800967d64a0846c11e2b941bbe484c607b7928b8f611fdaf747b29a7d7b7" diff --git a/pyproject.toml b/pyproject.toml index 1a36901f..d11820bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ pandas = "1.4.4" poetry = "^1.8" psycopg2-binary = "^2.9.6" pydantic = "1.10.14" -python = "^3.10" +python = ">=3.9,<3.9.7 || >3.9.7,<3.12" python-dotenv = "^1.0.0" pyyaml = "^6.0" requests = "^2.31" From ad13ea8c28ec94535008f1d9090c6f0df1f90895 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 14:16:53 +0100 Subject: [PATCH 26/35] fix/fest: generalize data filenames loaded from data folder --- src/alembic/init_script/load_amp_data.py | 2 +- src/alembic/init_script/load_positions_data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alembic/init_script/load_amp_data.py b/src/alembic/init_script/load_amp_data.py index 7ba517a6..4bfdc532 100644 --- a/src/alembic/init_script/load_amp_data.py +++ b/src/alembic/init_script/load_amp_data.py @@ -15,7 +15,7 @@ engine = create_engine(settings.db_url, echo=False) df = pd.read_csv( - Path(settings.data_folder).joinpath("./zones_subset_02022024.csv"), + Path(settings.data_folder).joinpath("./zones_subset.csv"), sep=",", ) diff --git a/src/alembic/init_script/load_positions_data.py b/src/alembic/init_script/load_positions_data.py index 24609500..a3d176d8 100644 --- a/src/alembic/init_script/load_positions_data.py +++ b/src/alembic/init_script/load_positions_data.py @@ -12,7 +12,7 @@ engine = create_engine(settings.db_url) df = pd.read_csv( - Path(settings.data_folder).joinpath("./spire_positions_subset_02022024.csv"), + Path(settings.data_folder).joinpath("./spire_positions_subset.csv"), sep="," ) From 8e3d8e9e896a727cd3b66b161ecd4e1ee017d9bc Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 19:53:15 +0100 Subject: [PATCH 27/35] feat: settings add LOGGING_LEVEL parameter --- .env.template | 2 ++ docker-compose.yaml | 1 + src/bloom/config.py | 1 + src/bloom/logger.py | 3 ++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.env.template b/.env.template index 0c6b05da..f51a8e32 100644 --- a/.env.template +++ b/.env.template @@ -14,6 +14,8 @@ SLACK_URL= # Folder where data are stored DATA_FOLDER=/data +LOGGING_LEVEL=INFO + ############################################################################################### # DOCKER SPECIFIC VARIABLES diff --git a/docker-compose.yaml b/docker-compose.yaml index b77829c2..d90edd81 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,6 +6,7 @@ x-common-infos: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + LOGGING_LEVEL: ${LOGGING_LEVEL:-INFO} services: bloom: diff --git a/src/bloom/config.py b/src/bloom/config.py index 219edc9f..95d1de6f 100644 --- a/src/bloom/config.py +++ b/src/bloom/config.py @@ -75,6 +75,7 @@ class Settings(BaseSettings): db_url:str = None spire_token:str = None data_folder:str=None + logging_level:str="INFO" def __init__(self): super().__init__(self) diff --git a/src/bloom/logger.py b/src/bloom/logger.py index 36a0f3f5..4b1c6e4f 100644 --- a/src/bloom/logger.py +++ b/src/bloom/logger.py @@ -1,4 +1,5 @@ import logging +from bloom.config import settings logger = logging.getLogger("bloom") formatter = logging.Formatter( @@ -9,4 +10,4 @@ handler.setFormatter(formatter) if not logger.handlers: logger.addHandler(handler) -logger.setLevel(level="INFO") +logger.setLevel(level=settings.logging_level) From c903af055bd568d72b7865858406f679524192c1 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 21:28:32 +0100 Subject: [PATCH 28/35] fix: docker-compose exclude POSTGRES_PORT from common envs to permit overloading to 5432 in docker compose stack --- docker-compose.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index d90edd81..a092c44c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,6 @@ x-common-infos: # Env variables stored in a .env file at same level than docker-compose.yaml environment: &common-env POSTGRES_HOSTNAME: ${POSTGRES_HOSTNAME} - POSTGRES_PORT: ${POSTGRES_PORT} POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} @@ -29,6 +28,7 @@ services: - ./data:/data environment: <<: *common-env + POSTGRES_PORT: 5432 STREAMLIT_SERVER_ADDRESS: ${STREAMLIT_SERVER_ADDRESS:-0.0.0.0} ports: - 8501:8501 @@ -68,6 +68,7 @@ services: environment: <<: *common-env + POSTGRES_PORT: 5432 volumes: - ./src:/source_code networks: From 9b82745a5c062d31c5da1d2f9367538f5264bcbb Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 22:30:53 +0100 Subject: [PATCH 29/35] feat: migrate from /source_code to /project root folder --- src/alembic.ini => alembic.ini | 2 +- docker-compose.yaml | 14 +++++++++----- docker/Dockerfile | 32 +++++++++++++++---------------- docker/entrypoint.sh | 4 ++-- src/pages/1_Vessel_Exploration.py | 2 +- 5 files changed, 29 insertions(+), 25 deletions(-) rename src/alembic.ini => alembic.ini (99%) diff --git a/src/alembic.ini b/alembic.ini similarity index 99% rename from src/alembic.ini rename to alembic.ini index 7ce8e843..7979abab 100644 --- a/src/alembic.ini +++ b/alembic.ini @@ -2,7 +2,7 @@ [alembic] # path to migration scripts -script_location = alembic +script_location = src/alembic # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s # Uncomment the line below if you want the files to be prepended with date and time diff --git a/docker-compose.yaml b/docker-compose.yaml index a092c44c..ba119796 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,14 +18,14 @@ services: IMAGE_PYTHON: ${IMAGE_PYTHON:-python:3.10-slim-bullseye} POETRY_VERSION: ${POETRY_VERSION:-1.8.1} # Nominal start: - command: streamlit run Trawlwatcher.py + command: streamlit run src/Trawlwatcher.py # Debug start: #command: bash #tty: true #stdin_open: true volumes: - - ./src:/source_code - - ./data:/data + #- ./src:/project/src + - ./data:/project/data environment: <<: *common-env POSTGRES_PORT: 5432 @@ -60,7 +60,11 @@ services: image: d4g/bloom:${VERSION:-latest} # Nominal start: - command: /bin/bash -c "sleep 20 && alembic upgrade head" + # As postgres+postgis gt available, then unavialable, then avialable at database init + # it happens that init is launch before second and definitve postgres healthy state + # and fails + # so giving init 3 chances and 15 seconds to init before failing + command: /bin/bash -c "for i in 1 2 3; do alembic upgrade head && break || sleep 5; done" # Debug start: #command: bash #tty: true @@ -70,7 +74,7 @@ services: <<: *common-env POSTGRES_PORT: 5432 volumes: - - ./src:/source_code + - ./src:/project/src networks: - bloom_net depends_on: diff --git a/docker/Dockerfile b/docker/Dockerfile index 53a1ad08..5a3d7e6b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,17 +1,17 @@ ARG IMAGE_PYTHON=${IMAGE_PYTHON:-python:3.10-slim-bullseye} FROM ${IMAGE_PYTHON} -RUN apt-get update -RUN apt-get -y install wget gcc &&\ +RUN apt-get update &&\ + apt-get -y install wget gcc &&\ apt-get install -y rsyslog &&\ # added for python 3.11/12 compliance apt-get install -y g++ libgeos-dev # Define working directory -WORKDIR /source_code -COPY src/bloom/ ./bloom/ -COPY src/app.py . -COPY src/container.py . +ARG PROJECT_DIR=/project +ENV PROJECT_DIR=${PROJECT_DIR} +WORKDIR ${PROJECT_DIR} +COPY src ${PROJECT_DIR}/src/ COPY docker/rsyslog.conf /etc/rsyslog.conf # Install requirements package for python with poetry @@ -19,19 +19,19 @@ ARG POETRY_VERSION=1.8.1 ENV POETRY_VERSION=${POETRY_VERSION} RUN pip install --user "poetry==$POETRY_VERSION" ENV PATH="${PATH}:/root/.local/bin" -COPY pyproject.toml poetry.lock ./ +COPY pyproject.toml poetry.lock alembic.ini ./ -RUN python -m venv /venv ENV PATH=/venv/bin:$PATH \ VIRTUAL_ENV=/venv -RUN poetry install +RUN python -m venv /venv &&\ + poetry install # Install chrome in the latest version ARG CHROME_VERSION="112.0.5615.165-1" -RUN wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb -RUN apt-get install -y --fix-missing --no-install-recommends /tmp/chrome.deb -RUN rm -f google-chrome-stable_current_amd64.deb +RUN wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb &&\ + apt-get install -y --fix-missing --no-install-recommends /tmp/chrome.deb &&\ + rm -f google-chrome-stable_current_amd64.deb # Launch cron services @@ -46,14 +46,14 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -y # The entrypoint.sh script stores ENV vars at runtime in the ~/.env file as key=value pairs # Then the cron line include some command to load these ENV vars from file before launching app.py # This mecanism allows to give access to the same ENV vars for app.py launch in terminal and launch via cron -RUN echo "*/15 * * * * root export \$(cat ~/.env | grep -v '#' | xargs);/venv/bin/python3 /source_code/app.py 2>&1 | /usr/bin/logger -t bloom" >> ./cron_scrapper -RUN chmod 744 ./cron_scrapper +RUN echo "*/15 * * * * root export \$(cat ~/.env | grep -v '#' | xargs);/venv/bin/python3 ${PROJECT_DIR}/app.py 2>&1 | /usr/bin/logger -t bloom" >> ./cron_scrapper &&\ + chmod 744 ./cron_scrapper &&\ # Move cron tab into the right directory -RUN mv ./cron_scrapper /etc/cron.d/cron_scrapper + mv ./cron_scrapper /etc/cron.d/cron_scrapper &&\ # Run file -RUN crontab /etc/cron.d/cron_scrapper + crontab /etc/cron.d/cron_scrapper COPY docker/entrypoint.sh /entrypoint.sh RUN ["chmod", "+x", "/entrypoint.sh"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 5914e212..998c3111 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/bash -cat /source_code/.env >> /etc/environment +#cat /${PROJECT_DIR}/.env >> /etc/environment # Store all APP_BLOOM ENV variables to local file accessible to current user to share them with cron task # Due to the fact that cron process doesn't access to declared ENV vars and doesn't load user profiles @@ -13,7 +13,7 @@ env | egrep '^(POSTGRES_.*|SPIRE_TOKEN.*)' > ~/.env ln -sf /dev/stdout /var/log/syslog -source /source_code/.env +#source /${PROJECT_DIR}/.env # execute CMD echo "$@" diff --git a/src/pages/1_Vessel_Exploration.py b/src/pages/1_Vessel_Exploration.py index ebdd15e4..8676b661 100644 --- a/src/pages/1_Vessel_Exploration.py +++ b/src/pages/1_Vessel_Exploration.py @@ -16,7 +16,7 @@ def local_css(file_name): st.markdown(f"", unsafe_allow_html=True) -local_css("styles.css") +local_css(Path(__file__).parent.parent.joinpath("./styles.css")) db = Database(settings.db_url) rep = RepositoryVessel(db.session) From 871b9abfae9c31f0c57dea9d9666014d4fece92e Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 23:27:06 +0100 Subject: [PATCH 30/35] fix: docker compose: reactivate src volume for bloom container --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index ba119796..e2c074cf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -24,7 +24,7 @@ services: #tty: true #stdin_open: true volumes: - #- ./src:/project/src + - ./src:/project/src - ./data:/project/data environment: <<: *common-env From 81dfa2d68f967e3aff0ef72923eeef78c4c8974d Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Wed, 6 Mar 2024 23:27:22 +0100 Subject: [PATCH 31/35] doc: add README.md to /data folder --- data/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/data/README.md b/data/README.md index e69de29b..93672f03 100644 --- a/data/README.md +++ b/data/README.md @@ -0,0 +1,13 @@ +# DATA Folder + +This folder waits for initial/test data with CSV format +Theses files are not included in the repository + +To get them, contact BLOOM organisation +Don't share them in public repository when obtained + +Filenames are fixed and is as below: +* chalutiers_pelagiques.csv +* spire_positions_subset.csv +* vessels_subset.csv +* zones_subset.csv \ No newline at end of file From 5a262ba35501b1d19aa719a172ed9f2d4527df3b Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Thu, 7 Mar 2024 00:09:11 +0100 Subject: [PATCH 32/35] fix source_code => /project --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 281dfee7..91ecd6ef 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ VERSION ?= 1.0.0 -#BLOOM_DEV_DOCKER = @docker run --name bloom-test --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net -p 8501:8501 -BLOOM_DEV_DOCKER = @docker run --name bloom-test -v "$(shell pwd)/data:/data" -v "$(shell pwd)/src:/source_code" --env-file ./.env.template --network=bloom_net -p 8501:8501 -BLOOM_PRODUCTION_DOCKER = @docker run -v "$(shell pwd)/data:/data" -v "$(shell pwd)/src:/source_code" --env-file ./.env --log-driver json-file --log-opt max-size=10M --log-opt max-file=3 --entrypoint /entrypoint.sh +#BLOOM_DEV_DOCKER = @docker run --name bloom-test --mount type=bind,source="$(shell pwd)",target=/project --env-file ./.env.test --network=bloom_net -p 8501:8501 +BLOOM_DEV_DOCKER = @docker run --name bloom-test -v "$(shell pwd)/data:/data" -v "$(shell pwd)/src:/project" --env-file ./.env.template --network=bloom_net -p 8501:8501 +BLOOM_PRODUCTION_DOCKER = @docker run -v "$(shell pwd)/data:/data" -v "$(shell pwd)/src:/project" --env-file ./.env --log-driver json-file --log-opt max-size=10M --log-opt max-file=3 --entrypoint /entrypoint.sh build: @docker build -t d4g/bloom:${VERSION} --platform linux/amd64 -f docker/Dockerfile . @@ -48,7 +48,7 @@ launch-production-app: $(BLOOM_PRODUCTION_DOCKER) --name bloom-production-app --rm d4g/bloom:${VERSION} /venv/bin/python3 app.py dump-dev-db: - $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' + $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /project/bloom_$(shell date +%Y%m%d_%H%M).dump' dump-db: - @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' + @docker run --mount type=bind,source="$(shell pwd)",target=/project --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /project/bloom_$(shell date +%Y%m%d_%H%M).dump' From 413c2575f584cc4102a77e4ffb992f9c3ea16d76 Mon Sep 17 00:00:00 2001 From: RV Date: Thu, 7 Mar 2024 00:17:26 +0100 Subject: [PATCH 33/35] fix: empty lines continuation &&\ --- docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5a3d7e6b..398a0ec4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -47,13 +47,13 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -y # Then the cron line include some command to load these ENV vars from file before launching app.py # This mecanism allows to give access to the same ENV vars for app.py launch in terminal and launch via cron RUN echo "*/15 * * * * root export \$(cat ~/.env | grep -v '#' | xargs);/venv/bin/python3 ${PROJECT_DIR}/app.py 2>&1 | /usr/bin/logger -t bloom" >> ./cron_scrapper &&\ - chmod 744 ./cron_scrapper &&\ + chmod 744 ./cron_scrapper # Move cron tab into the right directory - mv ./cron_scrapper /etc/cron.d/cron_scrapper &&\ +RUN mv ./cron_scrapper /etc/cron.d/cron_scrapper # Run file - crontab /etc/cron.d/cron_scrapper +RUN crontab /etc/cron.d/cron_scrapper COPY docker/entrypoint.sh /entrypoint.sh RUN ["chmod", "+x", "/entrypoint.sh"] From 1ac8b8d25a62e2170ef4fd2bf0a3c13e69d71a66 Mon Sep 17 00:00:00 2001 From: RV Date: Thu, 7 Mar 2024 00:23:17 +0100 Subject: [PATCH 34/35] fix: Makfile correction of volume src => project --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 91ecd6ef..0554c017 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ VERSION ?= 1.0.0 #BLOOM_DEV_DOCKER = @docker run --name bloom-test --mount type=bind,source="$(shell pwd)",target=/project --env-file ./.env.test --network=bloom_net -p 8501:8501 -BLOOM_DEV_DOCKER = @docker run --name bloom-test -v "$(shell pwd)/data:/data" -v "$(shell pwd)/src:/project" --env-file ./.env.template --network=bloom_net -p 8501:8501 -BLOOM_PRODUCTION_DOCKER = @docker run -v "$(shell pwd)/data:/data" -v "$(shell pwd)/src:/project" --env-file ./.env --log-driver json-file --log-opt max-size=10M --log-opt max-file=3 --entrypoint /entrypoint.sh +BLOOM_DEV_DOCKER = @docker run --name bloom-test -v "$(shell pwd)/data:/data" -v "$(shell pwd)/:/project" --env-file ./.env.template --network=bloom_net -p 8501:8501 +BLOOM_PRODUCTION_DOCKER = @docker run -v "$(shell pwd)/data:/data" -v "$(shell pwd)/:/project" --env-file ./.env --log-driver json-file --log-opt max-size=10M --log-opt max-file=3 --entrypoint /entrypoint.sh build: @docker build -t d4g/bloom:${VERSION} --platform linux/amd64 -f docker/Dockerfile . @@ -12,19 +12,19 @@ launch-dev-db: @docker compose -f docker/docker-compose-db.yaml up -d @sleep 20 $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} alembic upgrade head - $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 alembic/init_script/load_vessels_data.py + $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 src/alembic/init_script/load_vessels_data.py load-amp-data: - $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 alembic/init_script/load_amp_data.py + $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 src/alembic/init_script/load_amp_data.py load-test-positions-data: - $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 alembic/init_script/load_positions_data.py + $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 src/alembic/init_script/load_positions_data.py launch-dev-container: $(BLOOM_DEV_DOCKER) -dti d4g/bloom:${VERSION} /bin/bash launch-dev-app: - $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 app.py + $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} /venv/bin/python3 src/app.py launch-test: $(BLOOM_DEV_DOCKER) --rm d4g/bloom:${VERSION} tox -vv From 05569c19fb335bfba04db03082a7e9a514746f95 Mon Sep 17 00:00:00 2001 From: "herve.le-bars" Date: Thu, 7 Mar 2024 00:28:23 +0100 Subject: [PATCH 35/35] fix: ruff conformity BLOOM_CONFIG=>bloom_config --- src/bloom/config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bloom/config.py b/src/bloom/config.py index 95d1de6f..2e26195c 100644 --- a/src/bloom/config.py +++ b/src/bloom/config.py @@ -84,8 +84,9 @@ def __init__(self): self.data_folder = Path(__file__).parent.parent.parent.joinpath('./data') # Si le fichier de configuration à charger est précisé par la variable d'environnement - # BLOOM_CONFIG alors on charge ce fichier, sinon par défaut c'est ../.env - BLOOM_CONFIG=os.getenv('BLOOM_CONFIG',Path(__file__).parent.joinpath(".env")) + # BLOOM_CONFIG alors on charge ce fichier, sinon par défaut c'est /.env + bloom_config=os.getenv('BLOOM_CONFIG',Path(__file__).parent.parent.parent + .joinpath(".env")) # Ici on charge les paramètres à partir du fichier BLOOM_CONFIG # et on mets à jour directement les valeurs des paramètres en tant qu'attribut de la @@ -101,8 +102,9 @@ def __init__(self): # mas aussi dans le fichier BLOOM_CONFIG ainsi qu'en tant que variable d'environnement # alors c'est la valeur de la variable d'environnement qui sera chargée au final # La priorité est donnée aux valeur de l'environnement selon le standard Docker - if Path(BLOOM_CONFIG).exists(): - extract_values_from_file(BLOOM_CONFIG,self.__dict__,allow_extend=False,env_priority=True) + if Path(bloom_config).exists(): + extract_values_from_file(bloom_config,self.__dict__,allow_extend=False, + env_priority=True) else: extract_values_from_env(self.__dict__,allow_extend=False)