UEPyScripts 1.2.7__tar.gz → 1.3.0__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.

Potentially problematic release.


This version of UEPyScripts might be problematic. Click here for more details.

Files changed (32) hide show
  1. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/PKG-INFO +1 -1
  2. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/internal/engine_resolver.py +8 -0
  3. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/internal/project.py +27 -2
  4. uepyscripts-1.3.0/src/uepyscripts/tools/subprocess.py +50 -0
  5. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/engine_installation/engine_installer.py +4 -1
  6. uepyscripts-1.2.7/src/uepyscripts/tools/subprocess.py +0 -23
  7. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/.gitignore +0 -0
  8. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/LICENSE +0 -0
  9. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/README.md +0 -0
  10. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/pyproject.toml +0 -0
  11. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/__init__.py +0 -0
  12. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/context/__init__.py +0 -0
  13. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/internal/__init__.py +0 -0
  14. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/internal/config.py +0 -0
  15. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/internal/engine.py +0 -0
  16. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/run/__init__.py +0 -0
  17. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/run/buildgraph.py +0 -0
  18. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/run/uat.py +0 -0
  19. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/run/ubt.py +0 -0
  20. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/__init__.py +0 -0
  21. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ci/buildgraph.py +0 -0
  22. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ci/cleanup.py +0 -0
  23. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/helpers.py +0 -0
  24. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/__init__.py +0 -0
  25. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/check_engine_installation.py +0 -0
  26. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/close_editor.py +0 -0
  27. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/compile_editor.py +0 -0
  28. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/engine_installation/engine_destination.py +0 -0
  29. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/engine_installation/engine_source.py +0 -0
  30. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/generate_solution.py +0 -0
  31. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/ue/run_editor.py +0 -0
  32. {uepyscripts-1.2.7 → uepyscripts-1.3.0}/src/uepyscripts/tools/winreg.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UEPyScripts
3
- Version: 1.2.7
3
+ Version: 1.3.0
4
4
  Summary: Collection of Python tools and helpers designed to automate common Unreal Engine project tasks (builds, packaging, editor control, CI tasks, etc.).
5
5
  Project-URL: Changelog, https://github.com/TheEmidee/UEPyScripts/releases
6
6
  Project-URL: Homepage, https://github.com/TheEmidee/UEPyScripts
@@ -11,6 +11,13 @@ from ..tools.helpers import get_engine_root_folder_from_env_var, is_engine_from_
11
11
  from ..tools.winreg import get_registry_value
12
12
 
13
13
 
14
+ def resolve_engine_from_native_project(project: Project) -> Optional[Path]:
15
+ if project.is_native_project:
16
+ return project.root_folder.parent
17
+
18
+ return None
19
+
20
+
14
21
  def resolve_engine_from_env_var(project: Project) -> Optional[Path]:
15
22
  return get_engine_root_folder_from_env_var(project.engine_association)
16
23
 
@@ -86,6 +93,7 @@ def resolve_engine_from_path(project: Project) -> Optional[Path]:
86
93
 
87
94
  def resolve_engine_path(project: Project) -> Path:
88
95
  resolvers = [
96
+ resolve_engine_from_native_project,
89
97
  resolve_engine_from_registry,
90
98
  resolve_engine_from_egs,
91
99
  resolve_engine_from_path,
@@ -1,4 +1,3 @@
1
- import os
2
1
  from pathlib import Path
3
2
  from typing import Optional
4
3
 
@@ -44,6 +43,10 @@ class Project:
44
43
  def engine_association(self) -> str:
45
44
  return self.uproject.engine_association
46
45
 
46
+ @property
47
+ def is_native_project(self) -> bool:
48
+ return not self.engine_association
49
+
47
50
  def __str__(self) -> str:
48
51
  return f"""
49
52
  ----- Project infos -----
@@ -55,6 +58,24 @@ class Project:
55
58
  """
56
59
 
57
60
 
61
+ EXCLUDED_DIR_NAMES = {"Engine", "FeaturePacks", "Samples", "Scripts", "Templates", ".git"}
62
+
63
+
64
+ def find_uproject_in_subfolders(root: Path) -> Optional[Path]:
65
+ """Recursively search for a .uproject file under root, skipping excluded folders."""
66
+ for entry in root.iterdir():
67
+ if entry.is_dir():
68
+ if entry.name in EXCLUDED_DIR_NAMES:
69
+ continue
70
+ found = find_uproject_in_subfolders(entry)
71
+ if found:
72
+ return found
73
+ elif entry.is_file() and entry.suffix == ".uproject":
74
+ return entry.resolve()
75
+
76
+ return None
77
+
78
+
58
79
  def find_parent_with_project_file(starting_path: Path, max_parents: int = 10) -> Optional[Path]:
59
80
  current_path = Path(starting_path).resolve()
60
81
 
@@ -65,12 +86,16 @@ def find_parent_with_project_file(starting_path: Path, max_parents: int = 10) ->
65
86
  if file.is_file() and file.suffix == ".uproject":
66
87
  return file.resolve()
67
88
 
89
+ build_version_path = path / "Engine" / "Build" / "Build.version"
90
+ if build_version_path.is_file():
91
+ return find_uproject_in_subfolders(path)
92
+
68
93
  return None
69
94
 
70
95
 
71
96
  def resolve_project(uproject_path: Optional[Path] = None) -> Project:
72
97
  if not uproject_path:
73
- dir_path = Path(os.path.dirname(os.path.realpath(__file__)))
98
+ dir_path = Path.cwd()
74
99
  uproject_path = find_parent_with_project_file(dir_path)
75
100
  if not uproject_path:
76
101
  raise Exception(f"Could not find a uproject file from {dir_path}")
@@ -0,0 +1,50 @@
1
+ import subprocess
2
+ import sys
3
+ from typing import Any
4
+
5
+ from uepyscripts import logger
6
+
7
+
8
+ def run_subprocess(cmd: list[str], log_output: bool = True) -> int:
9
+ """Run a subprocess with the given command and return its exit code (or 0 if fire-and-forget)."""
10
+ kwargs: dict[str, Any] = {}
11
+ creationflags = 0
12
+
13
+ if sys.platform == "win32":
14
+ creationflags = subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.CREATE_NO_WINDOW
15
+ startupinfo = subprocess.STARTUPINFO()
16
+ startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
17
+ startupinfo.wShowWindow = subprocess.SW_HIDE
18
+ kwargs["startupinfo"] = startupinfo
19
+ else:
20
+ kwargs["start_new_session"] = True
21
+
22
+ if log_output:
23
+ process = subprocess.Popen(
24
+ cmd,
25
+ stdout=subprocess.PIPE,
26
+ stderr=subprocess.STDOUT,
27
+ text=True,
28
+ bufsize=1,
29
+ creationflags=creationflags,
30
+ **kwargs,
31
+ )
32
+
33
+ assert process.stdout is not None
34
+ for line in process.stdout:
35
+ line = line.strip()
36
+ if line:
37
+ logger.info(line)
38
+
39
+ process.wait()
40
+ return process.returncode
41
+ else:
42
+ subprocess.Popen(
43
+ cmd,
44
+ stdout=subprocess.DEVNULL,
45
+ stderr=subprocess.DEVNULL,
46
+ stdin=subprocess.DEVNULL,
47
+ creationflags=creationflags,
48
+ **kwargs,
49
+ )
50
+ return 0
@@ -63,9 +63,9 @@ class TaskList:
63
63
 
64
64
  class EngineInstaller:
65
65
  def __init__(self, project: Project, unattended: bool = False) -> None:
66
+ self.project = project
66
67
  self.check_requirements()
67
68
 
68
- self.project = project
69
69
  try:
70
70
  self.engine_destination_folder = resolve_engine_destination(project)
71
71
  except FileNotFoundError as e:
@@ -95,6 +95,9 @@ class EngineInstaller:
95
95
  if not is_7z_installed():
96
96
  raise RuntimeError("7-Zip is not installed or not found in PATH. Please install 7-Zip to proceed.")
97
97
 
98
+ if self.project.is_native_project:
99
+ raise RuntimeError("A native project should be in the same folder than its engine")
100
+
98
101
  def get_project_platforms(self) -> List[str]:
99
102
  platforms: str = self.config["EngineUpdate.TurnKey"]["Platforms"]
100
103
  return platforms.split("+")
@@ -1,23 +0,0 @@
1
- import subprocess
2
-
3
- from uepyscripts import logger
4
-
5
-
6
- def run_subprocess(cmd: list[str], log_output: bool = True) -> int:
7
- """Run a subprocess with the given command and return the Popen object."""
8
- if log_output:
9
- process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, text=True, bufsize=1, universal_newlines=True)
10
-
11
- assert process.stdout is not None
12
- assert process.stderr is not None
13
-
14
- for line in process.stdout:
15
- line = line.strip()
16
- if line:
17
- logger.info(line)
18
-
19
- process.wait()
20
- return process.returncode
21
- else:
22
- subprocess.Popen(cmd, stdout=subprocess.PIPE)
23
- return 0
File without changes
File without changes
File without changes
File without changes