Skip to content

Commit 2c9fe29

Browse files
authored
Declare vagrant package as typed (#94)
1 parent b239e2a commit 2c9fe29

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ repos:
4141
- flake8-2020>=1.6.1
4242
- flake8-docstrings>=1.6.0
4343
- flake8-pytest-style>=1.6.0
44+
- repo: https://github.com/pre-commit/mirrors-mypy
45+
rev: v0.931
46+
hooks:
47+
- id: mypy
48+
# empty args needed in order to match mypy cli behavior
49+
# args: [--strict]
4450
- repo: https://github.com/pycqa/pylint
4551
rev: v2.12.2
4652
hooks:

mypy.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[mypy]
2+
python_version = 3.8
3+
color_output = True
4+
error_summary = True
5+
; disallow_untyped_calls = True
6+
; disallow_untyped_defs = True
7+
; disallow_any_generics = True
8+
; disallow_any_unimported = True
9+
; warn_redundant_casts = True
10+
; warn_return_any = True
11+
; warn_unused_configs = True
12+
# site-packages is here to help vscode mypy integration getting confused
13+
exclude = (build|test/local-content|site-packages)

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ python_requires = >=3.8
4040
[options.extras_require]
4141
test =
4242
pytest>=7.0.0
43+
44+
[options.package_data]
45+
vagrant = py.typed

vagrant/py.typed

Whitespace-only changes.

vagrant/test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
It also removes some of the boilerplate involved in writing tests that leverage
55
vagrant boxes.
66
"""
7+
from typing import Dict, List
78
from unittest import TestCase
89
from vagrant import Vagrant, stderr_cm
910

@@ -20,11 +21,11 @@ class VagrantTestCase(TestCase):
2021
will remain up. Defaults to False
2122
"""
2223

23-
vagrant_boxes = []
24+
vagrant_boxes: List[str] = []
2425
vagrant_root = None
2526
restart_boxes = False
2627

27-
__initial_box_statuses = {}
28+
__initial_box_statuses: Dict[str, str] = {}
2829
__cleanup_actions = {
2930
Vagrant.NOT_CREATED: "destroy",
3031
Vagrant.POWEROFF: "halt",

0 commit comments

Comments
 (0)