diff --git a/.github/workflows/pylint_projects.yml b/.github/workflows/pylint_projects.yml index 5bffb9cee..c9af262ef 100644 --- a/.github/workflows/pylint_projects.yml +++ b/.github/workflows/pylint_projects.yml @@ -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 diff --git a/{{ cookiecutter.repo_name }}/dodo.py b/{{ cookiecutter.repo_name }}/dodo.py index e855bae51..42cbccf34 100644 --- a/{{ cookiecutter.repo_name }}/dodo.py +++ b/{{ cookiecutter.repo_name }}/dodo.py @@ -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 %} \ No newline at end of file diff --git a/{{ cookiecutter.repo_name }}/setup.py b/{{ cookiecutter.repo_name }}/setup.py index 3731c4fb9..75407e4d8 100644 --- a/{{ cookiecutter.repo_name }}/setup.py +++ b/{{ cookiecutter.repo_name }}/setup.py @@ -1,3 +1,4 @@ +"""Setup""" from setuptools import find_packages, setup setup( diff --git a/{{ cookiecutter.repo_name }}/{{ cookiecutter.module_name }}/__init__.py b/{{ cookiecutter.repo_name }}/{{ cookiecutter.module_name }}/__init__.py index b4f5e3ec6..470578de5 100644 --- a/{{ cookiecutter.repo_name }}/{{ cookiecutter.module_name }}/__init__.py +++ b/{{ cookiecutter.repo_name }}/{{ cookiecutter.module_name }}/__init__.py @@ -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] diff --git a/{{ cookiecutter.repo_name }}/{{ cookiecutter.module_name }}/data/make_dataset.py b/{{ cookiecutter.repo_name }}/{{ cookiecutter.module_name }}/data/make_dataset.py index 7b690f93d..8e5f71f4d 100644 --- a/{{ cookiecutter.repo_name }}/{{ cookiecutter.module_name }}/data/make_dataset.py +++ b/{{ cookiecutter.repo_name }}/{{ cookiecutter.module_name }}/data/make_dataset.py @@ -1,7 +1,9 @@ +"""Make dataset""" from {{ cookiecutter.module_name }} import logger def main(): + """Main""" logger.info('your log message')