Skip to content

Commit 3f320af

Browse files
nejchJohnVillalovos
authored andcommitted
refactor(objects): remove deprecated constants defined in objects
BREAKING CHANGE: remove deprecated constants defined in gitlab.v4.objects, and use only gitlab.const module
1 parent 2b8a94a commit 3f320af

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

gitlab/const.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@
2525
REPORTER_ACCESS: int = 20
2626
DEVELOPER_ACCESS: int = 30
2727
MAINTAINER_ACCESS: int = 40
28-
MASTER_ACCESS: int = MAINTAINER_ACCESS
2928
OWNER_ACCESS: int = 50
3029

31-
VISIBILITY_PRIVATE: int = 0
32-
VISIBILITY_INTERNAL: int = 10
33-
VISIBILITY_PUBLIC: int = 20
30+
VISIBILITY_PRIVATE: str = "private"
31+
VISIBILITY_INTERNAL: str = "internal"
32+
VISIBILITY_PUBLIC: str = "public"
3433

3534
NOTIFICATION_LEVEL_DISABLED: str = "disabled"
3635
NOTIFICATION_LEVEL_PARTICIPATING: str = "participating"

gitlab/v4/objects/__init__.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,4 @@
7474
from .variables import *
7575
from .wikis import *
7676

77-
# TODO: deprecate these in favor of gitlab.const.*
78-
VISIBILITY_PRIVATE = "private"
79-
VISIBILITY_INTERNAL = "internal"
80-
VISIBILITY_PUBLIC = "public"
81-
82-
ACCESS_GUEST = 10
83-
ACCESS_REPORTER = 20
84-
ACCESS_DEVELOPER = 30
85-
ACCESS_MASTER = 40
86-
ACCESS_OWNER = 50
87-
8877
__all__ = [name for name in dir() if not name.startswith("_")]

tests/functional/api/test_snippets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_project_snippets(project):
3333
"title": "snip1",
3434
"file_name": "foo.py",
3535
"content": "initial content",
36-
"visibility": gitlab.v4.objects.VISIBILITY_PRIVATE,
36+
"visibility": gitlab.VISIBILITY_PRIVATE,
3737
}
3838
)
3939

0 commit comments

Comments
 (0)