Skip to content
Open
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,31 +32,31 @@ 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
run: pip install pytest-cov
- 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

publish:
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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,18 +32,18 @@ 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
run: pip install pytest-cov
- 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
2 changes: 1 addition & 1 deletion QLog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def QLogError(data):
log(LogLevel.ERROR, data)


loggers: [Logger] = []
loggers: list[Logger] = []


def log(level: LogLevel, data):
Expand Down
4 changes: 2 additions & 2 deletions QLog/azure_system_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion QLog/console_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion QLog/log_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions QLog/system_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
85 changes: 2 additions & 83 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading