From b8d379d5be016081992c06312d7d4790a5d52bfb Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Wed, 8 Sep 2021 23:42:05 +0200 Subject: [PATCH] refactor(objects): remove deprecated constants defined in objects BREAKING CHANGE: remove deprecated constants defined in gitlab.v4.objects, and use only gitlab.const module --- gitlab/const.py | 7 +++---- gitlab/v4/objects/__init__.py | 11 ----------- tests/functional/api/test_snippets.py | 2 +- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/gitlab/const.py b/gitlab/const.py index 095b43da1..c57423e84 100644 --- a/gitlab/const.py +++ b/gitlab/const.py @@ -25,12 +25,11 @@ REPORTER_ACCESS: int = 20 DEVELOPER_ACCESS: int = 30 MAINTAINER_ACCESS: int = 40 -MASTER_ACCESS: int = MAINTAINER_ACCESS OWNER_ACCESS: int = 50 -VISIBILITY_PRIVATE: int = 0 -VISIBILITY_INTERNAL: int = 10 -VISIBILITY_PUBLIC: int = 20 +VISIBILITY_PRIVATE: str = "private" +VISIBILITY_INTERNAL: str = "internal" +VISIBILITY_PUBLIC: str = "public" NOTIFICATION_LEVEL_DISABLED: str = "disabled" NOTIFICATION_LEVEL_PARTICIPATING: str = "participating" diff --git a/gitlab/v4/objects/__init__.py b/gitlab/v4/objects/__init__.py index 1b95410b8..c2ff4fb3d 100644 --- a/gitlab/v4/objects/__init__.py +++ b/gitlab/v4/objects/__init__.py @@ -74,15 +74,4 @@ from .variables import * from .wikis import * -# TODO: deprecate these in favor of gitlab.const.* -VISIBILITY_PRIVATE = "private" -VISIBILITY_INTERNAL = "internal" -VISIBILITY_PUBLIC = "public" - -ACCESS_GUEST = 10 -ACCESS_REPORTER = 20 -ACCESS_DEVELOPER = 30 -ACCESS_MASTER = 40 -ACCESS_OWNER = 50 - __all__ = [name for name in dir() if not name.startswith("_")] diff --git a/tests/functional/api/test_snippets.py b/tests/functional/api/test_snippets.py index 936fbfb32..9e0f833fd 100644 --- a/tests/functional/api/test_snippets.py +++ b/tests/functional/api/test_snippets.py @@ -33,7 +33,7 @@ def test_project_snippets(project): "title": "snip1", "file_name": "foo.py", "content": "initial content", - "visibility": gitlab.v4.objects.VISIBILITY_PRIVATE, + "visibility": gitlab.VISIBILITY_PRIVATE, } ) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy