Skip to content

Commit

Permalink
Merge pull request #36 from Vastra-Gotalandsregionen/AI-1154
Browse files Browse the repository at this point in the history
AI-1154: Fixing Pylint
  • Loading branch information
MahmoudKh12 authored Aug 23, 2023
2 parents defad0d + 3c65a91 commit 0c467d3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pylint_projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ai_framework: ["Tensorflow", "Pytorch", "R"]
ai_framework: ["Tensorflow", "PyTorch", "R"]
steps:
- uses: actions/checkout@v3
- name: Pylint ${{ matrix.ai_framework }} files
run: |
pip3 install pylint cookiecutter
pip3 install pylint cookiecutter python-dotenv loguru
cookiecutter . --no-input image=${{ matrix.ai_framework }} --config-file tests/.cookiecutterrc
find ./acme -name "*.py" | xargs pylint
5 changes: 3 additions & 2 deletions {{ cookiecutter.repo_name }}/dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def task_lint():
"actions": [LongRunning(c)],
"doc": "runs black formatting and linting",
}
{% else %}def define_r_tasks():
{% else %}"""dodo"""
def define_r_tasks():
"""Define R tasks"""
return {"actions": ["echo 'define your r tasks'"]}

{% endif %}
1 change: 1 addition & 0 deletions {{ cookiecutter.repo_name }}/setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Setup"""
from setuptools import find_packages, setup

setup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
"""init-py"""
import sys
from pathlib import Path

from dotenv import find_dotenv, load_dotenv
from loguru import logger

dotenv_path = find_dotenv()
load_dotenv(dotenv_path)
DOTENV_PATH = find_dotenv()
load_dotenv(DOTENV_PATH)

FMT = "{time:YYYY-MM-DD HH:mm:ss} "\
"| {level} | {name} :: {module} :: {function} :: {line} - {message}"

fmt = "{time:YYYY-MM-DD HH:mm:ss} | {level} | {name} :: {module} :: {function} :: {line} - {message}"

config = {
CONFIG = {
"handlers": [
{"sink": sys.stdout, "level": "DEBUG"},
{"sink": "log.log", "format": fmt, "level": "DEBUG"},
{"sink": "log.log", "format": FMT, "level": "DEBUG"},
]
}

logger.configure(**config)
logger.configure(**CONFIG)

source_path = Path(__file__).resolve().parents[1]
SOURCE_PATH = Path(__file__).resolve().parents[1]
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Make dataset"""
from {{ cookiecutter.module_name }} import logger


def main():
"""Main"""
logger.info('your log message')


Expand Down

0 comments on commit 0c467d3

Please sign in to comment.