bk-resource 0.4.12b0__py3-none-any.whl → 0.4.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,13 +26,10 @@ from rest_framework.generics import GenericAPIView
26
26
  from rest_framework.viewsets import ModelViewSet
27
27
 
28
28
  from bk_resource import Resource
29
+ from bk_resource.base import Empty
29
30
  from bk_resource.utils.request import get_mock_request
30
31
 
31
32
 
32
- class Empty:
33
- ...
34
-
35
-
36
33
  class ViewMixin(GenericAPIView):
37
34
  filter_fields = []
38
35
  search_fields = []
@@ -42,9 +42,17 @@ class ResourceFinder(BaseFinder):
42
42
  app_names = set(app_names)
43
43
  app_configs = [ac for ac in app_configs if ac.name in app_names]
44
44
 
45
+ # 获取需要排除的应用列表
46
+ exclude_apps_env = bk_resource_settings.RESOURCE_EXCLUDE_APPS
47
+ exclude_apps = set()
48
+ if exclude_apps_env:
49
+ exclude_apps = set(app.strip() for app in exclude_apps_env.split(',') if app.strip())
50
+
45
51
  for app_config in app_configs:
46
- self.resource_path += self.find(app_config.path, root_path=os.path.dirname(app_config.path))
47
- app_path_directories.append(app_config.path)
52
+ # 检查当前应用是否在排除列表中
53
+ if app_config.name not in exclude_apps:
54
+ self.resource_path += self.find(app_config.path, root_path=os.path.dirname(app_config.path))
55
+ app_path_directories.append(app_config.path)
48
56
 
49
57
  for path in RESOURCE_DIRS:
50
58
  search_path = os.path.join(settings.BASE_DIR, path)
bk_resource/settings.py CHANGED
@@ -50,6 +50,7 @@ class BkResourceSettings:
50
50
  REQUEST_BKAPI_COOKIE_FIELDS=["blueking_language", "django_language"],
51
51
  REQUEST_LANGUGAE_HEADER_KEY="blueking-language",
52
52
  RESOURCE_BULK_REQUEST_PROCESSES=None,
53
+ RESOURCE_EXCLUDE_APPS="",
53
54
  )
54
55
 
