UEPyScripts 1.2.3__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.
Files changed (31) hide show
  1. uepyscripts-1.2.3/.gitignore +173 -0
  2. uepyscripts-1.2.3/LICENSE +21 -0
  3. uepyscripts-1.2.3/PKG-INFO +292 -0
  4. uepyscripts-1.2.3/README.md +212 -0
  5. uepyscripts-1.2.3/pyproject.toml +163 -0
  6. uepyscripts-1.2.3/src/uepyscripts/__init__.py +13 -0
  7. uepyscripts-1.2.3/src/uepyscripts/context/__init__.py +7 -0
  8. uepyscripts-1.2.3/src/uepyscripts/internal/__init__.py +0 -0
  9. uepyscripts-1.2.3/src/uepyscripts/internal/config.py +33 -0
  10. uepyscripts-1.2.3/src/uepyscripts/internal/engine.py +108 -0
  11. uepyscripts-1.2.3/src/uepyscripts/internal/engine_resolver.py +103 -0
  12. uepyscripts-1.2.3/src/uepyscripts/internal/project.py +81 -0
  13. uepyscripts-1.2.3/src/uepyscripts/run/__init__.py +0 -0
  14. uepyscripts-1.2.3/src/uepyscripts/run/buildgraph.py +99 -0
  15. uepyscripts-1.2.3/src/uepyscripts/run/uat.py +18 -0
  16. uepyscripts-1.2.3/src/uepyscripts/run/ubt.py +18 -0
  17. uepyscripts-1.2.3/src/uepyscripts/tools/__init__.py +0 -0
  18. uepyscripts-1.2.3/src/uepyscripts/tools/ci/buildgraph.py +134 -0
  19. uepyscripts-1.2.3/src/uepyscripts/tools/ci/cleanup.py +37 -0
  20. uepyscripts-1.2.3/src/uepyscripts/tools/helpers.py +185 -0
  21. uepyscripts-1.2.3/src/uepyscripts/tools/subprocess.py +23 -0
  22. uepyscripts-1.2.3/src/uepyscripts/tools/ue/__init__.py +0 -0
  23. uepyscripts-1.2.3/src/uepyscripts/tools/ue/check_engine_installation.py +66 -0
  24. uepyscripts-1.2.3/src/uepyscripts/tools/ue/close_editor.py +20 -0
  25. uepyscripts-1.2.3/src/uepyscripts/tools/ue/compile_editor.py +27 -0
  26. uepyscripts-1.2.3/src/uepyscripts/tools/ue/engine_installation/engine_destination.py +19 -0
  27. uepyscripts-1.2.3/src/uepyscripts/tools/ue/engine_installation/engine_installer.py +152 -0
  28. uepyscripts-1.2.3/src/uepyscripts/tools/ue/engine_installation/engine_source.py +182 -0
  29. uepyscripts-1.2.3/src/uepyscripts/tools/ue/generate_solution.py +13 -0
  30. uepyscripts-1.2.3/src/uepyscripts/tools/ue/run_editor.py +14 -0
  31. uepyscripts-1.2.3/src/uepyscripts/tools/winreg.py +32 -0
