diff --git a/.mypy.ini b/.mypy.ini deleted file mode 100644 index fdc64de46..000000000 --- a/.mypy.ini +++ /dev/null @@ -1,9 +0,0 @@ -[mypy] -files = gitlab/*.py,gitlab/v4/cli.py,gitlab/v4/objects/projects.py - -# disallow_incomplete_defs: This flag reports an error whenever it encounters a -# partly annotated function definition. -disallow_incomplete_defs = True -# disallow_untyped_defs: This flag reports an error whenever it encounters a -# function without type annotations or with incomplete type annotations. -disallow_untyped_defs = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8aa69b568..b6b38bf1b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,6 +21,9 @@ repos: hooks: - id: isort - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 + rev: v0.910 hooks: - id: mypy + additional_dependencies: + - types-PyYAML==5.4.3 + - types-requests==2.25.1 diff --git a/.renovaterc.json b/.renovaterc.json index 319e22b07..df0650f86 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -12,12 +12,22 @@ "depNameTemplate": "gitlab/gitlab-ce", "datasourceTemplate": "docker", "versioningTemplate": "loose" + }, + { + "fileMatch": ["^.pre-commit-config.yaml$"], + "matchStrings": ["- (?.*?)==(?.*?)\n"], + "datasourceTemplate": "pypi", + "versioningTemplate": "pep440" } ], "packageRules": [ { "packagePatterns": ["^gitlab\/gitlab-.+$"], "automerge": true + }, + { + "matchPackagePrefixes": ["types-"], + "groupName": "typing dependencies" } ] } diff --git a/docs/__init__.py b/docs/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pyproject.toml b/pyproject.toml index 448a4e3db..27b5faa10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,29 @@ profile = "black" multi_line_output = 3 order_by_type = false +[tool.mypy] +disallow_incomplete_defs = true +disallow_untyped_defs = true +files = "." + +[[tool.mypy.overrides]] # Overrides for currently untyped modules +module = [ + "docs.*", + "docs.ext.*", + "gitlab.v4.objects.*", + "setup", + "tests.functional.*", + "tests.functional.api.*", + "tests.unit.*" +] +ignore_errors = true + +[[tool.mypy.overrides]] # Overrides to negate above patterns +module = [ + "gitlab.v4.objects.projects" +] +ignore_errors = false + [tool.semantic_release] version_variable = "gitlab/__version__.py:__version__" commit_subject = "chore: release v{version}" diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/functional/__init__.py b/tests/functional/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/functional/api/__init__.py b/tests/functional/api/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/functional/cli/__init__.py b/tests/functional/cli/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/unit/mixins/__init__.py b/tests/unit/mixins/__init__.py new file mode 100644 index 000000000..e69de29bb