diff --git a/setup.py b/setup.py index ea52351e1..478c5ac8d 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ """Installation script for python""" import os +import site from setuptools import find_packages, setup @@ -69,3 +70,21 @@ long_description_content_type="text/markdown", license="Apache License 2.0", ) + + +def _postprocess_setup(): + site_packages_path = site.getsitepackages() + qm_init_path = os.path.join(site_packages_path[0], "qm", "__init__.py") + + if os.path.exists(qm_init_path): + with open(qm_init_path, "r", encoding="utf-8") as file: + lines = file.readlines() + + if lines and lines[-1].startswith("logger.info"): + lines = lines[:-1] + + with open(qm_init_path, "w", encoding="utf-8") as file: + file.writelines(lines) + + +_postprocess_setup()