diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8845e4070c685230a99958fbebd9377238df32de..e11ef9f64753775a4a3df6f1dddbdd145138ad75 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,9 +57,9 @@ mypy: tags: [ docker ] stage: linting script: - - pip install mypy types-PyYAML types-jsonschema types-requests types-setuptools types-lxml types-python-dateutil pytest + - pip install .[mypy,test] - make mypy - allow_failure: true + # allow_failure: true # run unit tests unittest_py3.8: diff --git a/setup.py b/setup.py index 8b0f7ef0baced33cb160ed1fef2d3eb6436ef1d9..ec20e88b2cbe770801beda88cedc73e88cd413ac 100755 --- a/setup.py +++ b/setup.py @@ -187,11 +187,27 @@ def setup_package(): 'PyYAML>=5.4.1', 'future', ], - extras_require={'keyring': ['keyring>=13.0.0'], - 'jsonschema': ['jsonschema>=4.4.0']}, + extras_require={ + 'keyring': ['keyring>=13.0.0'], + 'jsonschema': ['jsonschema>=4.4.0'], + "mypy": [ + "mypy", + "types-PyYAML", + "types-jsonschema", + "types-requests", + "types-setuptools", + "types-lxml", + "types-python-dateutil", + ], + "test": [ + "pytest", + "pytest-cov", + "coverage>=4.4.2", + "jsonschema>=4.4.0", + ] + + }, setup_requires=["pytest-runner>=2.0,<3dev"], - tests_require=["pytest", "pytest-cov", "coverage>=4.4.2", - "jsonschema>=4.4.0"], package_data={ 'linkahead': ['py.typed', 'cert/indiscale.ca.crt', 'schema-pycaosdb-ini.yml'], }, diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py index 6204e1197840c4f7347697c91ecae90967e5e894..326e5f6d2307cf961fb440003a8a1a68cdbc4d43 100644 --- a/src/linkahead/common/models.py +++ b/src/linkahead/common/models.py @@ -41,7 +41,6 @@ import warnings from builtins import str from copy import deepcopy from datetime import date, datetime -from enum import Enum from functools import cmp_to_key from hashlib import sha512 from os import listdir @@ -1120,7 +1119,7 @@ class Entity: else: return getattr(ref, special_selector.lower()) - def get_property_values(self, *selectors): + def get_property_values(self, *selectors) -> tuple: """ Return a tuple with the values described by the given selectors. This represents an entity's properties as if it was a row of a table @@ -2409,7 +2408,7 @@ class PropertyList(list): This class provides addional functionality like get/set_importance or get_by_name. """ - def __init__(self): + def __init__(self) -> None: super().__init__() self._importance: dict[Entity, IMPORTANCE] = dict() self._inheritance: dict[Entity, INHERITANCE] = dict() @@ -4544,7 +4543,7 @@ class ACL(): return len(self._grants) + len(self._priority_grants) + \ len(self._priority_denials) + len(self._denials) == 0 - def clear(self): + def clear(self) -> None: self._grants: set[ACI] = set() self._denials: set[ACI] = set() self._priority_grants: set[ACI] = set() @@ -5148,7 +5147,7 @@ class Info(): """ - def __init__(self): + def __init__(self) -> None: self.messages = Messages() self.user_info: Optional[UserInfo] = None self.time_zone: Optional[TimeZone] = None