diff --git a/tooling/.gitignore b/tooling/.gitignore new file mode 100644 index 0000000..2a585e0 --- /dev/null +++ b/tooling/.gitignore @@ -0,0 +1,3 @@ +.venv/ +__pycache__/ +*.pyc \ No newline at end of file diff --git a/tooling/demo1_venv.py b/tooling/demo1_venv.py new file mode 100644 index 0000000..ac81635 --- /dev/null +++ b/tooling/demo1_venv.py @@ -0,0 +1,6 @@ +import sys + +print("Python Interpreter:") +print(sys.executable) + +print("\n.venv -> virtuelle Umgebung aktiv") diff --git a/tooling/demo2_ruff.py b/tooling/demo2_ruff.py new file mode 100644 index 0000000..538eb4c --- /dev/null +++ b/tooling/demo2_ruff.py @@ -0,0 +1,7 @@ +import math + +name = "Max" + +print(nam) + +# terminal -> ruff check . -> ruff check . --fix diff --git a/tooling/demo3_formatting.py b/tooling/demo3_formatting.py new file mode 100644 index 0000000..25fcff5 --- /dev/null +++ b/tooling/demo3_formatting.py @@ -0,0 +1,6 @@ +from src.calculator import add + +print("Manueller Test: ") +print(add(2, 3)) + +# Terminal -> pytest diff --git a/tooling/pyproject.toml b/tooling/pyproject.toml new file mode 100644 index 0000000..e3d1ef6 --- /dev/null +++ b/tooling/pyproject.toml @@ -0,0 +1,5 @@ +[tool.ruff] +line-length = 88 + +[tool.pytest.ini_options] +testpaths = ["tests"] \ No newline at end of file diff --git a/tooling/src/calculator.py b/tooling/src/calculator.py new file mode 100644 index 0000000..e00a52c --- /dev/null +++ b/tooling/src/calculator.py @@ -0,0 +1,8 @@ +def multiply(a, b): + return a * b + + +x = [1, 2, 3] +print(x) + +#Terminal -> ruff format . \ No newline at end of file diff --git a/tooling/tests/test_calculator.py b/tooling/tests/test_calculator.py new file mode 100644 index 0000000..83e349e --- /dev/null +++ b/tooling/tests/test_calculator.py @@ -0,0 +1,9 @@ +from src.calculator import add, subtract + + +def test_add(): + assert add(2, 3) == 5 + + +def test_substract(): + assert subtract(5, 2) == 3