Skip to content

Commit

Permalink
added isort, black, mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
alanisaac committed Jun 21, 2023
1 parent 9d92d45 commit 48085cd
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 6 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test-rules-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Test with pytest
- name: Check style
run: |
isort --check .
black --check .
- name: Check typing
run: |
mypy .
- name: Run tests
run: |
pytest
6 changes: 6 additions & 0 deletions rules-engine/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ dependencies = []

[project.optional-dependencies]
dev = [
"black",
"isort",
"mypy",
"pytest"
]

[tool.isort]
profile = "black"
31 changes: 28 additions & 3 deletions rules-engine/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,44 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --extra=test --output-file=requirements-test.txt pyproject.toml
# pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
#
black==23.3.0
# via rules-engine (pyproject.toml)
click==8.1.3
# via black
colorama==0.4.6
# via pytest
exceptiongroup==1.1.1
# via pytest
iniconfig==2.0.0
# via pytest
isort==5.12.0
# via rules-engine (pyproject.toml)
mypy==1.4.0
# via rules-engine (pyproject.toml)
mypy-extensions==1.0.0
# via
# black
# mypy
packaging==23.1
# via pytest
# via
# black
# pytest
pathspec==0.11.1
# via black
platformdirs==3.7.0
# via black
pluggy==1.0.0
# via pytest
pytest==7.3.2
# via rules-engine (pyproject.toml)
tomli==2.0.1
# via pytest
# via
# black
# mypy
# pytest
typing-extensions==4.6.3
# via
# black
# mypy
2 changes: 1 addition & 1 deletion rules-engine/src/rules_engine/example.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def add_two_numbers(first: int, second: int) -> int:
return first + second
return first + second
3 changes: 2 additions & 1 deletion rules-engine/tests/rules_engine/test_example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from rules_engine import example


def test_add_two_numbers():
result = example.add_two_numbers(1, 2)
assert result == 3
assert result == 3

0 comments on commit 48085cd

Please sign in to comment.