diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-15 22:54:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 22:54:16 +0100 |
commit | a553ee76affc6e1030ab0464a8bb998168239f4a (patch) | |
tree | d943062b06805898b523755a80bac936a868344c | |
parent | f7756680d4b1d23ea3216458fb5c6bd73f709d5e (diff) | |
parent | 06184daafd5010ba40bb39a0768540b7e98bd171 (diff) | |
download | gitlab-a553ee76affc6e1030ab0464a8bb998168239f4a.tar.gz |
Merge pull request #1683 from python-gitlab/jlvillal/mypy_setup
chore: add type-hints to setup.py and check with mypy
-rw-r--r-- | .pre-commit-config.yaml | 1 | ||||
-rw-r--r-- | requirements-lint.txt | 1 | ||||
-rw-r--r-- | setup.py | 7 |
3 files changed, 7 insertions, 2 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2d08f61..3ec8d2e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,3 +27,4 @@ repos: additional_dependencies: - types-PyYAML==6.0.1 - types-requests==2.26.0 + - types-setuptools==57.4.2 diff --git a/requirements-lint.txt b/requirements-lint.txt index 18132b4..08ba6dc 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -4,3 +4,4 @@ isort==5.10.1 mypy==0.910 types-PyYAML==6.0.1 types-requests==2.26.0 +types-setuptools==57.4.2 @@ -4,11 +4,14 @@ from setuptools import find_packages, setup -def get_version(): +def get_version() -> str: + version = "" with open("gitlab/__version__.py") as f: for line in f: if line.startswith("__version__"): - return eval(line.split("=")[-1]) + version = eval(line.split("=")[-1]) + break + return version with open("README.rst", "r") as readme_file: |