Skip to content

Commit

Permalink
Merge pull request #18 from gitaroktato/python-github-actions
Browse files Browse the repository at this point in the history
feat: Adding mypy checks
  • Loading branch information
gitaroktato authored Apr 9, 2024
2 parents 8c5e8bb + 544b2e6 commit e50910b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,28 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install flake8 pytest mypy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run mypy
uses: sasanquaneuf/mypy-github-action@releases/v1
with:
checkName: 'build' # NOTE: this needs to be the same as the job name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test with pytest
run: |
pytest
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jupyter lab
- https://github.com/miguelrizzog96/Queue_Simulation_Python/blob/master/server.ipynb
- https://notebook.community/xunilrj/sandbox/courses/IMTx-Queue-Theory/Week2_Lab_MM1
- https://github.com/eveneveno/MMC_queue
- https://github.com/miguelrizzog96/Queue_Simulation_Python

## Distributions
- https://numpy.org/doc/stable/reference/random/generated/numpy.random.exponential.html
Expand Down
2 changes: 1 addition & 1 deletion src/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def __init__(self, inter_arrival_times, execution_times, executors=1) -> None:
self.__execution_times = execution_times
self.__departure_times = np.empty_like(inter_arrival_times)
self.__wait_times = np.empty_like(inter_arrival_times)
self.__utilization_by_executor = {
self.__utilization_by_executor: dict[int, list[float]] = {
executor_id: []
for executor_id in range(0, executors)
}
Expand Down

0 comments on commit e50910b

Please sign in to comment.