robotcode-robot 0.73.3__py3-none-any.whl → 0.75.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- __version__ = "0.73.3"
1
+ __version__ = "0.75.0"
@@ -34,6 +34,7 @@ class ConfigType(str, Enum):
34
34
  ROBOT_TOML = "robot.toml (project file)"
35
35
  LOCAL_ROBOT_TOML = ".robot.toml (local file)"
36
36
  USER_DEFAULT_CONFIG_TOML = "robot.toml (user default config)"
37
+ DEFAULT_CONFIG_TOML = "(default config)"
37
38
  CUSTOM_TOML = ".toml (custom file)"
38
39
 
39
40
 
@@ -118,6 +119,12 @@ def load_config_from_path(
118
119
  result = config_type()
119
120
 
120
121
  for __path in __paths:
122
+ if isinstance(__path, tuple):
123
+ path, c_type = __path
124
+ if path.name == "__no_user_config__.toml" and c_type == ConfigType.DEFAULT_CONFIG_TOML:
125
+ result.add_options(get_default_config())
126
+ continue
127
+
121
128
  result.add_options(
122
129
  _load_config_data_from_path(
123
130
  config_type,
@@ -16,28 +16,29 @@ def get_user_config_file(
16
16
  create: bool = True,
17
17
  verbose_callback: Optional[Callable[[str], None]] = None,
18
18
  ) -> Optional[Path]:
19
- result = Path(platformdirs.user_config_dir("robotcode", appauthor=False), "robot.toml")
20
- if result.is_file():
21
- if verbose_callback:
22
- verbose_callback(f"Found user configuration file:\n {result}")
23
- return result
19
+ try:
20
+ result = Path(platformdirs.user_config_dir("robotcode", appauthor=False), "robot.toml")
21
+ if result.is_file():
22
+ if verbose_callback:
23
+ verbose_callback(f"Found user configuration file:\n {result}")
24
+ return result
25
+
26
+ if not create:
27
+ if verbose_callback:
28
+ verbose_callback("User configuration file not found, but create is set to False.")
29
+ return None
24
30
 
25
- if not create:
26
31
  if verbose_callback:
27
- verbose_callback("User configuration file not found, but create is set to False.")
28
- return None
32
+ verbose_callback(f"User configuration file not found, try to create it at:\n {result}")
29
33
 
30
- if verbose_callback:
31
- verbose_callback(f"User configuration file not found, try to create it at:\n {result}")
32
- try:
33
34
  get_default_config().save(result)
35
+
36
+ return result
34
37
  except OSError as e:
35
38
  if verbose_callback:
36
39
  verbose_callback(f"Cannot create user configuration file `{result}`:\n {e}")
37
40
  return None
38
41
 
39
- return result
40
-
41
42
 
42
43
  def get_config_files(
43
44
  paths: Optional[Sequence[Union[str, Path]]] = None,
@@ -73,7 +74,11 @@ def get_config_files(
73
74
 
74
75
  return (
75
76
  [
76
- *([(user_config, ConfigType.USER_DEFAULT_CONFIG_TOML)] if user_config else []),
77
+ *(
78
+ [(user_config, ConfigType.USER_DEFAULT_CONFIG_TOML)]
79
+ if user_config
80
+ else [(Path("__no_user_config__.toml"), ConfigType.DEFAULT_CONFIG_TOML)]
81
+ ),
77
82
  *result,
78
83
  ],
79
84
  root_folder,
@@ -2118,14 +2118,19 @@ def get_variables_doc(
2118
2118
  if import_name.lower().endswith((".yaml", ".yml")):
2119
2119
  source = import_name
2120
2120
  importer = YamlImporter()
2121
+ stem = Path(import_name).stem
2121
2122
  elif get_robot_version() >= (6, 1) and import_name.lower().endswith(".json"):
2122
2123
  source = import_name
2123
2124
  importer = JsonImporter()
2125
+ stem = Path(import_name).stem
2124
2126
  else:
2125
2127
  python_import = True
2126
2128
 
2127
2129
  if not is_variables_by_path(import_name):
2130
+ stem = import_name
2128
2131
  module_spec = get_module_spec(import_name)
2132
+ else:
2133
+ stem = Path(import_name).stem
2129
2134
 
2130
2135
  # skip antigravity easter egg
2131
2136
  # see https://python-history.blogspot.com/2010/06/import-antigravity.html
@@ -1292,8 +1292,8 @@ class Namespace:
1292
1292
  code=Error.VARIABLES_ALREADY_IMPORTED,
1293
1293
  )
1294
1294
 
1295
- if (entry.alias or entry.name or entry.import_name) not in self._variables:
1296
- self._variables[entry.alias or entry.name or entry.import_name] = entry
1295
+ if entry.library_doc is not None and entry.library_doc.source_or_origin:
1296
+ self._variables[entry.library_doc.source_or_origin] = entry
1297
1297
 
1298
1298
  elif isinstance(entry, LibraryEntry):
1299
1299
  if top_level and entry.name == BUILTIN_LIBRARY_NAME and entry.alias is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: robotcode-robot
3
- Version: 0.73.3
3
+ Version: 0.75.0
4
4
  Summary: Support classes for RobotCode for handling Robot Framework projects.
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://github.com/sponsors/d-biehl
@@ -26,7 +26,7 @@ Classifier: Topic :: Utilities
26
26
  Classifier: Typing :: Typed
27
27
  Requires-Python: >=3.8
28
28
  Requires-Dist: platformdirs<4.2.0,>=3.2.0
29
- Requires-Dist: robotcode-core==0.73.3
29
+ Requires-Dist: robotcode-core==0.75.0
30
30
  Requires-Dist: robotframework>=4.1.0
31
31
  Requires-Dist: tomli>=1.1.0; python_version < '3.11'
32
32
  Description-Content-Type: text/markdown
@@ -1,18 +1,18 @@
1
1
  robotcode/robot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- robotcode/robot/__version__.py,sha256=NYI4tnIyAcQnaIoMqW-40sA0OyiSIg3JmmqbS5P4f6A,23
2
+ robotcode/robot/__version__.py,sha256=FlfW9AKU7W9yjqB-fWhEZ6eKzRyW5xIkfY9RgU-AKc8,23
3
3
  robotcode/robot/py.typed,sha256=bWew9mHgMy8LqMu7RuqQXFXLBxh2CRx0dUbSx-3wE48,27
4
4
  robotcode/robot/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- robotcode/robot/config/loader.py,sha256=RvFjU3fu5U4VlTSVDa0uUzZNAnpVdZwIy_4a0sXh6d0,5777
5
+ robotcode/robot/config/loader.py,sha256=LpGqJAdysvVSZpccW-Il52xn9RMBBb9X94emlBY7zCc,6077
6
6
  robotcode/robot/config/model.py,sha256=QzniYg-pxQucKJDg7_lSodWg6DKwhTaVf_wN3biUXCk,86499
7
- robotcode/robot/config/utils.py,sha256=mNNE8Uq5U78_OPwhOdZjtt1HufczyEHogGMB0azRcC4,2651
7
+ robotcode/robot/config/utils.py,sha256=c_WZg39DJgM6kXcAH_h-v68qhf1eStJ0TslTawaJoZw,2827
8
8
  robotcode/robot/diagnostics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  robotcode/robot/diagnostics/document_cache_helper.py,sha256=mH-LGVjBHilKpmKa0_yPdxLOa3guk4QmJCmLlnU4O1I,19951
10
10
  robotcode/robot/diagnostics/entities.py,sha256=m_AXtaMGrkk7f7oVOQc90-gA21y-sHiMbsxxI_YrmWc,11084
11
11
  robotcode/robot/diagnostics/errors.py,sha256=VavgWYuHoW5sTT16j2rl9hxMhWxBKNSFsNmHWPzARQQ,1413
12
12
  robotcode/robot/diagnostics/imports_manager.py,sha256=_sTLlw8VCpl2Z7xCmv4JAApzOyKH-PRzRgqovPbhInE,55303
13
- robotcode/robot/diagnostics/library_doc.py,sha256=0m5VT0eBuFBwEDET65rnex-sDipGP-s0g3KUNS7kwD0,97659
13
+ robotcode/robot/diagnostics/library_doc.py,sha256=xbES1fiUFF4JMvUzPt2bv_vxNGbk04EecmWXXMlq11E,97862
14
14
  robotcode/robot/diagnostics/model_helper.py,sha256=wkh2ltduJkl8YPU1UVltgrpRAgLZEAOqgfSsaSF9X54,29858
15
- robotcode/robot/diagnostics/namespace.py,sha256=HVEc86InVOgLH6wjvtWRkHq3spd2cZAnGZegolSl1SU,83172
15
+ robotcode/robot/diagnostics/namespace.py,sha256=NM6T6JkHp5dYee9Cp1isHSAZrVpGI6jKryWbSZ2lw0c,83157
16
16
  robotcode/robot/diagnostics/namespace_analyzer.py,sha256=OeHKOLfwL5qIDKWTdEhzYYAbTP5CkGIVFjnhJSn03m0,48508
17
17
  robotcode/robot/diagnostics/workspace_config.py,sha256=WbHH8R3KSX-ryPgUYgBnR6gPMpTST2o98Mqyp4p6liw,1729
18
18
  robotcode/robot/utils/__init__.py,sha256=OjNPMn_XSnfaMCyKd8Kmq6vlRt6mIGlzW4qiiD3ykUg,447
@@ -23,7 +23,7 @@ robotcode/robot/utils/robot_path.py,sha256=qKBh1cEnReBBLKkWu4gB9EzM-scAwE4xJc1m6
23
23
  robotcode/robot/utils/stubs.py,sha256=6-DMI_CQVJHDgG13t-zINKGCRb_Q7MQPm0_AkfhAEvE,748
24
24
  robotcode/robot/utils/variables.py,sha256=fEl8S37lb_mD4hn2MZRAlkiuLGBjAOeZVK0r2o2CfPw,742
25
25
  robotcode/robot/utils/visitor.py,sha256=uYLqEhGPmzWKWI3SSrmCaYMwtKvNShvbiPZ4b3FavX8,3241
26
- robotcode_robot-0.73.3.dist-info/METADATA,sha256=ajxCda_t15wPgsV3MPSJgTAaf2MhxCcvuYXe0z4XYYY,2209
27
- robotcode_robot-0.73.3.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
28
- robotcode_robot-0.73.3.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
29
- robotcode_robot-0.73.3.dist-info/RECORD,,
26
+ robotcode_robot-0.75.0.dist-info/METADATA,sha256=ebuuNWbghQgcQbmgAmo50cDYatN2GzCKVg7jaVPKMhY,2209
27
+ robotcode_robot-0.75.0.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
28
+ robotcode_robot-0.75.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
29
+ robotcode_robot-0.75.0.dist-info/RECORD,,