Skip to content

Commit

Permalink
Merge pull request #19 from Appsilon/pps-add-mypy
Browse files Browse the repository at this point in the history
feat: add mypy for type checking
  • Loading branch information
pstorozenko authored Mar 25, 2024
2 parents cdb45a1 + bbe1da9 commit 12d7d73
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Checkout (GitHub)
uses: actions/checkout@v4

- name: Build and run dev container tests
- name: Run quality checks
uses: devcontainers/ci@v0.3
with:
runCmd: ./run_tests_and_bandit.sh
runCmd: ./quality_checks.sh
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Our template ensures a streamlined development lifecycle, offering:
- **Structured Logging with Loguru**: Enhanced debugging and monitoring.
- **Best Practice Configuration**: Using `pydantic-settings`.
- **Efficient Deployment**: Smooth deployment to Posit Connect with `rsconnect`.
- **Static Type Checking with mypy**: Ensures type safety and code quality.

## Community and Contributions

Expand Down
60 changes: 59 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tenacity = "^8.2.3"
bandit = "^1.7.8"
pytest-watch = "^4.2.0"
pytest-cov = "^5.0.0"
mypy = "^1.9.0"

[build-system]
requires = ["poetry-core"]
Expand Down
14 changes: 14 additions & 0 deletions quality_checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# This script is for running quality checks in GitHub Actions.
# It runs tests, security analysis with Bandit, and type checks with mypy.

set -e # Exit immediately if a command exits with a non-zero status.

echo "Running pytest for unit tests..."
poetry run pytest

echo "Running Bandit for security analysis..."
poetry run bandit -r pyshiny_template

echo "Running mypy for type checking..."
poetry run mypy pyshiny_template
12 changes: 0 additions & 12 deletions run_tests_and_bandit.sh

This file was deleted.

0 comments on commit 12d7d73

Please sign in to comment.