From be7e1e19fb0327bdfd9fedba2e33ec9c4be137ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Oberd=C3=B6rfer?= Date: Thu, 24 Jul 2025 22:20:28 +0200 Subject: [PATCH] Update Codecov action --- .github/workflows/publish.yml | 22 ++++----- .github/workflows/test.yml | 14 +++--- QLog/__init__.py | 2 +- QLog/azure_system_logger.py | 4 +- QLog/console_logger.py | 2 +- QLog/log_level.py | 2 +- QLog/system_logger.py | 4 +- pylintrc | 85 +---------------------------------- setup.py | 2 +- 9 files changed, 28 insertions(+), 109 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 36fca6b..c7be1d2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8 ] + python-version: [ 3.11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install pylint @@ -32,11 +32,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8 ] + python-version: [ 3.11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install pytest @@ -44,7 +44,7 @@ jobs: - name: Test with pytest run: pytest -v --doctest-modules --cov=./ - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v5.4.3 with: fail_ci_if_error: true @@ -52,11 +52,11 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.11 - name: Install twine run: pip install twine wheel - name: Build package diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 676c8cb..c719afa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8 ] + python-version: [ 3.11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install pylint @@ -32,11 +32,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8 ] + python-version: [ 3.11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install pytest @@ -44,6 +44,6 @@ jobs: - name: Test with pytest run: pytest -v --doctest-modules --cov=./ - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v5.4.3 with: fail_ci_if_error: true diff --git a/QLog/__init__.py b/QLog/__init__.py index 3c2944a..82e42a3 100644 --- a/QLog/__init__.py +++ b/QLog/__init__.py @@ -43,7 +43,7 @@ def QLogError(data): log(LogLevel.ERROR, data) -loggers: [Logger] = [] +loggers: list[Logger] = [] def log(level: LogLevel, data): diff --git a/QLog/azure_system_logger.py b/QLog/azure_system_logger.py index 711ab9c..4bd6d19 100644 --- a/QLog/azure_system_logger.py +++ b/QLog/azure_system_logger.py @@ -14,9 +14,9 @@ def __init__(self, log_level=LogLevel.INFO): self.log_level = log_level if self.log_level is LogLevel.INFO: logging.getLogger().setLevel(logging.INFO) - if self.log_level is LogLevel.WARNING: + elif self.log_level is LogLevel.WARNING: logging.getLogger().setLevel(logging.WARNING) - if self.log_level is LogLevel.ERROR: + elif self.log_level is LogLevel.ERROR: logging.getLogger().setLevel(logging.ERROR) else: logging.getLogger().setLevel(logging.DEBUG) diff --git a/QLog/console_logger.py b/QLog/console_logger.py index 8bc73cc..5f0c4c6 100644 --- a/QLog/console_logger.py +++ b/QLog/console_logger.py @@ -11,7 +11,7 @@ class ConsoleLogger(Logger): def __init__(self, log_level=LogLevel.HIGHLIGHT): self.log_level = log_level - escape = u'\u001b' + escape = '\u001b' ansi_bold = '1m' ansi_reset = '0m' ansi_text_color = '37m' diff --git a/QLog/log_level.py b/QLog/log_level.py index c18b100..af481ae 100644 --- a/QLog/log_level.py +++ b/QLog/log_level.py @@ -22,7 +22,7 @@ def ansi_color(self): def ansi_color_sequence(self): """ Returns ANSI color sequence """ - return u'\u001b' + '[' + str(self.ansi_color) + return '\u001b[' + str(self.ansi_color) @property def python_log_level(self): diff --git a/QLog/system_logger.py b/QLog/system_logger.py index 8d81d85..12445b2 100644 --- a/QLog/system_logger.py +++ b/QLog/system_logger.py @@ -14,9 +14,9 @@ def __init__(self, log_level=LogLevel.INFO): self.log_level = log_level if self.log_level is LogLevel.INFO: logging.getLogger().setLevel(logging.INFO) - if self.log_level is LogLevel.WARNING: + elif self.log_level is LogLevel.WARNING: logging.getLogger().setLevel(logging.WARNING) - if self.log_level is LogLevel.ERROR: + elif self.log_level is LogLevel.ERROR: logging.getLogger().setLevel(logging.ERROR) else: logging.getLogger().setLevel(logging.DEBUG) diff --git a/pylintrc b/pylintrc index b397e39..445ca91 100644 --- a/pylintrc +++ b/pylintrc @@ -60,85 +60,6 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -disable=print-statement, - parameter-unpacking, - unpacking-in-except, - old-raise-syntax, - backtick, - long-suffix, - old-ne-operator, - old-octal-literal, - import-star-module-level, - non-ascii-bytes-literal, - raw-checker-failed, - bad-inline-option, - locally-disabled, - file-ignored, - suppressed-message, - useless-suppression, - deprecated-pragma, - use-symbolic-message-instead, - apply-builtin, - basestring-builtin, - buffer-builtin, - cmp-builtin, - coerce-builtin, - execfile-builtin, - file-builtin, - long-builtin, - raw_input-builtin, - reduce-builtin, - standarderror-builtin, - unicode-builtin, - xrange-builtin, - coerce-method, - delslice-method, - getslice-method, - setslice-method, - no-absolute-import, - old-division, - dict-iter-method, - dict-view-method, - next-method-called, - metaclass-assignment, - indexing-exception, - raising-string, - reload-builtin, - oct-method, - hex-method, - nonzero-method, - cmp-method, - input-builtin, - round-builtin, - intern-builtin, - unichr-builtin, - map-builtin-not-iterating, - zip-builtin-not-iterating, - range-builtin-not-iterating, - filter-builtin-not-iterating, - using-cmp-argument, - eq-without-hash, - div-method, - idiv-method, - rdiv-method, - exception-message-attribute, - invalid-str-codec, - sys-max-int, - bad-python3-import, - deprecated-string-function, - deprecated-str-translate-call, - deprecated-itertools-function, - deprecated-types-field, - next-method-defined, - dict-items-not-iterating, - dict-keys-not-iterating, - dict-values-not-iterating, - deprecated-operator-function, - deprecated-urllib-function, - xreadlines-attribute, - deprecated-sys-function, - exception-escape, - comprehension-escape # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -336,8 +257,6 @@ max-module-lines=1000 # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. # `trailing-comma` allows a space between comma and closing bracket: (a, ). # `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator # Allow the body of a class to be on the same line as the declaration if body # contains single statement. @@ -594,5 +513,5 @@ max-complexity=5 # Exceptions that will emit a warning when being caught. Defaults to # "BaseException, Exception". -overgeneral-exceptions=BaseException, - Exception +overgeneral-exceptions=builtins.BaseException, + builtins.Exception diff --git a/setup.py b/setup.py index 2905c48..bc43120 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ HERE = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(HERE, "README.md")) as fid: +with open(os.path.join(HERE, "README.md"), encoding="utf-8") as fid: README = fid.read() setup(