Skip to content

Commit a553ee7

Browse files
authored
Merge pull request #1683 from python-gitlab/jlvillal/mypy_setup
chore: add type-hints to setup.py and check with mypy
2 parents f775668 + 06184da commit a553ee7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ repos:
2727
additional_dependencies:
2828
- types-PyYAML==6.0.1
2929
- types-requests==2.26.0
30+
- types-setuptools==57.4.2

requirements-lint.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ isort==5.10.1
44
mypy==0.910
55
types-PyYAML==6.0.1
66
types-requests==2.26.0
7+
types-setuptools==57.4.2

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
from setuptools import find_packages, setup
55

66

7-
def get_version():
7+
def get_version() -> str:
8+
version = ""
89
with open("gitlab/__version__.py") as f:
910
for line in f:
1011
if line.startswith("__version__"):
11-
return eval(line.split("=")[-1])
12+
version = eval(line.split("=")[-1])
13+
break
14+
return version
1215

1316

1417
with open("README.rst", "r") as readme_file:

0 commit comments

Comments
 (0)