Skip to content

Commit

Permalink
chore: add basic typing to smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nejch authored and JohnVillalovos committed Oct 27, 2022
1 parent 0b2f6bc commit 64e8c31
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -30,7 +30,7 @@ repos:
- requests-toolbelt==0.9.1
files: 'gitlab/'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
rev: v0.981
hooks:
- id: mypy
args: []
Expand Down
24 changes: 5 additions & 19 deletions pyproject.toml
Expand Up @@ -6,24 +6,7 @@ order_by_type = false
[tool.mypy]
files = "."
exclude = "build/.*"

# 'strict = true' is equivalent to the following:
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

# The following need to have changes made to be able to enable them:
# disallow_untyped_calls = true
strict = true

[[tool.mypy.overrides]] # Overrides for currently untyped modules
module = [
Expand All @@ -33,10 +16,13 @@ module = [
"tests.functional.api.*",
"tests.meta.*",
"tests.unit.*",
"tests.smoke.*"
]
ignore_errors = true

[[tool.mypy.overrides]]
module = "tests.smoke.*"
disable_error_code = ["no-untyped-def"]

[tool.semantic_release]
branch = "main"
version_variable = "gitlab/_version.py:__version__"
Expand Down
2 changes: 1 addition & 1 deletion requirements-lint.txt
Expand Up @@ -8,4 +8,4 @@ pylint==2.15.3
pytest==7.1.3
types-PyYAML==6.0.12
types-requests==2.28.11.2
types-setuptools==64.0.1
types-setuptools==65.5.0.1
6 changes: 3 additions & 3 deletions tests/smoke/test_dists.py
Expand Up @@ -18,9 +18,9 @@


@pytest.fixture(scope="function")
def build():
sandbox.run_setup("setup.py", ["--quiet", "clean", "--all"])
return sandbox.run_setup("setup.py", ["--quiet", "sdist", "bdist_wheel"])
def build() -> None:
sandbox.run_setup("setup.py", ["--quiet", "clean", "--all"]) # type: ignore[no-untyped-call]
sandbox.run_setup("setup.py", ["--quiet", "sdist", "bdist_wheel"]) # type: ignore[no-untyped-call]


def test_sdist_includes_tests(build):
Expand Down

0 comments on commit 64e8c31

Please sign in to comment.