pyappify 1.0.10__tar.gz → 1.0.13__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: pyappify
3
- Version: 1.0.10
3
+ Version: 1.0.13
4
4
  Summary: My awesome Python application
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -93,7 +93,7 @@ def find_pyappify_executable(start_dir=None, environ=None):
93
93
  return None
94
94
 
95
95
  app_root = data_directory.parent
96
- exact_launcher_name = "{} Launcher.exe".format(app_name).casefold()
96
+ executable_name = "{}.exe".format(app_name)
97
97
  search_directories = []
98
98
  directory = working_directory
99
99
  while True:
@@ -103,24 +103,9 @@ def find_pyappify_executable(start_dir=None, environ=None):
103
103
  directory = directory.parent
104
104
 
105
105
  for directory in search_directories:
106
- try:
107
- candidates = [
108
- candidate
109
- for candidate in directory.iterdir()
110
- if candidate.is_file()
111
- and candidate.suffix.casefold() == ".exe"
112
- and candidate.name.casefold().startswith(app_name.casefold())
113
- ]
114
- except OSError:
115
- continue
116
- if candidates:
117
- candidates.sort(
118
- key=lambda candidate: (
119
- candidate.name.casefold() != exact_launcher_name,
120
- candidate.name.casefold(),
121
- )
122
- )
123
- return str(candidates[0].resolve())
106
+ candidate = directory / executable_name
107
+ if candidate.is_file():
108
+ return str(candidate.resolve())
124
109
  return None
125
110
 
126
111
 
@@ -332,8 +317,8 @@ def _require_pyappify_executable():
332
317
  if not pyappify_executable:
333
318
  raise FileNotFoundError(
334
319
  "PyAppify executable was not found. Set PYAPPIFY_EXECUTABLE to an "
335
- "existing executable or place an executable whose name starts with the app name "
336
- "in the working directory or a parent directory."
320
+ "existing executable or place <app_name>.exe between the working directory "
321
+ "and the app root."
337
322
  )
338
323
  return pyappify_executable
339
324
 
@@ -427,6 +412,12 @@ def get_version_list(
427
412
  if not isinstance(release_only, bool):
428
413
  raise TypeError("release_only must be a boolean")
429
414
 
415
+ if not _is_supported_pyappify_version(pyappify_version):
416
+ raise RuntimeError(
417
+ "PyAppify does not support checking for updates for "
418
+ f"pyappify_version: {pyappify_version}"
419
+ )
420
+
430
421
  if "PYAPPIFY_PYTHON_TEST" in os.environ:
431
422
  if _wait_for_exit(exit_event, 5):
432
423
  _raise_if_exit_requested(exit_event)
@@ -448,6 +439,19 @@ def get_version_list(
448
439
  return response
449
440
 
450
441
 
442
+ def _is_supported_pyappify_version(version):
443
+ """Return whether a PyAppify version is valid and supports version checks."""
444
+ if not isinstance(version, str) or not version:
445
+ return False
446
+
447
+ normalized = version[1:] if version.startswith("v") else version
448
+ parts = normalized.split(".")
449
+ if not parts or any(not part.isdigit() for part in parts):
450
+ return False
451
+
452
+ return tuple(int(part) for part in parts) >= (1, 2, 2)
453
+
454
+
451
455
  def get_versions(number_versions=10, release_only=True, timeout=120, exit_event=None):
452
456
  """Alias for get_version_list."""
453
457
  return get_version_list(number_versions, release_only, timeout, exit_event)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyappify
3
- Version: 1.0.10
3
+ Version: 1.0.13
4
4
  Summary: My awesome Python application
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyappify"
7
- version = "1.0.10"
7
+ version = "1.0.13"
8
8
  description = "My awesome Python application"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
File without changes
File without changes