Skip to content

Commit ffe8279

Browse files
committed
Fix type annotation and restore linter config
1 parent 3854585 commit ffe8279

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [ 3.7, 3.8 ]
18+
python-version: [ 3.11 ]
1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2121
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v1
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525
- name: Install pylint
@@ -32,31 +32,31 @@ jobs:
3232
runs-on: ubuntu-latest
3333
strategy:
3434
matrix:
35-
python-version: [ 3.7, 3.8 ]
35+
python-version: [ 3.11 ]
3636
steps:
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v4
3838
- name: Set up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@v1
39+
uses: actions/setup-python@v5
4040
with:
4141
python-version: ${{ matrix.python-version }}
4242
- name: Install pytest
4343
run: pip install pytest-cov
4444
- name: Test with pytest
4545
run: pytest -v --doctest-modules --cov=./
4646
- name: Upload coverage to Codecov
47-
uses: codecov/codecov-action@v1
47+
uses: codecov/codecov-action@v5
4848
with:
4949
fail_ci_if_error: true
5050

5151
publish:
5252
needs: test
5353
runs-on: ubuntu-latest
5454
steps:
55-
- uses: actions/checkout@v2
56-
- name: Set up Python 3.8
57-
uses: actions/setup-python@v1
55+
- uses: actions/checkout@v4
56+
- name: Set up Python 3.11
57+
uses: actions/setup-python@v5
5858
with:
59-
python-version: 3.8
59+
python-version: 3.11
6060
- name: Install twine
6161
run: pip install twine wheel
6262
- name: Build package

.github/workflows/test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [ 3.7, 3.8 ]
18+
python-version: [ 3.11 ]
1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2121
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v1
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525
- name: Install pylint
@@ -32,18 +32,18 @@ jobs:
3232
runs-on: ubuntu-latest
3333
strategy:
3434
matrix:
35-
python-version: [ 3.7, 3.8 ]
35+
python-version: [ 3.11 ]
3636
steps:
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v4
3838
- name: Set up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@v1
39+
uses: actions/setup-python@v5
4040
with:
4141
python-version: ${{ matrix.python-version }}
4242
- name: Install pytest
4343
run: pip install pytest-cov
4444
- name: Test with pytest
4545
run: pytest -v --doctest-modules --cov=./
4646
- name: Upload coverage to Codecov
47-
uses: codecov/codecov-action@v1
47+
uses: codecov/codecov-action@v5
4848
with:
4949
fail_ci_if_error: true

QLog/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def QLogError(data):
4343
log(LogLevel.ERROR, data)
4444

4545

46-
loggers: [Logger] = []
46+
loggers: list[Logger] = []
4747

4848

4949
def log(level: LogLevel, data):

QLog/azure_system_logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ def __init__(self, log_level=LogLevel.INFO):
1414
self.log_level = log_level
1515
if self.log_level is LogLevel.INFO:
1616
logging.getLogger().setLevel(logging.INFO)
17-
if self.log_level is LogLevel.WARNING:
17+
elif self.log_level is LogLevel.WARNING:
1818
logging.getLogger().setLevel(logging.WARNING)
19-
if self.log_level is LogLevel.ERROR:
19+
elif self.log_level is LogLevel.ERROR:
2020
logging.getLogger().setLevel(logging.ERROR)
2121
else:
2222
logging.getLogger().setLevel(logging.DEBUG)

QLog/console_logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ConsoleLogger(Logger):
1111
def __init__(self, log_level=LogLevel.HIGHLIGHT):
1212
self.log_level = log_level
1313

14-
escape = u'\u001b'
14+
escape = '\u001b'
1515
ansi_bold = '1m'
1616
ansi_reset = '0m'
1717
ansi_text_color = '37m'

QLog/log_level.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def ansi_color(self):
2222
def ansi_color_sequence(self):
2323
""" Returns ANSI color sequence """
2424

25-
return u'\u001b' + '[' + str(self.ansi_color)
25+
return '\u001b[' + str(self.ansi_color)
2626

2727
@property
2828
def python_log_level(self):

QLog/system_logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ def __init__(self, log_level=LogLevel.INFO):
1414
self.log_level = log_level
1515
if self.log_level is LogLevel.INFO:
1616
logging.getLogger().setLevel(logging.INFO)
17-
if self.log_level is LogLevel.WARNING:
17+
elif self.log_level is LogLevel.WARNING:
1818
logging.getLogger().setLevel(logging.WARNING)
19-
if self.log_level is LogLevel.ERROR:
19+
elif self.log_level is LogLevel.ERROR:
2020
logging.getLogger().setLevel(logging.ERROR)
2121
else:
2222
logging.getLogger().setLevel(logging.DEBUG)

0 commit comments

Comments
 (0)