pyproject-appimage 4.1__tar.gz → 4.2__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,9 +1,9 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: pyproject-appimage
3
- Version: 4.1
3
+ Version: 4.2
4
4
  Summary: Generate AppImages from your Python projects
5
5
  Author-email: JakobDev <jakobdev@gmx.de>
6
- License: BSD-2-Clause
6
+ License-Expression: BSD-2-Clause
7
7
  Project-URL: Downloads, https://codeberg.org/JakobDev/pyproject-appimage/releases
8
8
  Project-URL: Issues, https://codeberg.org/JakobDev/pyproject-appimage/issues
9
9
  Project-URL: Source, https://codeberg.org/JakobDev/pyproject-appimage
@@ -12,13 +12,14 @@ Keywords: JakobDev,AppImage
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Environment :: Other Environment
15
- Classifier: License :: OSI Approved :: BSD License
16
15
  Classifier: Topic :: Games/Entertainment
17
16
  Classifier: Operating System :: POSIX :: Linux
18
17
  Classifier: Programming Language :: Python :: 3
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
22
23
  Classifier: Programming Language :: Python :: 3 :: Only
23
24
  Classifier: Programming Language :: Python :: Implementation :: CPython
24
25
  Requires-Python: >=3.9
@@ -27,6 +28,7 @@ License-File: LICENSE
27
28
  Requires-Dist: requests
28
29
  Requires-Dist: desktop-entry-lib
29
30
  Requires-Dist: tomli; python_version < "3.11"
31
+ Dynamic: license-file
30
32
 
31
33
  # pyproject-appimage
32
34
 
@@ -8,7 +8,7 @@ description = "Generate AppImages from your Python projects"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.9"
10
10
  keywords = ["JakobDev", "AppImage"]
11
- license = { text = "BSD-2-Clause" }
11
+ license = "BSD-2-Clause"
12
12
  authors = [
13
13
  { name = "JakobDev", email = "jakobdev@gmx.de" }
14
14
  ]
@@ -16,13 +16,14 @@ classifiers = [
16
16
  "Development Status :: 5 - Production/Stable",
17
17
  "Intended Audience :: Developers",
18
18
  "Environment :: Other Environment",
19
- "License :: OSI Approved :: BSD License",
20
19
  "Topic :: Games/Entertainment",
21
20
  "Operating System :: POSIX :: Linux",
22
21
  "Programming Language :: Python :: 3",
23
22
  "Programming Language :: Python :: 3.9",
24
23
  "Programming Language :: Python :: 3.10",
25
24
  "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
26
27
  "Programming Language :: Python :: 3 :: Only",
27
28
  "Programming Language :: Python :: Implementation :: CPython"
28
29
  ]
@@ -5,6 +5,7 @@ import argparse
5
5
  import requests
6
6
  import platform
7
7
  import tempfile
8
+ import pathlib
8
9
  import shutil
9
10
  import sys
10
11
  import os
@@ -122,6 +123,27 @@ def get_python_download_link(version: str) -> str:
122
123
  return None
123
124
 
124
125
 
126
+ def get_exec_prefix(app_root: str) -> Optional[str]:
127
+ try:
128
+ result = subprocess.run([os.path.join(app_root, "usr", "bin", "python"), "-c", "import sys; print(sys.exec_prefix)"], capture_output=True, check=True)
129
+ return result.stdout.decode("utf-8").strip()
130
+ except Exception:
131
+ return None
132
+
133
+
134
+ def find_script(app_root: str, name: str) -> Optional[str]:
135
+ usr_path = os.path.join(app_root, "usr", "bin", name)
136
+ if os.path.isfile(usr_path):
137
+ return usr_path
138
+
139
+ if (exec_prefix := get_exec_prefix(app_root)) is not None:
140
+ prefix_path = os.path.join(exec_prefix, "bin", name)
141
+ if os.path.isfile(prefix_path):
142
+ return prefix_path
143
+
144
+ return None
145
+
146
+
125
147
  def get_image_magick_command(work_dir: str) -> str:
126
148
  if shutil.which("magick") is not None:
127
149
  return "magick"
@@ -257,11 +279,18 @@ def build_appimage(project_dir: str, work_dir: str, pyproject: PyprojectDict, ar
257
279
 
258
280
  subprocess.run([os.path.join(app_root, "usr", "bin", "pip"), "install", "--no-warn-script-location", project_dir], check=True)
259
281
 
260
- if not os.path.isfile(os.path.join(app_root, "usr", "bin", pyproject["script"])):
261
- print("The script " + pyproject["script"] + " as not found")
282
+ script_path = find_script(app_root, pyproject["script"])
283
+ if script_path is None:
284
+ print("The script " + pyproject["script"] + " was not found")
262
285
  sys.exit(1)
263
286
 
264
- os.symlink(os.path.join("usr", "bin", pyproject["script"]), os.path.join(app_root, "AppRun"))
287
+ app_run = os.path.join(app_root, "AppRun")
288
+
289
+ with open(app_run, "w", encoding="utf-8") as f:
290
+ f.write("#!/bin/sh\n")
291
+ f.write('exec "${APPDIR}/usr/bin/python" "${APPDIR}/' + str(pathlib.Path(script_path).relative_to(app_root)) + '" "$@"\n')
292
+
293
+ subprocess.run(["chmod", "+x", app_run], check=True)
265
294
 
266
295
  handle_icon(project_dir, work_dir, app_root, pyproject)
267
296
 
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: pyproject-appimage
3
- Version: 4.1
3
+ Version: 4.2
4
4
  Summary: Generate AppImages from your Python projects
5
5
  Author-email: JakobDev <jakobdev@gmx.de>
6
- License: BSD-2-Clause
6
+ License-Expression: BSD-2-Clause
7
7
  Project-URL: Downloads, https://codeberg.org/JakobDev/pyproject-appimage/releases
8
8
  Project-URL: Issues, https://codeberg.org/JakobDev/pyproject-appimage/issues
9
9
  Project-URL: Source, https://codeberg.org/JakobDev/pyproject-appimage
@@ -12,13 +12,14 @@ Keywords: JakobDev,AppImage
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Environment :: Other Environment
15
- Classifier: License :: OSI Approved :: BSD License
16
15
  Classifier: Topic :: Games/Entertainment
17
16
  Classifier: Operating System :: POSIX :: Linux
18
17
  Classifier: Programming Language :: Python :: 3
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
22
23
  Classifier: Programming Language :: Python :: 3 :: Only
23
24
  Classifier: Programming Language :: Python :: Implementation :: CPython
24
25
  Requires-Python: >=3.9
@@ -27,6 +28,7 @@ License-File: LICENSE
27
28
  Requires-Dist: requests
28
29
  Requires-Dist: desktop-entry-lib
29
30
  Requires-Dist: tomli; python_version < "3.11"
31
+ Dynamic: license-file
30
32
 
31
33
  # pyproject-appimage
32
34