@@ -0,0 +1,173 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # PyPI configuration file
171
+ .pypirc
172
+
173
+ .vscode/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Michael Delva
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,292 @@
1
+ Metadata-Version: 2.4
2
+ Name: UEPyScripts
3
+ Version: 1.2.3
4
+ Summary: Collection of Python tools and helpers designed to automate common Unreal Engine project tasks (builds, packaging, editor control, CI tasks, etc.).
5
+ Project-URL: Changelog, https://github.com/TheEmidee/UEPyScripts/releases
6
+ Project-URL: Homepage, https://github.com/TheEmidee/UEPyScripts
7
+ Project-URL: Source, https://github.com/TheEmidee/UEPyScripts
8
+ Project-URL: Tracker, https://github.com/TheEmidee/UEPyScripts/issues
9
+ Author-email: Michael Delva <michael@emidee.net>
10
+ Maintainer-email: Michael Delva <michael@emidee.net>
11
+ License: MIT License
12
+
13
+ Copyright (c) 2025 Michael Delva
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+ License-File: LICENSE
33
+ Keywords: unreal engine
34
+ Classifier: Development Status :: 5 - Production/Stable
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: Operating System :: Microsoft :: Windows
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Topic :: Software Development :: Libraries
39
+ Classifier: Topic :: Utilities
40
+ Requires-Python: >=3.11
41
+ Requires-Dist: annotated-types
42
+ Requires-Dist: colorama
43
+ Requires-Dist: gamedevtools
44
+ Requires-Dist: invoke
45
+ Requires-Dist: jmespath
46
+ Requires-Dist: markupsafe
47
+ Requires-Dist: packaging
48
+ Requires-Dist: psutil
49
+ Requires-Dist: pydantic
50
+ Requires-Dist: pydantic-core
51
+ Requires-Dist: python-dateutil
52
+ Requires-Dist: pyyaml
53
+ Requires-Dist: s3transfer
54
+ Requires-Dist: six
55
+ Requires-Dist: types-colorama
56
+ Requires-Dist: types-invoke
57
+ Requires-Dist: types-psutil
58
+ Requires-Dist: types-requests
59
+ Requires-Dist: typing-extensions
60
+ Requires-Dist: typing-inspection
61
+ Requires-Dist: urllib3
62
+ Provides-Extra: dev
63
+ Requires-Dist: build; extra == 'dev'
64
+ Requires-Dist: hatchling; extra == 'dev'
65
+ Requires-Dist: mypy; extra == 'dev'
66
+ Requires-Dist: ruff; extra == 'dev'
67
+ Requires-Dist: towncrier; extra == 'dev'
68
+ Requires-Dist: twine; extra == 'dev'
69
+ Requires-Dist: wheel; extra == 'dev'
70
+ Provides-Extra: dist
71
+ Requires-Dist: build; extra == 'dist'
72
+ Requires-Dist: hatchling; extra == 'dist'
73
+ Requires-Dist: towncrier; extra == 'dist'
74
+ Requires-Dist: twine; extra == 'dist'
75
+ Requires-Dist: wheel; extra == 'dist'
76
+ Provides-Extra: lint
77
+ Requires-Dist: mypy; extra == 'lint'
78
+ Requires-Dist: ruff; extra == 'lint'
79
+ Description-Content-Type: text/markdown
80
+
81
+ # UEPyScripts
82
+
83
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
84
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
85
+ [![Version](https://img.shields.io/badge/version-1.1.1-green.svg)](CHANGELOG.md)
86
+
87
+ ---
88
+
89
+ ## Overview โœ…
90
+
91
+ **UEPyScripts** is a collection of Python tools and PowerShell helpers designed to automate common Unreal Engine project tasks (builds, packaging, editor control, CI tasks, etc.).
92
+
93
+ ---
94
+
95
+ ## Table of Contents ๐Ÿ“š
96
+
97
+ - [Features](#features-)
98
+ - [Requirements](#requirements-)
99
+ - [Installation](#installation-)
100
+ - [Quick Start](#quick-start-)
101
+ - [Usage Examples](#usage-examples-)
102
+ - [Continuous Integration](#continuous-integration-)
103
+ - [Engine Installation](#engine-installation-)
104
+ - [Development & Testing](#development--testing-)
105
+ - [Contribution Guide](#contribution-guide-)
106
+ - [Support & Troubleshooting](#support--troubleshooting-)
107
+ - [License & Credits](#license--credits-)
108
+
109
+ ---
110
+
111
+ ## Features โœจ
112
+
113
+ - Multiple helper scripts:
114
+ - Engine Utilities
115
+ - ue-run-buildgraph
116
+ - ue-close-editor
117
+ - ue-compile-editor
118
+ - ue-run-editor
119
+ - ue-check-engine-installation
120
+ - Continuous Integration helpers:
121
+ - ue-ci-cleanup
122
+ - ue-ci-run-buildgraph
123
+
124
+ ---
125
+
126
+ ## Requirements โš™๏ธ
127
+
128
+ - Python 3.12 or newer
129
+ - Windows (primary target; other platforms may work)
130
+ - Unreal Engine (project-specific; config in `Config/`)
131
+
132
+ ---
133
+
134
+ ## Installation ๐Ÿ› ๏ธ
135
+
136
+ - The easy way is to use [UEPyScriptsBootstrap](https://github.com/TheEmidee/UEPyScriptsBootstrap)
137
+ - You can download the sources and put them directly in your project
138
+ - You can add as a submodule: `git submodule add git@github.com:TheEmidee/UEPyScripts Scripts/PyScripts`
139
+ - You can add as a python requirement:
140
+
141
+ - Create a file named `requirements.txt`
142
+ - Add `UEPyScripts>=1.2.1` in this file
143
+ - Activate a virtual environment : `python -m venv .venv` and `& ".\.venv\Scripts\Activate.ps1"`
144
+ - Upgrade pip : `python -m pip install --upgrade pip`
145
+ - Install the module : `pip install -r requirements --upgrade`
146
+
147
+ ## Usage Examples ๐Ÿ”ง
148
+
149
+ - Execute a buildgraph target
150
+
151
+ ```bash
152
+ ue-run-buildgraph.exe --target "Buildgraph Task Name" -set:Clean=True -set:Targets=MyGameClient+MyGameServer -set:TargetConfigurations=Development+Shipping
153
+ ```
154
+
155
+ - You can directly call `UAT` or `UBT`:
156
+
157
+ ```bash
158
+ ue-run-uat.exe turnkey
159
+ ```
160
+
161
+ - You can generate the visual studio solution:
162
+
163
+ ```bash
164
+ ue-generate-solution.exe
165
+ ```
166
+
167
+ - You can update your engine locally if it can't be found for your projectn (See below for more explanations):
168
+
169
+ ```bash
170
+ ue-check-engine-installation.exe
171
+ ```
172
+
173
+ ## Continuous Integration โš™๏ธ
174
+
175
+ This repository contains several modules that you can call from a continuous integration pipeline. We use Jenkins here but this should work for other tools.
176
+
177
+ All those modules are very opinionated and work with specific rules. This may lack a bit of flexibility, but this is the result of years of iterations, and it works for us.
178
+
179
+ Ideally you should be using https://github.com/TheEmidee/JenkinsFileGenerator to generate jenkinsfiles that would use the following modules.
180
+
181
+ - `uepyscripts.tools.ci.buildgraph` : This executes a buildgraph task. This module will call the internal `uepyscripts.run.buildgraph` but will inject all arguments that are required to execute a single node, using a shared storage folder to store the artifacts of the task. This basically allows to execute buildgraph tasks in parallel.
182
+ A typical usage of this module in a jenkins pipeline script would look like:
183
+
184
+ ```groovy
185
+ pwsh """
186
+ ."Scripts/Python/.venv/Scripts/ue-ci-run-buildgraph.exe" `
187
+ --target="${taskName}" `
188
+ --build_tag = "${BUILD_TAG}"
189
+ -set:Clean=True
190
+ -set:Targets=MyGameClient+MyGameServer
191
+ -set:TargetConfigurations=Development+Shipping
192
+ """
193
+ ```
194
+
195
+ You will have to uncomment or add the entry `BuildgraphSharedStoragePath` in your `config.ini` file in `Config/PyScripts`:
196
+
197
+ ```ini
198
+ [Jenkins]
199
+ ; Path to the shared storage directory
200
+ BuildgraphSharedStoragePath = \\nas\cache\UE-BuildGraph
201
+ ```
202
+
203
+ - `uepyscripts.tools.ci.cleanup` : This should be used when your pipeline ends, if you use `uepyscripts.tools.ci.buildgraph`. This will delete all the files that could have been created as part of the pipeline, in the shared storage folder.
204
+
205
+ ```groovy
206
+ stage( 'Cleanup' ) {
207
+ pwsh """
208
+ ."Scripts/Python/.venv/Scripts/ue-ci-cleanup.exe" --build_tag="${BUILD_TAG}"
209
+ """
210
+ }
211
+ ```
212
+
213
+ ## Engine installation ๐Ÿ› ๏ธ
214
+
215
+ You can use the module `uepyscripts.tools.ue.check_engine_installation` (or `ue-check-engine-installation`) to automatically install the engine version that your project requires.
216
+
217
+ The requirements for this to work are as follow:
218
+
219
+ - For now, it is not possible to install automatically engine versions from the Epic Games Launcher as it seems not possible to give arguments to EGS to do so
220
+ - You must use an installed build engine that you build from the engine sources from Perforce or Github
221
+ - The installed build engine must be zipped into a 7z archive (No sub-folders, the `Engine` folder must be at the the root of the archive)
222
+ - The archive name must match the `EngineAssociation` property of the `uproject` file. You can add additional version numbers at the end of the archive name. (For example if the `EngineAssociation` property is `UE-MyProject-5.2`, you can name your archive `UE-MyProject-5.2.7z`, or `UE-MyProject-5.2.1.297.7z` if you want to keep multiple versions of the engine)
223
+ - You must place your archives either on a shared local folder, or in an amazon S3 bucket (The engine archives must be placed in a folder named `Engine` at the root of the bucket)
224
+ - You must have installed 7-zip on your machine, and it must be accesible from the PATH
225
+
226
+ How the script works:
227
+
228
+ - It will try to resolve the project and the engine the project needs. If this succeeds, nothing has to be done, since the project can be open
229
+ - If the engine resolution fails, then an update is executed:
230
+ - Try to determine the folder where the engine must be installed by reading the environment variable `NODE_UE_ROOT`. If this environment variable exists and points to a valid folder, then this is used. Otherwise the script will prompt the user for a destination. (The environment variable is useful on build machines to allow unattended installations as part of the build pipeline)
231
+ - Choose a source for where to get the engine archives: You can configure which sources to use by updating the property `[EngineUpdate.Sources].Sources` in the `config.ini`. You can use `Local`, `AWS`, or both with `Local+AWS`.
232
+ - You can define where the `Local` source can fetch the archives by setting the property `[EngineUpdate.Source.Local].LocalFolder`.
233
+ - You can define the amazon S3 properties `AWS_SecretKey`, `AWS_AccessKey`, `AWS_BucketName` and `AWS_Region` under the category `EngineUpdate.Source.AWS`. Please note that the script will look for the engine archives in the folder `Engine` of the bucket.
234
+ - The script will try each source one at a time, and select the first source that it can reach, and that has an engine archive which has a valid name
235
+ - Create the destination folder if it does not exist, using the `EngineAssociation` property (So if the destination folder is `C:/UE` and the `EngineAssociation` is `UE-MyProject-5.2`, you will have a folder `C:/UE/UE-MyProject-5.2`)
236
+ - Copy the engine archive from the source to the destination folder
237
+ - Decompress the engine archive in-place in the destination folder (You would now have the folder `C:/UE/UE-MyProject-5.2/Engine`)
238
+ - Delete the engine archive
239
+ - Register the engine in the windows registry by creating a key named `UE-MyProject-5.2` at `HKCU\SOFTWARE\Epic Games\Unreal Engine\Builds` with the value `C:/UE/UE-MyProject-5.2/Engine`
240
+ - Update the SDKs you need to build the platforms of the project with turnkey. For this, you will have to list all the platforms in the config file by setting the property `[EngineUpdate.TurnKey]` with all the platform names, separated by `+`. Ex: `Platforms = Win64+PS5+Switch`. This will run the command `turnkey -command=VerifySdk -platform=PLATFORM -UpdateIfNeeded -unattended` for each platform.
241
+
242
+ ## Development & Testing ๐Ÿงช
243
+
244
+ - Install [Astral UV](https://docs.astral.sh/uv/)
245
+ - Setup dev environment and install dependencies:
246
+
247
+ ```powershell
248
+ .\setup-venv.ps1
249
+ ```
250
+
251
+ - Linting & formatting
252
+ - Use `uv run ruff check .` and `uv run ruff format .` Add checks to CI as required.
253
+ - Use `uv run mypy .`
254
+
255
+ To create a new release, you must be on the `develop` branch, and call `invoke create_release`
256
+
257
+ ---
258
+
259
+ ## Contribution Guide ๐Ÿค
260
+
261
+ We welcome contributions โ€” please follow these steps:
262
+
263
+ 1. Fork the repository
264
+ 2. Create a feature branch: `git checkout -b feature/your-change`
265
+ 4. Run lint locally
266
+ 5. Submit a pull request describing the change
267
+
268
+ ---
269
+
270
+ ## Support & Troubleshooting โ“
271
+
272
+ - Check `Config/` and `uepyscripts/internal/config.py` for project-specific settings.
273
+ - If `buildgraph` fails, ensure `Config/Project` has a valid `BuildgraphPath` and the UAT tool is accessible.
274
+ - When reporting issues, include:
275
+ - Python version
276
+ - Unreal Engine version
277
+ - Exact command and full logs
278
+
279
+ ---
280
+
281
+ ## License & Credits ๐Ÿ“
282
+
283
+ **License:** MIT โ€” see the [LICENSE](LICENSE) file.
284
+
285
+ **Maintainers:** Michael Delva and contributors (see `AUTHORS` or repository metadata).
286
+
287
+ **Changelog:** See [CHANGELOG.md](CHANGELOG.md)
288
+
289
+ ---
290
+
291
+ Made with โค๏ธ for Unreal Engine developers โ€” contributions and feedback are welcome! If this helped you, consider starring the repository. โญ
292
+
@@ -0,0 +1,212 @@
1
+ # UEPyScripts
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
5
+ [![Version](https://img.shields.io/badge/version-1.1.1-green.svg)](CHANGELOG.md)
6
+
7
+ ---
8
+
9
+ ## Overview โœ…
10
+
11
+ **UEPyScripts** is a collection of Python tools and PowerShell helpers designed to automate common Unreal Engine project tasks (builds, packaging, editor control, CI tasks, etc.).
12
+
13
+ ---
14
+
15
+ ## Table of Contents ๐Ÿ“š
16
+
17
+ - [Features](#features-)
18
+ - [Requirements](#requirements-)
19
+ - [Installation](#installation-)
20
+ - [Quick Start](#quick-start-)
21
+ - [Usage Examples](#usage-examples-)
22
+ - [Continuous Integration](#continuous-integration-)
23
+ - [Engine Installation](#engine-installation-)
24
+ - [Development & Testing](#development--testing-)
25
+ - [Contribution Guide](#contribution-guide-)
26
+ - [Support & Troubleshooting](#support--troubleshooting-)
27
+ - [License & Credits](#license--credits-)
28
+
29
+ ---
30
+
31
+ ## Features โœจ
32
+
33
+ - Multiple helper scripts:
34
+ - Engine Utilities
35
+ - ue-run-buildgraph
36
+ - ue-close-editor
37
+ - ue-compile-editor
38
+ - ue-run-editor
39
+ - ue-check-engine-installation
40
+ - Continuous Integration helpers:
41
+ - ue-ci-cleanup
42
+ - ue-ci-run-buildgraph
43
+
44
+ ---
45
+
46
+ ## Requirements โš™๏ธ
47
+
48
+ - Python 3.12 or newer
49
+ - Windows (primary target; other platforms may work)
50
+ - Unreal Engine (project-specific; config in `Config/`)
51
+
52
+ ---
53
+
54
+ ## Installation ๐Ÿ› ๏ธ
55
+
56
+ - The easy way is to use [UEPyScriptsBootstrap](https://github.com/TheEmidee/UEPyScriptsBootstrap)
57
+ - You can download the sources and put them directly in your project
58
+ - You can add as a submodule: `git submodule add git@github.com:TheEmidee/UEPyScripts Scripts/PyScripts`
59
+ - You can add as a python requirement:
60
+
61
+ - Create a file named `requirements.txt`
62
+ - Add `UEPyScripts>=1.2.1` in this file
63
+ - Activate a virtual environment : `python -m venv .venv` and `& ".\.venv\Scripts\Activate.ps1"`
64
+ - Upgrade pip : `python -m pip install --upgrade pip`
65
+ - Install the module : `pip install -r requirements --upgrade`
66
+
67
+ ## Usage Examples ๐Ÿ”ง
68
+
69
+ - Execute a buildgraph target
70
+
71
+ ```bash
72
+ ue-run-buildgraph.exe --target "Buildgraph Task Name" -set:Clean=True -set:Targets=MyGameClient+MyGameServer -set:TargetConfigurations=Development+Shipping
73
+ ```
74
+
75
+ - You can directly call `UAT` or `UBT`:
76
+
77
+ ```bash
78
+ ue-run-uat.exe turnkey
79
+ ```
80
+
81
+ - You can generate the visual studio solution:
82
+
83
+ ```bash
84
+ ue-generate-solution.exe
85
+ ```
86
+
87
+ - You can update your engine locally if it can't be found for your projectn (See below for more explanations):
88
+
89
+ ```bash
90
+ ue-check-engine-installation.exe
91
+ ```
92
+
93
+ ## Continuous Integration โš™๏ธ
94
+
95
+ This repository contains several modules that you can call from a continuous integration pipeline. We use Jenkins here but this should work for other tools.
96
+
97
+ All those modules are very opinionated and work with specific rules. This may lack a bit of flexibility, but this is the result of years of iterations, and it works for us.
98
+
99
+ Ideally you should be using https://github.com/TheEmidee/JenkinsFileGenerator to generate jenkinsfiles that would use the following modules.
100
+
101
+ - `uepyscripts.tools.ci.buildgraph` : This executes a buildgraph task. This module will call the internal `uepyscripts.run.buildgraph` but will inject all arguments that are required to execute a single node, using a shared storage folder to store the artifacts of the task. This basically allows to execute buildgraph tasks in parallel.
102
+ A typical usage of this module in a jenkins pipeline script would look like:
103
+
104
+ ```groovy
105
+ pwsh """
106
+ ."Scripts/Python/.venv/Scripts/ue-ci-run-buildgraph.exe" `
107
+ --target="${taskName}" `
108
+ --build_tag = "${BUILD_TAG}"
109
+ -set:Clean=True
110
+ -set:Targets=MyGameClient+MyGameServer
111
+ -set:TargetConfigurations=Development+Shipping
112
+ """
113
+ ```
114
+
115
+ You will have to uncomment or add the entry `BuildgraphSharedStoragePath` in your `config.ini` file in `Config/PyScripts`:
116
+
117
+ ```ini
118
+ [Jenkins]
119
+ ; Path to the shared storage directory
120
+ BuildgraphSharedStoragePath = \\nas\cache\UE-BuildGraph
121
+ ```
122
+
123
+ - `uepyscripts.tools.ci.cleanup` : This should be used when your pipeline ends, if you use `uepyscripts.tools.ci.buildgraph`. This will delete all the files that could have been created as part of the pipeline, in the shared storage folder.
124
+
125
+ ```groovy
126
+ stage( 'Cleanup' ) {
127
+ pwsh """
128
+ ."Scripts/Python/.venv/Scripts/ue-ci-cleanup.exe" --build_tag="${BUILD_TAG}"
129
+ """
130
+ }
131
+ ```
132
+
133
+ ## Engine installation ๐Ÿ› ๏ธ
134
+
135
+ You can use the module `uepyscripts.tools.ue.check_engine_installation` (or `ue-check-engine-installation`) to automatically install the engine version that your project requires.
136
+
137
+ The requirements for this to work are as follow:
138
+
139
+ - For now, it is not possible to install automatically engine versions from the Epic Games Launcher as it seems not possible to give arguments to EGS to do so
140
+ - You must use an installed build engine that you build from the engine sources from Perforce or Github
141
+ - The installed build engine must be zipped into a 7z archive (No sub-folders, the `Engine` folder must be at the the root of the archive)
142
+ - The archive name must match the `EngineAssociation` property of the `uproject` file. You can add additional version numbers at the end of the archive name. (For example if the `EngineAssociation` property is `UE-MyProject-5.2`, you can name your archive `UE-MyProject-5.2.7z`, or `UE-MyProject-5.2.1.297.7z` if you want to keep multiple versions of the engine)
143
+ - You must place your archives either on a shared local folder, or in an amazon S3 bucket (The engine archives must be placed in a folder named `Engine` at the root of the bucket)
144
+ - You must have installed 7-zip on your machine, and it must be accesible from the PATH
145
+
146
+ How the script works:
147
+
148
+ - It will try to resolve the project and the engine the project needs. If this succeeds, nothing has to be done, since the project can be open
149
+ - If the engine resolution fails, then an update is executed:
150
+ - Try to determine the folder where the engine must be installed by reading the environment variable `NODE_UE_ROOT`. If this environment variable exists and points to a valid folder, then this is used. Otherwise the script will prompt the user for a destination. (The environment variable is useful on build machines to allow unattended installations as part of the build pipeline)
151
+ - Choose a source for where to get the engine archives: You can configure which sources to use by updating the property `[EngineUpdate.Sources].Sources` in the `config.ini`. You can use `Local`, `AWS`, or both with `Local+AWS`.
152
+ - You can define where the `Local` source can fetch the archives by setting the property `[EngineUpdate.Source.Local].LocalFolder`.
153
+ - You can define the amazon S3 properties `AWS_SecretKey`, `AWS_AccessKey`, `AWS_BucketName` and `AWS_Region` under the category `EngineUpdate.Source.AWS`. Please note that the script will look for the engine archives in the folder `Engine` of the bucket.
154
+ - The script will try each source one at a time, and select the first source that it can reach, and that has an engine archive which has a valid name
155
+ - Create the destination folder if it does not exist, using the `EngineAssociation` property (So if the destination folder is `C:/UE` and the `EngineAssociation` is `UE-MyProject-5.2`, you will have a folder `C:/UE/UE-MyProject-5.2`)
156
+ - Copy the engine archive from the source to the destination folder
157
+ - Decompress the engine archive in-place in the destination folder (You would now have the folder `C:/UE/UE-MyProject-5.2/Engine`)
158
+ - Delete the engine archive
159
+ - Register the engine in the windows registry by creating a key named `UE-MyProject-5.2` at `HKCU\SOFTWARE\Epic Games\Unreal Engine\Builds` with the value `C:/UE/UE-MyProject-5.2/Engine`
160
+ - Update the SDKs you need to build the platforms of the project with turnkey. For this, you will have to list all the platforms in the config file by setting the property `[EngineUpdate.TurnKey]` with all the platform names, separated by `+`. Ex: `Platforms = Win64+PS5+Switch`. This will run the command `turnkey -command=VerifySdk -platform=PLATFORM -UpdateIfNeeded -unattended` for each platform.
161
+
162
+ ## Development & Testing ๐Ÿงช
163
+
164
+ - Install [Astral UV](https://docs.astral.sh/uv/)
165
+ - Setup dev environment and install dependencies:
166
+
167
+ ```powershell
168
+ .\setup-venv.ps1
169
+ ```
170
+
171
+ - Linting & formatting
172
+ - Use `uv run ruff check .` and `uv run ruff format .` Add checks to CI as required.
173
+ - Use `uv run mypy .`
174
+
175
+ To create a new release, you must be on the `develop` branch, and call `invoke create_release`
176
+
177
+ ---
178
+
179
+ ## Contribution Guide ๐Ÿค
180
+
181
+ We welcome contributions โ€” please follow these steps:
182
+
183
+ 1. Fork the repository
184
+ 2. Create a feature branch: `git checkout -b feature/your-change`
185
+ 4. Run lint locally
186
+ 5. Submit a pull request describing the change
187
+
188
+ ---
189
+
190
+ ## Support & Troubleshooting โ“
191
+
192
+ - Check `Config/` and `uepyscripts/internal/config.py` for project-specific settings.
193
+ - If `buildgraph` fails, ensure `Config/Project` has a valid `BuildgraphPath` and the UAT tool is accessible.
194
+ - When reporting issues, include:
195
+ - Python version
196
+ - Unreal Engine version
197
+ - Exact command and full logs
198
+
199
+ ---
200
+
201
+ ## License & Credits ๐Ÿ“
202
+
203
+ **License:** MIT โ€” see the [LICENSE](LICENSE) file.
204
+
205
+ **Maintainers:** Michael Delva and contributors (see `AUTHORS` or repository metadata).
206
+
207
+ **Changelog:** See [CHANGELOG.md](CHANGELOG.md)
208
+
209
+ ---
210
+
211
+ Made with โค๏ธ for Unreal Engine developers โ€” contributions and feedback are welcome! If this helped you, consider starring the repository. โญ
212
+