Skip to content

Commit 5d198d9

Browse files
chore: add type-hints to setup.py and check with mypy
1 parent 205ad5f commit 5d198d9

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
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.0
2929
- types-requests==2.25.12
30+
- types-setuptools==57.4.2

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module = [
2525
"gitlab.v4.objects.services",
2626
"gitlab.v4.objects.sidekiq",
2727
"gitlab.v4.objects.snippets",
28-
"setup",
2928
"tests.functional.*",
3029
"tests.functional.api.*",
3130
"tests.unit.*",

requirements-lint.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ isort==5.10.0
44
mypy==0.910
55
types-PyYAML==6.0.0
66
types-requests==2.25.12
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)