klayout-vector-file-export-cli 0.2__tar.gz → 0.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: klayout-vector-file-export-cli
3
- Version: 0.2
3
+ Version: 0.4
4
4
  Summary: Vector File Export CLI Tool for KLayout
5
5
  License: GPL-3.0-or-later
6
6
  License-File: LICENSE
@@ -245,16 +245,20 @@ class CLIWrapper:
245
245
  sys.exit(0)
246
246
 
247
247
  from cli_args import build_parser, args_to_settings, validate_settings
248
+
249
+ try:
250
+ from cli_args import CLIArgumentValidationError
251
+ except ImportError:
252
+ # for compatibility with older plugin versions,
253
+ # declare a fallback that prints whatever the exception carries
254
+ class CLIArgumentValidationError(Exception):
255
+ pass
256
+
248
257
  parser = build_parser()
249
258
  args = parser.parse_args(sys.argv[1:])
250
259
 
251
260
  settings = args_to_settings(args)
252
- validate_settings(settings)
253
-
254
- debug("=" * 60)
255
- debug("Call KLayout")
256
- debug("=" * 60)
257
-
261
+
258
262
  errors = []
259
263
 
260
264
  if args.input_path is None:
@@ -266,9 +270,18 @@ class CLIWrapper:
266
270
  if args.technology is None:
267
271
  errors += [f"ERROR: Technology is missing, please provide command line argument --tech / -t"]
268
272
 
273
+ try:
274
+ validate_settings(settings)
275
+ except CLIArgumentValidationError as e:
276
+ errors += e.errors if hasattr(e, 'errors') else list(e.args)
277
+
269
278
  if errors:
270
279
  print('\n'.join(errors))
271
280
  sys.exit(1)
281
+
282
+ debug("=" * 60)
283
+ debug("Call KLayout")
284
+ debug("=" * 60)
272
285
 
273
286
  input_path = Path(args.input_path).resolve()
274
287
 
@@ -287,11 +300,13 @@ class CLIWrapper:
287
300
 
288
301
  debug(f" ✔ Settings written to temp file: {settings_path}")
289
302
 
290
- # Build subprocess environment:
291
- # Set KLAYOUT_PATH="" to prevent KLayout from reading any config files
292
- # from additional search paths.
303
+ # NOTE: we no longer do this, as it hindered us to find the technologies!
304
+ # this error could be reproduced on IIC-OSIC-TOOLS
305
+ #
306
+ # Set KLAYOUT_PATH="" to prevent KLayout from reading any config files
307
+ # from additional search paths.
293
308
  klayout_env = os.environ.copy()
294
- klayout_env["KLAYOUT_PATH"] = ""
309
+ # klayout_env["KLAYOUT_PATH"] = ""
295
310
 
296
311
  try:
297
312
  # NOTE: we do not pass -nc, as it would hinder us to find the technology
@@ -21,4 +21,4 @@
21
21
  # SPDX-License-Identifier: GPL-3.0-or-later
22
22
  # --------------------------------------------------------------------------------
23
23
  #
24
- __version__ = "0.2"
24
+ __version__ = "0.4"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "klayout-vector-file-export-cli"
3
- version = "0.2"
3
+ version = "0.4"
4
4
  description = "Vector File Export CLI Tool for KLayout"
5
5
  authors = ["Martin Köhler <info@martinjankoehler.com>"]
6
6
  homepage = "https://github.com/iic-jku/klayout-vector-file-export-cli/"