From a86419037073ed51b3c9d476302005a3d63eb2c6 Mon Sep 17 00:00:00 2001 From: "joel.clement" Date: Mon, 4 Sep 2023 15:57:01 +0200 Subject: [PATCH] fix migrate taxref data_dir and setup.py sql files --- apptax/taxonomie/commands/migrate_taxref/commands_v16.py | 4 +--- docs/changelog.md | 9 +++++++++ setup.py | 6 ++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apptax/taxonomie/commands/migrate_taxref/commands_v16.py b/apptax/taxonomie/commands/migrate_taxref/commands_v16.py index c64b7524..b11b2e58 100644 --- a/apptax/taxonomie/commands/migrate_taxref/commands_v16.py +++ b/apptax/taxonomie/commands/migrate_taxref/commands_v16.py @@ -159,9 +159,7 @@ def import_data_taxref_v16(): db.session.execute(query) db.session.commit() - with open_remote_file( - base_url, "TAXREF_v16_2022.zip", open_fct=ZipFile, data_dir="tmp" - ) as archive: + with open_remote_file(base_url, "TAXREF_v16_2022.zip", open_fct=ZipFile) as archive: with archive.open("TAXREFv16.txt") as f: logger.info("Insert TAXREFv16 into taxonomie.import_taxref table…") copy_from_csv( diff --git a/docs/changelog.md b/docs/changelog.md index c5379650..c77d5fdb 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,12 @@ +1.12.1 (unreleased) +=================== + +**🐛 Corrections** + +* [migration taxref]: ajout de script sql manquants dans le fichier `setup.py` +* [migration taxref]: ne pas spécificer de repertoire de fichier de données dans la fonction `open_remote_file(...,"TAXREF_v16_2022.zip", ...)` afin de pouvoir utiliser la variable d'environnement `DATA_PATH`. + + 1.12.0 (2023-07-11) =================== diff --git a/setup.py b/setup.py index 902eee04..210bbff2 100644 --- a/setup.py +++ b/setup.py @@ -20,9 +20,11 @@ version=version, packages=setuptools.find_packages(where=".", include=["apptax*"]), package_data={ - "apptax": ["templates/*.html"], + "apptax": [ + "templates/*.html", + ], "apptax.migrations": ["alembic.ini", "script.py.mako", "data/*.sql"], - "apptax.taxonomie.commands.migrate_taxref": ["data/*.sql"], + "apptax.taxonomie.commands.migrate_taxref": ["data/*.sql", "data/*/*.sql"], }, install_requires=( list(open("requirements-common.in", "r")) + list(open("requirements-dependencies.in", "r"))