Skip to content

Commit

Permalink
ENH/CI: add mypy config, and CI workflow (#2066)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangchenli authored Oct 20, 2023
1 parent 452de56 commit c57d501
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/typing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Typing Check"

on:
pull_request:
paths:
- ".github/workflows/typing.yaml"
- "src/**"
- "pyproject.toml"
push:
branches:
- main
- develop
- release/\d{4}.\d{1,2}.\d{1,2}
paths:
- ".github/workflows/typing.yaml"
- "src/**"
- "pyproject.toml"

jobs:
typing-check:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"

- name: Install Nebari and type stubs
run: |
python --version
pip install -e .[dev]
pip install types-Pygments types-requests types-six
- name: Run MyPy
continue-on-error: true
run: |
mypy
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ dependencies = [
[project.optional-dependencies]
dev = [
"black==22.3.0",
"mypy==1.6.1",
"dask-gateway",
"diagrams",
"python-dotenv",
Expand Down Expand Up @@ -106,6 +107,34 @@ Source = "https://github.com/nebari-dev/nebari"
[project.scripts]
nebari = "nebari.__main__:main"

[tool.mypy]
warn_return_any = true
warn_unused_configs = true
files = [
"src/_nebari",
"src/nebari",
]
exclude = [
"src/_nebari/stages/kubernetes_services/template" # skip traitlets configuration files
]

[[tool.mypy.overrides]]
module = [
"auth0.authentication",
"auth0.management",
"CloudFlare",
"kubernetes",
"kubernetes.client",
"kubernetes.config",
"kubernetes.client.rest",
"kubernetes.client.exceptions",
"keycloak",
"keycloak.exceptions",
"boto3",
"botocore.exceptions",
]
ignore_missing_imports = true

[tool.ruff]
select = [
"E",
Expand Down

0 comments on commit c57d501

Please sign in to comment.