Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HotFix] Remove logger.info from QM's __init__ file #599

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Installation script for python"""

import os
import site

from setuptools import find_packages, setup

Expand Down Expand Up @@ -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()
Loading