| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,14 +15,14 @@ | |||
| 15 | 15 | # You should have received a copy of the GNU Lesser General Public License | |
| 16 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | 17 | ||
| 18 | - import sys | ||
| 19 | 18 | from types import ModuleType | |
| 20 | 19 | from typing import ( | |
| 21 | 20 | Any, | |
| 22 | 21 | Callable, | |
| 23 | 22 | Dict, | |
| 24 | 23 | Iterator, | |
| 25 | 24 | List, | |
| 25 | + Literal, | ||
| 26 | 26 | Optional, | |
| 27 | 27 | Tuple, | |
| 28 | 28 | Type, | |
@@ -38,11 +38,6 @@ | |||
| 38 | 38 | from gitlab import types as g_types | |
| 39 | 39 | from gitlab import utils | |
| 40 | 40 | ||
| 41 | - if sys.version_info >= (3, 8): | ||
| 42 | - from typing import Literal | ||
| 43 | - else: | ||
| 44 | - from typing_extensions import Literal | ||
| 45 | - | ||
| 46 | 41 | __all__ = [ | |
| 47 | 42 | "GetMixin", | |
| 48 | 43 | "GetWithoutIdMixin", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,19 +16,13 @@ | |||
| 16 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | 17 | ||
| 18 | 18 | import pathlib | |
| 19 | - import sys | ||
| 20 | 19 | import traceback | |
| 21 | 20 | import urllib.parse | |
| 22 | 21 | import warnings | |
| 23 | - from typing import Any, Callable, Dict, Iterator, Optional, Type, Union | ||
| 22 | + from typing import Any, Callable, Dict, Iterator, Literal, Optional, Type, Union | ||
| 24 | 23 | ||
| 25 | 24 | import requests | |
| 26 | 25 | ||
| 27 | - if sys.version_info >= (3, 8): | ||
| 28 | - from typing import Literal | ||
| 29 | - else: | ||
| 30 | - from typing_extensions import Literal | ||
| 31 | - | ||
| 32 | 26 | ||
| 33 | 27 | class _StdoutStream: | |
| 34 | 28 | def __call__(self, chunk: Any) -> None: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,7 @@ | |||
| 2 | 2 | GitLab API: | |
| 3 | 3 | https://docs.gitlab.com/ee/api/job_artifacts.html | |
| 4 | 4 | """ | |
| 5 | - import sys | ||
| 6 | - from typing import Any, Callable, Iterator, Optional, TYPE_CHECKING, Union | ||
| 5 | + from typing import Any, Callable, Iterator, Literal, Optional, TYPE_CHECKING, Union | ||
| 7 | 6 | ||
| 8 | 7 | import requests | |
| 9 | 8 | ||
@@ -12,11 +11,6 @@ | |||
| 12 | 11 | from gitlab import utils | |
| 13 | 12 | from gitlab.base import RESTManager, RESTObject | |
| 14 | 13 | ||
| 15 | - if sys.version_info >= (3, 8): | ||
| 16 | - from typing import Literal | ||
| 17 | - else: | ||
| 18 | - from typing_extensions import Literal | ||
| 19 | - | ||
| 20 | 14 | __all__ = ["ProjectArtifact", "ProjectArtifactManager"] | |
| 21 | 15 | ||
| 22 | 16 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,12 +1,12 @@ | |||
| 1 | 1 | import base64 | |
| 2 | - import sys | ||
| 3 | 2 | from typing import ( | |
| 4 | 3 | Any, | |
| 5 | 4 | Callable, | |
| 6 | 5 | cast, | |
| 7 | 6 | Dict, | |
| 8 | 7 | Iterator, | |
| 9 | 8 | List, | |
| 9 | + Literal, | ||
| 10 | 10 | Optional, | |
| 11 | 11 | TYPE_CHECKING, | |
| 12 | 12 | Union, | |
@@ -27,11 +27,6 @@ | |||
| 27 | 27 | UpdateMixin, | |
| 28 | 28 | ) | |
| 29 | 29 | ||
| 30 | - if sys.version_info >= (3, 8): | ||
| 31 | - from typing import Literal | ||
| 32 | - else: | ||
| 33 | - from typing_extensions import Literal | ||
| 34 | - | ||
| 35 | 30 | __all__ = [ | |
| 36 | 31 | "ProjectFile", | |
| 37 | 32 | "ProjectFileManager", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,14 @@ | |||
| 1 | - import sys | ||
| 2 | - from typing import Any, Callable, cast, Dict, Iterator, Optional, TYPE_CHECKING, Union | ||
| 1 | + from typing import ( | ||
| 2 | + Any, | ||
| 3 | + Callable, | ||
| 4 | + cast, | ||
| 5 | + Dict, | ||
| 6 | + Iterator, | ||
| 7 | + Literal, | ||
| 8 | + Optional, | ||
| 9 | + TYPE_CHECKING, | ||
| 10 | + Union, | ||
| 11 | + ) | ||
| 3 | 12 | ||
| 4 | 13 | import requests | |
| 5 | 14 | ||
@@ -9,11 +18,6 @@ | |||
| 9 | 18 | from gitlab.base import RESTManager, RESTObject | |
| 10 | 19 | from gitlab.mixins import RefreshMixin, RetrieveMixin | |
| 11 | 20 | ||
| 12 | - if sys.version_info >= (3, 8): | ||
| 13 | - from typing import Literal | ||
| 14 | - else: | ||
| 15 | - from typing_extensions import Literal | ||
| 16 | - | ||
| 17 | 21 | __all__ = [ | |
| 18 | 22 | "ProjectJob", | |
| 19 | 23 | "ProjectJobManager", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,9 +4,17 @@ | |||
| 4 | 4 | https://docs.gitlab.com/ee/user/packages/generic_packages/ | |
| 5 | 5 | """ | |
| 6 | 6 | ||
| 7 | - import sys | ||
| 8 | 7 | from pathlib import Path | |
| 9 | - from typing import Any, Callable, cast, Iterator, Optional, TYPE_CHECKING, Union | ||
| 8 | + from typing import ( | ||
| 9 | + Any, | ||
| 10 | + Callable, | ||
| 11 | + cast, | ||
| 12 | + Iterator, | ||
| 13 | + Literal, | ||
| 14 | + Optional, | ||
| 15 | + TYPE_CHECKING, | ||
| 16 | + Union, | ||
| 17 | + ) | ||
| 10 | 18 | ||
| 11 | 19 | import requests | |
| 12 | 20 | ||
@@ -16,11 +24,6 @@ | |||
| 16 | 24 | from gitlab.base import RESTManager, RESTObject | |
| 17 | 25 | from gitlab.mixins import DeleteMixin, GetMixin, ListMixin, ObjectDeleteMixin | |
| 18 | 26 | ||
| 19 | - if sys.version_info >= (3, 8): | ||
| 20 | - from typing import Literal | ||
| 21 | - else: | ||
| 22 | - from typing_extensions import Literal | ||
| 23 | - | ||
| 24 | 27 | __all__ = [ | |
| 25 | 28 | "GenericPackage", | |
| 26 | 29 | "GenericPackageManager", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,11 @@ | |||
| 1 | - import sys | ||
| 2 | 1 | from typing import ( | |
| 3 | 2 | Any, | |
| 4 | 3 | Callable, | |
| 5 | 4 | cast, | |
| 6 | 5 | Dict, | |
| 7 | 6 | Iterator, | |
| 8 | 7 | List, | |
| 8 | + Literal, | ||
| 9 | 9 | Optional, | |
| 10 | 10 | TYPE_CHECKING, | |
| 11 | 11 | Union, | |
@@ -82,11 +82,6 @@ | |||
| 82 | 82 | from .variables import ProjectVariableManager # noqa: F401 | |
| 83 | 83 | from .wikis import ProjectWikiManager # noqa: F401 | |
| 84 | 84 | ||
| 85 | - if sys.version_info >= (3, 8): | ||
| 86 | - from typing import Literal | ||
| 87 | - else: | ||
| 88 | - from typing_extensions import Literal | ||
| 89 | - | ||
| 90 | 85 | __all__ = [ | |
| 91 | 86 | "GroupProject", | |
| 92 | 87 | "GroupProjectManager", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,8 +3,17 @@ | |||
| 3 | 3 | ||
| 4 | 4 | Currently this module only contains repository-related methods for projects. | |
| 5 | 5 | """ | |
| 6 | - import sys | ||
| 7 | - from typing import Any, Callable, Dict, Iterator, List, Optional, TYPE_CHECKING, Union | ||
| 6 | + from typing import ( | ||
| 7 | + Any, | ||
| 8 | + Callable, | ||
| 9 | + Dict, | ||
| 10 | + Iterator, | ||
| 11 | + List, | ||
| 12 | + Literal, | ||
| 13 | + Optional, | ||
| 14 | + TYPE_CHECKING, | ||
| 15 | + Union, | ||
| 16 | + ) | ||
| 8 | 17 | ||
| 9 | 18 | import requests | |
| 10 | 19 | ||
@@ -13,11 +22,6 @@ | |||
| 13 | 22 | from gitlab import exceptions as exc | |
| 14 | 23 | from gitlab import utils | |
| 15 | 24 | ||
| 16 | - if sys.version_info >= (3, 8): | ||
| 17 | - from typing import Literal | ||
| 18 | - else: | ||
| 19 | - from typing_extensions import Literal | ||
| 20 | - | ||
| 21 | 25 | if TYPE_CHECKING: | |
| 22 | 26 | # When running mypy we use these as the base classes | |
| 23 | 27 | _RestObjectBase = gitlab.base.RESTObject | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,14 @@ | |||
| 1 | - import sys | ||
| 2 | - from typing import Any, Callable, cast, Iterator, List, Optional, TYPE_CHECKING, Union | ||
| 1 | + from typing import ( | ||
| 2 | + Any, | ||
| 3 | + Callable, | ||
| 4 | + cast, | ||
| 5 | + Iterator, | ||
| 6 | + List, | ||
| 7 | + Literal, | ||
| 8 | + Optional, | ||
| 9 | + TYPE_CHECKING, | ||
| 10 | + Union, | ||
| 11 | + ) | ||
| 3 | 12 | ||
| 4 | 13 | import requests | |
| 5 | 14 | ||
@@ -13,11 +22,6 @@ | |||
| 13 | 22 | from .discussions import ProjectSnippetDiscussionManager # noqa: F401 | |
| 14 | 23 | from .notes import ProjectSnippetNoteManager # noqa: F401 | |
| 15 | 24 | ||
| 16 | - if sys.version_info >= (3, 8): | ||
| 17 | - from typing import Literal | ||
| 18 | - else: | ||
| 19 | - from typing_extensions import Literal | ||
| 20 | - | ||
| 21 | 25 | __all__ = [ | |
| 22 | 26 | "Snippet", | |
| 23 | 27 | "SnippetManager", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments