summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-10-22 13:19:32 +0200
committerJohn Villalovos <john@sodarock.com>2022-10-27 08:06:52 -0700
commit64e8c31e1d35082bc2e52582205157ae1a6c4605 (patch)
tree0118834168b4b1737253fba15c96a84b3f15649e
parent0b2f6bcf454685786a89138b36b10fba649663dd (diff)
downloadgitlab-64e8c31e1d35082bc2e52582205157ae1a6c4605.tar.gz
chore: add basic typing to smoke tests
-rw-r--r--.pre-commit-config.yaml2
-rw-r--r--pyproject.toml24
-rw-r--r--requirements-lint.txt2
-rw-r--r--tests/smoke/test_dists.py6
4 files changed, 10 insertions, 24 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 02c64e3..4e51354 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -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: []
diff --git a/pyproject.toml b/pyproject.toml
index 1ce5e85..64734ba 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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 = [
@@ -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__"
diff --git a/requirements-lint.txt b/requirements-lint.txt
index fa0678b..5aa4e35 100644
--- a/requirements-lint.txt
+++ b/requirements-lint.txt
@@ -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
diff --git a/tests/smoke/test_dists.py b/tests/smoke/test_dists.py
index b951eca..099e691 100644
--- a/tests/smoke/test_dists.py
+++ b/tests/smoke/test_dists.py
@@ -18,9 +18,9 @@ WHEEL_FILE = (
@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):