-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
509 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Send coverage report | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- istub/** | ||
- tests/** | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: "poetry" | ||
- name: Install dependencies | ||
run: | | ||
poetry install -n | ||
- name: Build coverage report | ||
run: | | ||
poetry run pytest --cov istub --cov-report=xml --junitxml=junit.xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
- name: Upload test results to Codecov | ||
if: ${{ !cancelled() }} | ||
uses: codecov/test-results-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
packages: | ||
- name: istub | ||
path: ../istub | ||
- name: s3transfer | ||
checks: | ||
stubtest: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,3 @@ def run(self) -> str: | |
return "\n".join(e.data.splitlines()[:-1]) | ||
|
||
return "" | ||
return "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,3 @@ def is_ignored_line_diff(self, line: str) -> bool: | |
return True | ||
|
||
return False | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
Project contants. | ||
""" | ||
|
||
PACKAGE_NAME = "istub" | ||
PROG_NAME = "istub" | ||
LOGGER_NAME = "istub" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
""" | ||
Logging setup. | ||
Logging utils. | ||
""" | ||
|
||
import logging | ||
|
||
from istub.constants import LOGGER_NAME | ||
|
||
FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" | ||
TIME_FORMAT = "%H:%M:%S" | ||
|
||
def setup_logging(level: int = 0) -> logging.Logger: | ||
|
||
def get_logger(level: int = logging.DEBUG) -> logging.Logger: | ||
""" | ||
Get Logger instance. | ||
Get default logger. | ||
Arguments: | ||
level -- Logging level | ||
level -- Python log level | ||
Returns: | ||
Created Logger. | ||
New or existing logger instance. | ||
""" | ||
logger = logging.getLogger(LOGGER_NAME) | ||
if logger.handlers: | ||
return logger | ||
|
||
stream_handler = logging.StreamHandler() | ||
formatter = logging.Formatter("%(levelname)s %(message)s", datefmt="%H:%M:%S") | ||
stream_handler.setFormatter(formatter) | ||
stream_handler.setFormatter(logging.Formatter(FORMAT, datefmt=TIME_FORMAT)) | ||
stream_handler.setLevel(level) | ||
logger.addHandler(stream_handler) | ||
logger.setLevel(level) | ||
|
||
return logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.