Pip Potter 10e54cc169 [AWSCore Resource Mapping] Fix broken links, test level and tether tool lifetime to Editor (#15011) | 1 year ago | |
---|---|---|
.. | ||
controller | 3 years ago | |
manager | 3 years ago | |
model | 1 year ago | |
multithread | 3 years ago | |
style | 3 years ago | |
tests | 2 years ago | |
utils | 2 years ago | |
view | 3 years ago | |
.gitignore | 2 years ago | |
README.md | 2 years ago | |
requirements.txt | 2 years ago | |
resource_mapping_tool.py | 2 years ago |
The Resource Mapping Tool uses boto3 to interact with aws services:
Or follow AWS CLI configuration directions which can be reused by the boto3 lib:
In order to use the Open 3D Engine's python environment, this tool requires linking the Qt binaries. Follow cmake instructions to configure your project, for example:
$ cmake -B <BUILD_FOLDER> -S . -G "Visual Studio 16 2019" -DLY_PROJECTS=<PROJECT_NAME>
At this point, double check that the Open 3D Engine's python environment gets set up under /python/runtime directory
Build the project with the AWSCore.Editor (or AWSCore.ResourceMappingTool, or Editor) target to generate the required Qt binaries.
$ cmake --build <BUILD_FOLDER> --target AWSCore.Editor --config <CONFIG> /m
$ cmake --build <BUILD_FOLDER> --target AWSCore.Editor --config <CONFIG> -j <NUM_JOBS>
At this point, double check the Qt binaries have been generated under /bin//AWSCoreEditorQtBin directory
Launch the Resource Mapping Tool from the engine root folder:
$ python\python.cmd Gems\AWSCore\Code\Tools\ResourceMappingTool\resource_mapping_tool.py --binaries-path <PATH_TO_BUILD_FOLDER>\bin\profile\AWSCoreEditorQtBin
$ python\python.cmd debug Gems\AWSCore\Code\Tools\ResourceMappingTool\resource_mapping_tool.py --binaries-path <PATH_TO_BUILD_FOLDER>\bin\debug\AWSCoreEditorQtBin
$ python/python.sh Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py --binaries-path <PATH_TO_BUILD_FOLDER>/bin/profile/AWSCoreEditorQtBin
$ python/python.sh Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py --binaries-path <PATH_TO_BUILD_FOLDER>/bin/debug/AWSCoreEditorQtBin
This project is set up like a standard Python project. The initialization
process also creates a virtualenv within this project, stored under the .env
directory. To create the virtualenv it assumes that there is a python3
(or python
for Windows) executable in your path with access to the venv
package. If for any reason the automatic creation of the virtualenv fails,
you can create the virtualenv manually.
To manually create a virtualenv:
$ python -m venv .env
$ python3 -m venv .env
Once the virtualenv is created, you can use the following step to activate your virtualenv:
% .env\Scripts\activate.bat
$ source .env/bin/activate
Once the virtualenv is activated, you can install the required dependencies:
$ pip install -r requirements.txt
$ pip3 install -r requirements.txt
At this point you can launch tool like other standard python project.
$ python resource_mapping_tool.py
Mac or Linux
$ python3 resource_mapping_tool.py
--binaries-path
[Optional] Path to QT Binaries necessary for PySide,
required if launching tool with engine python environment.
--config-path
[Optional] Path to resource mapping config directory,
if not provided tool will use current directory.
--debug
[Optional] Execute on debug mode to enable DEBUG logging level.
--log-path
[Optional] Path to Resource Mapping Tool logging directory,
if not provided tool will store logging under tool source code directory.
--profile
[Optional] Named AWS profile to use for querying AWS resources,
if not provided tool will use `default` aws profile.
How to run the unit tests for the project:
pytest
to run one or more tests (command paths formatted as if run from this directory):
python -m pytest -vv .
python -m pytest tests\unit\model\test_basic_resource_attributes.py