Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfdec039

Browse files
feat: add an initial mypy test to tox.ini
Add an initial mypy test to test gitlab/base.py and gitlab/__init__.py
1 parentd9fdf1d commitfdec039

File tree

6 files changed

+21
-3
lines changed

6 files changed

+21
-3
lines changed

‎.github/workflows/lint.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ jobs:
2727
with:
2828
fetch-depth:0
2929
-uses:wagoid/commitlint-github-action@v2
30+
31+
mypy:
32+
runs-on:ubuntu-latest
33+
steps:
34+
-uses:actions/checkout@v2
35+
-uses:actions/setup-python@v2
36+
-run:pip install --upgrade tox
37+
-run:tox -e mypy

‎.mypy.ini‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[mypy]
2+
files = gitlab/*.py

‎gitlab/cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def main():
193193
# Now we build the entire set of subcommands and do the complete parsing
194194
parser=_get_parser(gitlab.v4.cli)
195195
try:
196-
importargcomplete
196+
importargcomplete# type: ignore
197197

198198
argcomplete.autocomplete(parser)
199199
exceptException:

‎gitlab/client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
importgitlab.const
2626
importgitlab.exceptions
2727
fromgitlabimportutils
28-
fromrequests_toolbelt.multipart.encoderimportMultipartEncoder
28+
fromrequests_toolbelt.multipart.encoderimportMultipartEncoder# type: ignore
2929

3030

3131
REDIRECT_MSG= (

‎test-requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
coverage
22
httmock
33
mock
4+
mypy
45
pytest
56
pytest-cov
67
responses

‎tox.ini‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
minversion = 1.6
33
skipsdist = True
4-
envlist = py39,py38,py37,py36,pep8,black,twine-check
4+
envlist = py39,py38,py37,py36,pep8,black,twine-check,mypy
55

66
[testenv]
77
passenv = GITLAB_IMAGE GITLAB_TAG
@@ -35,6 +35,13 @@ deps = -r{toxinidir}/requirements.txt
3535
commands =
3636
twine check dist/*
3737

38+
[testenv:mypy]
39+
basepython = python3
40+
deps = -r{toxinidir}/requirements.txt
41+
-r{toxinidir}/test-requirements.txt
42+
commands =
43+
mypy {posargs}
44+
3845
[testenv:venv]
3946
commands = {posargs}
4047

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp