Skip to content

Commit cf92904

Browse files
refactor: explicitly import gitlab.const values into top-level namespace
We are planning on adding enumerated constants into gitlab/const.py, but if we do that than they will end up being added to the top-level gitlab namespace. We really want to get users to start using `gitlab.const.` to access the constant values in the future. Explicitly add the current values defined in gitlab.const into the top-level namespace and stop using the previous 'from gitlab.const import *' method.
1 parent 500895a commit cf92904

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

gitlab/__init__.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,36 @@
2828
__version__,
2929
)
3030
from gitlab.client import Gitlab, GitlabList # noqa: F401
31-
from gitlab.const import * # noqa: F401,F403
31+
from gitlab.const import ( # noqa: F401
32+
DEFAULT_URL,
33+
DEVELOPER_ACCESS,
34+
GUEST_ACCESS,
35+
MAINTAINER_ACCESS,
36+
MINIMAL_ACCESS,
37+
NO_ACCESS,
38+
NOTIFICATION_LEVEL_CUSTOM,
39+
NOTIFICATION_LEVEL_DISABLED,
40+
NOTIFICATION_LEVEL_GLOBAL,
41+
NOTIFICATION_LEVEL_MENTION,
42+
NOTIFICATION_LEVEL_PARTICIPATING,
43+
NOTIFICATION_LEVEL_WATCH,
44+
OWNER_ACCESS,
45+
REPORTER_ACCESS,
46+
SEARCH_SCOPE_BLOBS,
47+
SEARCH_SCOPE_COMMITS,
48+
SEARCH_SCOPE_GLOBAL_SNIPPET_TITLES,
49+
SEARCH_SCOPE_ISSUES,
50+
SEARCH_SCOPE_MERGE_REQUESTS,
51+
SEARCH_SCOPE_MILESTONES,
52+
SEARCH_SCOPE_PROJECT_NOTES,
53+
SEARCH_SCOPE_PROJECTS,
54+
SEARCH_SCOPE_USERS,
55+
SEARCH_SCOPE_WIKI_BLOBS,
56+
USER_AGENT,
57+
VISIBILITY_INTERNAL,
58+
VISIBILITY_PRIVATE,
59+
VISIBILITY_PUBLIC,
60+
)
3261
from gitlab.exceptions import * # noqa: F401,F403
3362

3463
warnings.filterwarnings("default", category=DeprecationWarning, module="^gitlab")

0 commit comments

Comments
 (0)