Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Linting Linux

on:
pull_request:

jobs:
linting:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version:
- "3.11"

name: linting
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version : ${{ matrix.python-version }}

- name: Install flake8
run: |
python -m pip install flake8

- name: Check format without making corrections
run: |
flake8
11 changes: 6 additions & 5 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Unit Test Linux

on:
push:
# pull_request:
workflow_run:
workflows: [Linting Linux]
types:
- completed

jobs:
run-tests:
unit-test:
strategy:
fail-fast: false
matrix:
Expand All @@ -15,7 +17,7 @@ jobs:

name: unit-test
runs-on: ${{ matrix.os }}
# runs-on: python:alpine
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Checkout code
Expand All @@ -37,4 +39,3 @@ jobs:
- name: Run tests
run: |
python -m unittest discover -v

2 changes: 1 addition & 1 deletion funcs/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# placeholder file to modularize (to package) .py files under the directory "funcs", making the files importable.
# placeholder file to modularize (to package) .py files under the directory "tests", making the files importable.
2 changes: 1 addition & 1 deletion funcs/func.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def sum(x: float, y: float) -> float:
return x + y
return x + y
19 changes: 4 additions & 15 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
annotated-types==0.5.0
anyio==3.7.1
fastapi==0.101.1
idna==3.4
numpy==1.25.2
pandas==2.0.3
pydantic==2.3.0
pydantic_core==2.6.3
python-dateutil==2.8.2
pytz==2023.3
six==1.16.0
sniffio==1.3.0
starlette==0.27.0
typing_extensions==4.7.1
tzdata==2023.3
flake8==6.1.0
mccabe==0.7.0
pycodestyle==2.11.0
pyflakes==3.1.0
10 changes: 10 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
max-line-length = 120
exclude =
.git,
__pycache__,
docs/source/conf.py,
old,
build,
dist,
venv
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# placeholder file to modularize (to package) .py files under the directory "tests", making the files importable.
# placeholder file to modularize (to package) .py files under the directory "tests", making the files importable.
6 changes: 4 additions & 2 deletions tests/test_func.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import unittest
from funcs import func


class Test(unittest.TestCase):

def test_sum(self):
self.assertEqual(func.sum(2,3), 5)
self.assertEqual(func.sum(2, 3), 5)


if __name__ == "__main__":
unittest.main()
unittest.main()