55
56
  LAZY_IMPORT_SETTINGS = (
@@ -25,7 +25,7 @@ from django.core.cache import cache, caches
25
25
  from django.utils.encoding import force_bytes
26
26
  from django.utils.translation import gettext
27
27
 
28
- from bk_resource.contrib.model import Empty
28
+ from bk_resource.base import Empty
29
29
  from bk_resource.settings import bk_resource_settings
30
30
  from bk_resource.utils.common_utils import count_md5
31
31
  from bk_resource.utils.local import local
@@ -1,25 +1,33 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: bk_resource
3
- Version: 0.4.12b0
3
+ Version: 0.4.13
4
4
  Summary: Bk Resource
5
5
  Home-page: https://bk.tencent.com
6
6
  Author: blueking
7
7
  Author-email: blueking@tencent.com
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE.txt
10
- Requires-Dist: blueapps >=4.12.0
11
- Requires-Dist: django >=3.2.18
12
- Requires-Dist: djangorestframework >=3.12.0
13
- Requires-Dist: drf-yasg >=1.20.0
14
- Requires-Dist: pyinstrument >=3.4.2
15
- Requires-Dist: arrow >=1.2.0
16
- Requires-Dist: django-rest-framework-condition >=0.1.1
17
- Requires-Dist: celery >=5
10
+ Requires-Dist: blueapps>=4.12.0
11
+ Requires-Dist: django>=3.2.18
12
+ Requires-Dist: djangorestframework>=3.12.0
13
+ Requires-Dist: drf-yasg>=1.20.0
14
+ Requires-Dist: pyinstrument>=3.4.2
15
+ Requires-Dist: arrow>=1.2.0
16
+ Requires-Dist: django-rest-framework-condition>=0.1.1
17
+ Requires-Dist: celery>=4.4.0
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: home-page
23
+ Dynamic: license-file
24
+ Dynamic: requires-dist
25
+ Dynamic: summary
18
26
 
19
27
  ![logo.png](assests/logo.png)
20
28
 
21
29
  [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/TencentBlueKing/bk-resource/blob/main/LICENSE.txt)
22
- [![Release Version](https://img.shields.io/badge/release-0.4.12b0-brightgreen.svg)](https://github.com/TencentBlueKing/bk-resource/releases)
30
+ [![Release Version](https://img.shields.io/badge/release-0.4.13-brightgreen.svg)](https://github.com/TencentBlueKing/bk-resource/releases)
23
31
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/TencentBlueKing/bk-resource/pulls)
24
32
  [![codecov](https://codecov.io/gh/TencentBlueKing/bk-resource/branch/main/graph/badge.svg)](https://codecov.io/gh/TencentBlueKing/bk-resource)
25
33
  [![Unittest Py3](https://github.com/TencentBlueKing/bk-resource/actions/workflows/unittest.yml/badge.svg)](https://github.com/TencentBlueKing/bk-resource/actions/workflows/unittest.yml)
@@ -4,7 +4,7 @@ bk_resource/base.py,sha256=ABs1QI0isexmIP7LQJrQ5ZkzmbqRkVVhgsQfxV45nJA,14062
4
4
  bk_resource/exceptions.py,sha256=lrO1pHGzy8P0AvdCYMk1SR-qKCy-bbPNapZcINBw9c0,3883
5
5
  bk_resource/routers.py,sha256=tF1n15vj64v3Y-8IopOnLi8PDR6Z2p7pZRQAmtHXlzk,2766
6
6
  bk_resource/serializers.py,sha256=Az_2Qsp_5gUrhU_0iZS45komm5upU5u1UpNE-ArSX4s,2690
7
- bk_resource/settings.py,sha256=QCGKeetjdDIWHHu1_93MKPeJ_VpGlQXvW7gpln1pGlU,3827
7
+ bk_resource/settings.py,sha256=T4H5MXspuk6IzMwxrzDcUVT9LfmkJ8DiL_47-yF2qqA,3861
8
8
  bk_resource/tasks.py,sha256=OeBy41GfSDNL_0adGeKBG6LlVRqNUfP7KzXe7pxpr3I,4090
9
9
  bk_resource/tools.py,sha256=fPmiDNxh2FWo5Yo7CXtvYyHxyG3_JrGs5wYZMaVFAhE,8166
10
10
  bk_resource/viewsets.py,sha256=QhCIHiJ227N8njqr6bSJZxP5eBh3z5Q4u1dGzBjHHXs,11614
@@ -22,21 +22,21 @@ bk_resource/contrib/__init__.py,sha256=bP18WkBTSVynqrmGO6UDjhTdOCO0w18myXynyHMg6
22
22
  bk_resource/contrib/api.py,sha256=DFcjJsuwU9pKwvQE-nZhN2wApqkaC0feBIh4Es5mUxc,8658
23
23
  bk_resource/contrib/bk_api.py,sha256=HJW5GWM0tT-oR6AnYHjcU9JaymyKPrrx_0aCnZD1BaM,6304
24
24
  bk_resource/contrib/cache.py,sha256=Gp91ajqDUelXKDu2WTC_QXoTJiO--iWEMsNjl_hxAlg,2969
25
- bk_resource/contrib/model.py,sha256=ashkD_NzIR4WSEEQHPWPCp66wvKWwiaL1AHfQgWfyAY,5941
25
+ bk_resource/contrib/model.py,sha256=-zQOjnXllDYDMo6nxcvD8WrfzQuThfzcqf97gnRhwaE,5953
26
26
  bk_resource/locale/en/LC_MESSAGES/django.mo,sha256=2Pf2WZXzYQeGcnnNWo78xZ58vuOr7Tj5sc9v675SwSk,2943
27
27
  bk_resource/locale/en/LC_MESSAGES/django.po,sha256=VIssUCnLPT1BUKjTB93yR7uyc0IvHdgGS93wpV18cCg,4322
28
28
  bk_resource/locale/zh_CN/LC_MESSAGES/django.mo,sha256=3GCXKryGcXqFnoIDIDaz97SBpl5C99nbSzjSkM6bBkg,3022
29
29
  bk_resource/locale/zh_CN/LC_MESSAGES/django.po,sha256=84sz1mKUWfOv7S2yYn1ozhdW4Ie2stMalQxBHT0Gt2g,4398
30
30
  bk_resource/management/__init__.py,sha256=zTvK51uqIT4Sy_bCfeXQbIyI-SskbMWjUfVNrQzE-0k,891
31
31
  bk_resource/management/exceptions.py,sha256=0ADfQxZnNgE4TSxZmDTMG-1L_H39fPjQRyEgn_Er1Kk,1110
32
- bk_resource/management/finder.py,sha256=fwkkdpoZYdZE3uheiQu6OluHJ8anv4ASbykHAN_elTA,4859
32
+ bk_resource/management/finder.py,sha256=oEoRsE5hdCOwCpfOuUDxrMfk8aVKO81hU8B7fwubDLc,5247
33
33
  bk_resource/management/root.py,sha256=chD_WFz1o99hoBW9qmwvehyGgE2KKOiiijuMg9EfAoo,10304
34
34
  bk_resource/management/stub_file_generator.py,sha256=NHSEuYY2SzwvrVA9ewgzqh7WR7_x6vSYIshR1IED2hI,4974
35
35
  bk_resource/management/commands/__init__.py,sha256=zTvK51uqIT4Sy_bCfeXQbIyI-SskbMWjUfVNrQzE-0k,891
36
36
  bk_resource/management/commands/generate_resource_stub_file.py,sha256=M_S1eLxx-1eeF3VwbzJJl0DE2ABB3Z-i75Kb23nyi38,1110
37
37
  bk_resource/management/commands/start_resource.py,sha256=BHohJIXIsT2Ur0GbK1FctrEdY2RbJtIGs2myyRsOb8M,1243
38
38
  bk_resource/utils/__init__.py,sha256=zTvK51uqIT4Sy_bCfeXQbIyI-SskbMWjUfVNrQzE-0k,891
39
- bk_resource/utils/cache.py,sha256=g_d8iD9AWX_kOe_zVSaUVSJG9hgQclp_-gjtqDc5hME,10609
39
+ bk_resource/utils/cache.py,sha256=QNaXdEaAJDPhMvJmNdMB3vVA34bs4cPdkQJ5SZMA0Xk,10600
40
40
  bk_resource/utils/common_utils.py,sha256=uJ2O_64At_LhPexC1ZifMFNauG9oh73v9EdnUB3prUo,13205
41
41
  bk_resource/utils/factory.py,sha256=FtGnGqhi_ubUOxveEkfgrlpYFE2-m-oPFmSV9347UD8,5104
42
42
  bk_resource/utils/generators.py,sha256=qhs0msHJdmVm8z6phfkC-GjibhxJckq6xgM4IM8w5bU,2080
@@ -48,8 +48,8 @@ bk_resource/utils/request_log.py,sha256=VMSFu0c8e53e7TUFJtdKXpkM0_pl-mk1UaFFdrGY
48
48
  bk_resource/utils/text.py,sha256=exu7gEFANcU6apQOut_1VSzoddOvcKR3CXEF1Z19M4Y,3313
49
49
  bk_resource/utils/thread_backend.py,sha256=AdMWzXreFARinPdDaMiRJwwxSWL1EB4MUSz1Q7kYz90,5017
50
50
  bk_resource/utils/time_tools.py,sha256=y-eP-6Gu5ur3ET0bOp2ML8Z0HtrguvTPlbsSA1dNhWU,10967
51
- bk_resource-0.4.12b0.dist-info/LICENSE.txt,sha256=dnlkOMrlbRgRXlBt-a_QF6cs1MFG6WYmcotYbI6_gpo,859
52
- bk_resource-0.4.12b0.dist-info/METADATA,sha256=w11I_AfW-LozH5LyRbyaVoDZnLNQS3pmVSB_ndtX4Fo,5501
53
- bk_resource-0.4.12b0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
54
- bk_resource-0.4.12b0.dist-info/top_level.txt,sha256=UJxO1tbrqlmnvSTYCLoqg39_gvBesvjp3CcGEPjzXY4,12
55
- bk_resource-0.4.12b0.dist-info/RECORD,,
51
+ bk_resource-0.4.13.dist-info/licenses/LICENSE.txt,sha256=dnlkOMrlbRgRXlBt-a_QF6cs1MFG6WYmcotYbI6_gpo,859
52
+ bk_resource-0.4.13.dist-info/METADATA,sha256=UyK0j0JLEAkNZw3yU2wdBaDtn--aSmR2ROaKZfbel7Y,5667
53
+ bk_resource-0.4.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
+ bk_resource-0.4.13.dist-info/top_level.txt,sha256=UJxO1tbrqlmnvSTYCLoqg39_gvBesvjp3CcGEPjzXY4,12
55
+ bk_resource-0.4.13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5