Skip to content

Commit 9ecf166

Browse files
committed
Minimal mypy setup
1 parent 979a590 commit 9ecf166

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.github/workflows/main.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ jobs:
6868
- uses: actions/setup-python@main
6969
- uses: pre-commit/action@main
7070

71+
typecheck:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v3
76+
77+
- name: Setup conda
78+
uses: mamba-org/provision-with-micromamba@main
79+
with:
80+
environment-file: ci/environment-typecheck.yml
81+
82+
- name: mypy
83+
shell: bash -l {0}
84+
run: |
85+
mypy fsspec
86+
7187
downstream:
7288
name: downstream
7389
runs-on: ubuntu-latest

ci/environment-typecheck.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: test_env
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- mypy=1.3
6+
- pyarrow
7+
- python=3.8
8+
- pip
9+
- pip:
10+
- types-paramiko
11+
- types-requests
12+
- types-tqdm
13+
- types-ujson

setup.cfg

+15
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,18 @@ skip=
3737
docs/source/conf.py
3838
versioneer.py
3939
fsspec/_version
40+
41+
[mypy]
42+
follow_imports = normal
43+
ignore_missing_imports = True
44+
enable_error_code = ignore-without-code,truthy-bool,truthy-iterable,unused-awaitable
45+
46+
disallow_untyped_decorators = True
47+
strict_equality = True
48+
warn_redundant_casts = True
49+
warn_unused_configs = True
50+
warn_unused_ignores = True
51+
52+
53+
# don't bother type-checking test_*.py or conftest.py files
54+
exclude = (test_.*|conftest)\.py$

0 commit comments

Comments
 (0)