diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..edb71ad5 --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +[flake8] +ignore = E203, E266, W503 +max-line-length = 79 +max-complexity = 18 +select = B,C,E,F,W,T4,B9 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..09fa111a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: Test + +on: + pull_request: + branches: + - "master" + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Set Up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install pytest and flake8 + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run flake8 + run: flake8 app/ + + - name: Run tests + timeout-minutes: 5 + run: pytest tests/ + diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b26d6116 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.idea/ +.vscode/ +*.iml +.env +.DS_Store +venv/ +.pytest_cache/ +**__pycache__/ diff --git a/README.md b/README.md new file mode 100644 index 00000000..5be5cadc --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Python boilerplate for GitHub tasks + +- Read [the guideline](https://github.com/mate-academy/py-task-guideline/blob/main/README.md) before start +- Implement the task described [here](app/main.py) diff --git a/app/main.py b/app/main.py new file mode 100644 index 00000000..773a588b --- /dev/null +++ b/app/main.py @@ -0,0 +1,3 @@ +# TODO: add initial code +def hello_world(): + return "Hello, world!" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..7c8a737c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +pytest==6.2.5 +flake8==4.0.1 \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_main.py b/tests/test_main.py new file mode 100644 index 00000000..6d8b3235 --- /dev/null +++ b/tests/test_main.py @@ -0,0 +1,6 @@ +# TODO: add tests +from app.main import hello_world + + +def test_hello_world(): + assert hello_world() == "Hello, world!"