### Install bleeding-rez and Bind Rez Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Install the bleeding-rez package and perform a quickstart bind for Rez. This is the initial setup step. ```bash pip install bleeding-rez rez bind --quickstart rez --version ``` -------------------------------- ### Install Allzpark and Dependencies Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/quickstart.md Installs Allzpark and Rez using pip and then runs the rez bind quickstart command. ```bash python -m pip install allzpark --upgrade rez bind --quickstart allzpark --demo --clean ``` -------------------------------- ### Build and Run Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Build and install your package using 'rez build --install --clean', then run it with 'allzpark --demo'. Ensure the package version is incremented for new installations. ```bash cd kingkong rez build --install --clean allzpark --demo ``` -------------------------------- ### Build and Install a Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Commands to build and install the current package, and then enter its Rez environment. ```powershell rez build --install $ rez env spiderman > $ ``` -------------------------------- ### Build and Install Kingkong Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Navigate to the package directory, build it, and install it using Rez. Then, launch Allzpark in demo mode. ```bash cd kingkong rez build --install allzpark --demo ``` -------------------------------- ### Clone and Run Allzpark Demo Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/contributing.md Clone the Allzpark repository and run the demo to get started. ```bash git clone https://github.com/mottosso/allzpark.git cd allzpark python -m allzpark --demo ``` -------------------------------- ### Build and Install Rez Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Build and install the Rez package from the command line. Ensure you are in the package directory. ```bash cd kingkong rez build --install --clean ``` -------------------------------- ### Install rez-scoopz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Clone the rez-scoopz repository, navigate into it, and build and install the package. ```bash git clone https://github.com/mottosso/rez-scoopz.git cd rez-scoopz rez build --install ``` -------------------------------- ### Install Avalon Demo Project and Launch Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/avalon.md Clones the bleed project, builds and installs it, saves the Avalon inventory, and then launches Allzpark with the demo. ```bash # Install Avalon demo project git clone https://github.com/mottosso/bleed.git cd bleed rez build --install python -m avalon.inventory --save # Launch! allzpark --demo ``` -------------------------------- ### Install Pip using get-pip.py Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/quickstart.md Installs pip if it is not already available on your system. This is a prerequisite for installing Allzpark via pip. ```bash curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py ``` -------------------------------- ### Create and Install a Basic Rez Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md This snippet demonstrates the shortest way to create a new Rez package from scratch and install it. It's useful for quickly setting up a new project or testing Rez functionality. ```powershell mkdir mypackage # Name of your Git project cd mypackage # Rez definition @" name = "mypackage" # Rez package name version = "1.0" # Rez package version build_command = False # Called when building package "@ | Add-Content package.py rez build --install # Build package rez env mypackage # Use package > # A new environment with your package ``` ```bash mkdir mypackage # Name of your Git project cd mypackage # Rez definition echo name = "mypackage" >> package.py # Rez package name echo version = "1.0" >> package.py # Rez package version echo build_command = False >> package.py # Called when building package rez build --install # Build package rez env mypackage # Use package > # A new environment with your package ``` -------------------------------- ### Build and Install Package Locally Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/workflow.md Use this command during development to build and install a package into your local Rez environment. This operation overwrites existing installations, allowing for rapid iteration. ```bash cd my_package rez build --install ``` -------------------------------- ### Install Rez-pipz and Dependencies Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/avalon.md Clones the rez-pipz repository, builds and installs it, then uses rez-pipz to install Avalon core, colorbleed, and PyQt5. ```bash # Convert PyPI packages to Rez git clone https://github.com/mottosso/rez-pipz.git cd rez-pipz rez build --install cd .. # Install PyPI dependencies rez env pipz -- install avalon-core avalon-colorbleed rez env pipz -- install pyqt5==5.8 # Any PyQt5 would do, this one requires Python 3 ``` -------------------------------- ### Clone and Install Allzpark Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Clone the Allzpark repository and install it as a Rez package using rez-pipz. This is for installing from a local repository. ```powershell git clone https://github.com/mottosso/allzpark.git rez env pipz -- install ./allzpark ``` -------------------------------- ### Install Allzpark Source: https://github.com/mottosso/allzpark/blob/master/README.md Install Allzpark using pip. This is the primary method for obtaining the application. ```bash pip install allzpark ``` -------------------------------- ### Install Dependencies and Serve Docs (Bash with Rez) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/contributing.md Use this snippet to install documentation dependencies using Rez and serve the documentation locally. This command specifies required packages for the Rez environment. ```bash cd allzpark/docs rez env pipz -- install -r requirements.txt rez env git python mkdocs_material-4.4.0 mkdocs_git_revision_date_plugin==0.1.5 -- mkdocs serve ``` -------------------------------- ### Create and Install King Kong Profile (Bash) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Create a directory for the 'kingkong' profile, define its package.py using echo, and build/install it using 'rez build --install'. ```bash mkdir ~/kingkong cd ~/kingkong echo name = "kingkong" >> package.py echo version = "1.0.0" >> package.py echo build_command = False >> package.py rez build --install ``` -------------------------------- ### Install Dependencies and Serve Docs (PowerShell with Pipz) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/contributing.md Use this snippet to install documentation dependencies using Pipz and serve the documentation locally. Ensure you are in the docs directory. ```powershell cd allzpark\docs rez env pipz -- install -r requirements.txt . serve.ps1 ``` -------------------------------- ### Build and Environment Resolution Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Demonstrates building a package with '--install' and then entering its environment to verify resolution. Shows implicit and explicit package resolutions. ```bash rez build --install rez env mypackage2 # resolved by manima@toy, on Thu Jun 27 11:12:18 2019, using Rez v2.32.1 # # requested packages: # mypackage2 # ~platform==windows (implicit) # ~arch==AMD64 (implicit) # ~os==windows-10.0.18362.SP0 (implicit) # # resolved packages: # arch-AMD64 C:\Users\manima\packages\arch\AMD64 (local) # mypackage-1.3 C:\Users\manima\packages\mypackage\1.3 (local) # mypackage2-1.0 C:\Users\manima\packages\mypackage2\1.0 (local) # platform-windows C:\Users\manima\packages\platform\windows (local) # python-3.7.3 C:\Users\manima\packages\python\3.7.3\platform-windows\arch-AMD64 (local) > ``` -------------------------------- ### Build and Run Payload Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Demonstrates building a package with '--install' and then entering its environment to run a module from the payload. ```bash rez build --install rez env mypackage > python -m mymodule # Hello World! ``` -------------------------------- ### Start Notepad Process and Inspect its Properties in PowerShell Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/shells.md Illustrates starting a process (notepad) and then inspecting its properties and methods using `Get-Member`, similar to Python's `dir()`. ```powershell PS> $notepad = start-process notepad -passthru PS> $notepad | get-member # TypeName: System.Diagnostics.Process # # Name MemberType Definition # ---- ---------- ---------- # ... # Name AliasProperty Name = ProcessName # Company ScriptProperty System.Object Company # {get=$this.Mainmodule.FileVersionInfo.CompanyName;} # ... # Path ScriptProperty System.Object Path {get=$this.Mainmodule.FileName;} # WorkingSet Property int WorkingSet {get;} # Kill Method void Kill() # Refresh Method void Refresh() # Start Method bool Start() # ToString Method string ToString() # ... PS> $notepad.company # Microsoft Corporation ``` -------------------------------- ### Custom Installation Script Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Use install.py to copy package resources to the build and installation directories. This script is executed during the 'rez build' process. ```python # This script is called on `rez build` import os import shutil print("Running install.py...") root = os.path.dirname(__file__) build_dir = os.environ["REZ_BUILD_PATH"] install_dir = os.environ["REZ_BUILD_INSTALL_PATH"] print("Copying payload to %s.." % build_dir) shutil.copytree( os.path.join(root, "resources"), os.path.join(build_dir, "resources"), ignore=shutil.ignore_patterns("*.pyc", "__pycache__") ) if int(os.getenv("REZ_BUILD_INSTALL")): # This part is called with `rez build --install` print("Installing payload to %s..." % install_dir) shutil.copytree( os.path.join(build_dir, "resources"), os.path.join(install_dir, "resources"), ) ``` -------------------------------- ### Install Python using rez-scoopz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Use the 'scoopz' Rez environment to install the 'python' package. ```bash rez env scoopz -- install python ``` -------------------------------- ### Create and Install King Kong Profile (Powershell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Create a directory for the 'kingkong' profile, define its package.py, and build/install it using 'rez build --install'. ```powershell mkdir ~/kingkong cd ~/kingkong @" name = "kingkong" version = "1.0.0" build_command = False "@ | Add-Content package.py rez build --install ``` -------------------------------- ### Install bleeding-rez in a virtual environment Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Install Rez and bleeding-rez within a virtual environment to avoid permission issues or conflicts with system-wide installations. ```bash python -m pip install virtualenv python -m virtualenv rez-install rez-install\Scripts\activate pip install bleeding-rez ``` -------------------------------- ### Install Dependencies and Serve Docs (Bash System Python) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/contributing.md Use this snippet to install documentation dependencies into your system-wide Python environment and serve the documentation locally. Ensure you are in the docs directory. ```bash cd allzpark/docs pip install -r requirements.txt mkdocs serve ``` -------------------------------- ### Install Six Package with Rez-pipz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Install the 'six' Python package as a Rez package using rez-pipz. This is equivalent to running 'pip install six'. ```powershell rez env pipz -- install six -y ``` -------------------------------- ### Package Request Examples Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Demonstrates various ways to request packages with different version operators and naming conventions using the 'rez env' command. ```bash rez env my_package-1 # package `my_package`, version `1` or above rez env my-package-1 # package `my`, version `package-1` or above rez env my_package_1 # package `my_package_1`, latest version rez env my_package==1 # package `my_package_1`, version `1` exactly ``` -------------------------------- ### Build and Test Texteditor Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Build and install the texteditor package. Then, use 'rez env' to set up an environment with the package and its dependencies, and launch the texteditor command. ```bash cd texteditor rez build --install rez env texteditor --paths $(allzparkdemo --packages) > texteditor ``` -------------------------------- ### Install Allzpark in a Virtual Environment (Python 3) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/quickstart.md Installs Allzpark within a Python 3 virtual environment, which is useful if you lack admin privileges. ```bash python -m venv allzpark-venv allzpark-venv\Scripts\activate (allzpark-venv) $ pip install allzpark ``` -------------------------------- ### Example Implicit Packages Output Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Sample output from 'rez config implicit_packages', showing platform, architecture, and OS specific packages. ```bash rez config implicit_packages - ~platform==windows - ~arch==AMD64 - ~os==windows-10 ``` -------------------------------- ### List Installed Packages in Default Location Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Shows how to list packages installed in the default Rez packages directory using PowerShell or Bash. ```powershell ls $env:USERPROFILE/packages # With PowerShell ``` ```bash ls $HOME/packages # With Bash ``` -------------------------------- ### Build and Install a Specific Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Builds, installs, and cleans a specific package (e.g., 'alita') within a multi-project repository. This command is run from within the package's directory. ```bash cd alita rez build --install --release --clean ``` -------------------------------- ### Install Python package 'sqlalchemy' using rez-pipz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Use the 'pipz' Rez environment to install the 'sqlalchemy' Python package. ```bash rez env pipz -- install sqlalchemy ``` -------------------------------- ### Install Dependencies and Serve Docs (PowerShell System Python) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/contributing.md Use this snippet to install documentation dependencies into your system-wide Python environment and serve the documentation locally. Ensure you are in the docs directory. ```powershell cd allzpark\docs pip install -r requirements.txt mkdocs serve ``` -------------------------------- ### Running Initial Package Environment Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md This command demonstrates how to enter an environment with the 'spiderman' package installed using its initial strong references. Both 'maya' and 'texteditor' will be available in this environment. ```powershell $ rez env spiderman > $ maya > $ texteditor ``` -------------------------------- ### Install Allzpark in a Virtual Environment (Python 2) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/quickstart.md Installs Allzpark within a Python 2 virtual environment, useful for systems where Python 2 is still in use or required. ```bash python -m pip install virtualenv python -m virtualenv allzpark-venv allzpark-venv\Scripts\activate (allzpark-venv) $ pip install allzpark ``` -------------------------------- ### Install Scoop Packages with scoopz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Use scoopz to install packages available through Scoop within a Rez environment. ```powershell $ rez env scoopz -- install python python27 git ``` -------------------------------- ### Install Python package 'six' using rez-pipz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Use the 'pipz' Rez environment to install the 'six' Python package. ```bash rez env pipz -- install six ``` -------------------------------- ### Release Package Build and Install Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Builds and installs a package into the Rez package directory for release. This is typically used for deploying packages to a shared location. ```bash rez build --install --release ``` -------------------------------- ### Install PySide2 with Rez-pipz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Install the PySide2 Qt binding as a Rez package using rez-pipz. This is a required dependency for Allzpark. ```powershell rez env pipz -- install pyside2 -y ``` -------------------------------- ### Generic Rez Package Install Script Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Use this generic install script to build Rez packages. It defines package metadata, build commands, and environment requirements. ```python name = "kingkong" version = "1.0.5" build_command = "python -m rezutil build {root}" _data = { "label": "King Kong", "icon": "{root}/resources/icon.png", } requires = [ "python-2.7,<4", "rezutil-1", "~maya==2018.0.6", "~blender==2.80.0", "~texteditor==1.5.1", ] def commands(): global env env["PROJECT_ID"] = "12" env["PROJECT_NAME"] = "kingkong" env["PROJECT_FRAMERATE"] = "25" env["PROJECT_TAGS"] = "awesome,great,best" env["PYTHONPATH"].prepend("{root}/python") ``` -------------------------------- ### Define Package Requirements Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Example of a package.py file defining package name, version, build command, and dependencies. ```python name = "mypackage2" version = "1.0" build_command = False requires = ["python-3", "mypackage-1.2"] ``` -------------------------------- ### Set up Allzpark Environment Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md This command sets up a development environment with specified versions of Allzpark, PySide2, and Python. It's the starting point for using Allzpark tools. ```powershell rez env allzpark bleeding_rez-2.31+ pyside2 python-3 -- allzpark ``` -------------------------------- ### Launch allzpark with Localized PySide2 Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Launch the allzpark application with PySide2 and other dependencies. This example shows the initial load time before localization. ```powershell $ rez env pyside2 allzpark bleeding_rez -- python -m allzpark ============================== allzpark (1.1.79) ============================== - Loading Rez.. ok - 0.75s - Loading Qt.. ok - 6.14s - Loading allzpark.. ok - 0.53s - Loading preferences.. ok - 0.00s ------------------------------ ``` -------------------------------- ### Install Python Package with pipz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Use pipz to install a Python package from PyPI within a Rez environment. ```powershell $ rez env pipz -- install pyblish-base --release ``` -------------------------------- ### PATH Environment Variable Example Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/quickstart.md An example message indicating that the script directory is not on the system's PATH, which can prevent commands like 'allzpark' from being found. ```powershell The script allzpark.exe and azp.exe are installed in 'C:\Python37\Scripts' which is not on PATH Consider adding this directory to PATH ``` -------------------------------- ### Install bleeding-rez using Python module Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md If 'pip' is not found on your PATH, use this command to install bleeding-rez via the Python module. ```powershell python -m pip install bleeding-rez ``` -------------------------------- ### Clone and Install Rez-pipz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Clone the rez-pipz repository and install it as a Rez package. rez-pipz is a utility for integrating pip packages with Rez. ```powershell git clone https://github.com/mottosso/rez-pipz.git cd rez-pipz rez build --install ``` -------------------------------- ### Install Script for Package Payload Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Python script executed during 'rez build'. It copies payload files to the build directory and optionally to the install directory. ```python # This script is called on `rez build` import os import shutil print("Running install.py...") root = os.path.dirname(__file__) build_dir = os.environ["REZ_BUILD_PATH"] install_dir = os.environ["REZ_BUILD_INSTALL_PATH"] print("Copying payload to %s.." % build_dir) shutil.copytree( os.path.join(root, "python"), os.path.join(build_dir, "python"), ignore=shutil.ignore_patterns("*.pyc", "__pycache__") ) if int(os.getenv("REZ_BUILD_INSTALL")): # This part is called with `rez build --install` print("Installing payload to %s..." % install_dir) shutil.copytree( os.path.join(build_dir, "python"), os.path.join(install_dir, "python"), ) ``` -------------------------------- ### Implicit Packages Configuration Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Example of how to configure implicit packages in rezconfig.py, which are automatically included based on system properties. ```python implicit_packages = [ "~platform=={system.platform}", "~arch=={system.arch}", "~os=={system.os}", ] ``` -------------------------------- ### Check Git Version Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Verify that Git is installed on your system. Git is a prerequisite for cloning repositories. ```powershell git --version # git version 2.16.1 ``` -------------------------------- ### Update Install Script for Package Building Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md This script is executed during the 'rez build' process. It copies package files to the build directory and optionally to the install directory. ```python # This script is called on `rez build` import os import shutil print("Running install.py...") root = os.path.dirname(__file__) build_dir = os.environ["REZ_BUILD_PATH"] install_dir = os.environ["REZ_BUILD_INSTALL_PATH"] dirs = ["resources", "python"] print("Copying payload to %s.." % build_dir) for dirname in dirs: shutil.copytree( os.path.join(root, dirname), os.path.join(build_dir, dirname), ignore=shutil.ignore_patterns("*.pyc", "__pycache__") ) if int(os.getenv("REZ_BUILD_INSTALL")): # This part is called with `rez build --install` print("Installing payload to %s..." % install_dir) for dirname in dirs: shutil.copytree( os.path.join(build_dir, dirname), os.path.join(install_dir, dirname), ) ``` -------------------------------- ### Install Memcached on Raspberry Pi Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md This command installs the memcached package on a Raspberry Pi using apt-get. Memcached is recommended for improving Rez's performance by caching filesystem queries. ```bash apt-get install memcached ``` -------------------------------- ### Define Individual Project Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Example of a package.py file for an individual project within a multi-project repository. Sets name, version, and disables build command. ```python name = "alita" version = "1.0.0" build_command = False ``` -------------------------------- ### Set Environment Variable Example Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/shells.md Demonstrates how launching cmd with long environment variables works, but cmd.exe itself has issues with variables exceeding 2,000 characters. ```python import subprocess subprocess.Popen("cmd", env={"a": "really", "long": "environment"}) # Works ``` -------------------------------- ### Package Definition with Build Command and Payload Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Example package.py defining build command, dependencies, and environment variables for payload. The `commands` function adds the 'python' directory to PYTHONPATH. ```python name = "mypackage" version = "1.3" build_command = "python {root}/install.py" # Run this command on `rez build` requires = ["python-3"] def commands(): global env env["PYTHONPATH"].prepend("{root}/python") # Add payload to environment ``` -------------------------------- ### Running Python via Rez Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md This snippet demonstrates how to execute the 'python' command using Rez, which references a Python package without requiring a system-wide installation. ```bash rez env python > python ``` -------------------------------- ### Get Allzpark Version Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/contributing.md Retrieve the current version of Allzpark from the command line. ```bash python -m allzpark --version 1.3.5 ``` -------------------------------- ### Add Payload Files (Bash) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Use this snippet to add an install script and payload files to a package using Bash. ```bash cd mypackage touch install.py # Additional script for build mkdir python # Payload directory cd python # echo print("Hello World!") >> mymodule.py # Python payload shipped alongside package ``` -------------------------------- ### Set Up Project Directory (Bash) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/avalon.md Creates a projects directory and sets environment variables for Rez packages and profiles. ```bash mkdir ~/projects $REZ_PACKAGES_PATH=~/packages:$(allzparkdemo --packages) $MY_PROFILES=bleed ``` -------------------------------- ### Package Variants Example Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Defines package variants for different platforms. Ensure that resolved packages are available on all target platforms. ```python name = "processmanager" variants = [ ["platform-windows", "win32all"], ["platform-linux", "unix-process-tool"], ] ``` -------------------------------- ### Example of a Long File Path on Windows Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/windows.md Illustrates a common, lengthy file path encountered in Windows environments, highlighting the proximity to the 260-character limit. ```bash # Repository root \\mylongstudioaddress.local\main\common\utilities\packages\internal # Package \maya_essentials\1.42.5beta\platform-windows\arch-AMD64\os-windows-10.0.1803 # Payload \python\maya_essentials\utilities\__init__.py ``` -------------------------------- ### Get and Manipulate Firefox Process Information in PowerShell Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/shells.md Demonstrates how to retrieve process information like path and working set, and how to terminate a process using PowerShell objects. ```powershell PS> $fx = get-process -name firefox PS> $fx.path # C:\Program Files\Mozilla Firefox\firefox.exe PS> $fx.workingset / 1mb # 414.23828125 PS> $fx.kill() ``` -------------------------------- ### Run Memcached with Docker Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md This bash command starts a memcached instance using Docker, exposing it on the default port 11211. This is the simplest way to set up memcached for local or distributed use. ```bash docker run -ti --rm -p 11211:11211 memcached ``` -------------------------------- ### Set Up Project Directory (PowerShell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/avalon.md Creates a projects directory and maps it to the P: drive. Sets environment variables for Rez packages and profiles. ```powershell mkdir $env:USERPROFILE/projects subst P: $env:USERPROFILE/projects $env:REZ_PACKAGES_PATH="~/packages;$(allzparkdemo --packages)" $env:MY_PROFILES="bleed" ``` -------------------------------- ### Set MY_PROFILES and Run Demo (Bash) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Export the MY_PROFILES environment variable to make the new profile discoverable and run the Allzpark demo. ```bash export MY_PROFILES="kingkong" allzpark --demo ``` -------------------------------- ### Initialize Package and Commit to Git (Bash) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Initializes a new package directory, creates a package.py file, and sets up a Git repository with a remote URL using Bash. This is for version control. ```bash mkdir my_package cd my_package echo "name = "my_package"" >> package.py echo "version = "1.0.0"" >> package.py echo "build_command = False" >> package.py git init git add --all git commit -m "Initial version" git remote add-url https://gitlab.mycompany.com/username/my_package.git git push ``` -------------------------------- ### Set MY_PROFILES and Run Demo (Powershell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Set the MY_PROFILES environment variable to make the new profile discoverable and run the Allzpark demo. ```powershell $env:MY_PROFILES="kingkong" allzpark --demo ``` -------------------------------- ### Initialize Package and Commit to Git (PowerShell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Initializes a new package directory, creates a package.py file, and sets up a Git repository with a remote URL using PowerShell. This is for version control. ```powershell mkdir my_package cd my_package @" name = "my_package" version = "1.0.0" build_command = False "@ | Add-Content package.py git init git add --all git commit -m "Initial version" git remote add-url https://gitlab.mycompany.com/username/my_package.git git push ``` -------------------------------- ### Create Texteditor Application Package (Bash) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Create a directory for the texteditor application, define its package.py with name, version, and build command using Bash. ```bash mkdir ~/texteditor cd ~/texteditor echo name = "texteditor" >> package.py echo version = "1.5.0" >> package.py echo build_command = False >> package.py rez build --install ``` -------------------------------- ### Install Python package 'sqlalchemy' for Python 2 using rez-pipz Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Specify a Python version (e.g., python-2) in the Rez environment request to install 'sqlalchemy' for that specific Python version. ```bash rez env python-2 pipz -- install sqlalchemy ``` -------------------------------- ### Create a New Project Directory Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Use these commands to create a new project directory and an empty package file. ```powershell mkdir spiderman cd spiderman touch package.py ``` -------------------------------- ### Define Basic Package Information Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md This is the initial content for a package.py file, defining the package name, version, and build command. ```python name = "spiderman" version = "1.0" build_command = False ``` -------------------------------- ### Clone and Run Allzpark with Rez (PowerShell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/contributing.md Clone the Allzpark repository and set up the environment using Rez in PowerShell. ```powershell git clone https://github.com/mottosso/allzpark.git cd allzpark . env.ps1 > python -m allzpark ``` -------------------------------- ### Set Project Context and Launch Application Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/about.md Use this command to set the context to a specific project and then launch an application. The system resolves the correct version of the application based on the project's metadata. ```powershell go gravity maya ``` -------------------------------- ### Viewing Implicit Packages Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Command to display the currently configured implicit packages. ```bash rez config implicit_packages ``` -------------------------------- ### Launch Allzpark Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Launch Allzpark with its required dependencies (allzpark, python, pyside2) and specify the root directory for packages. ```powershell rez env allzpark python pyside2 -- allzpark --root ~/packages ``` -------------------------------- ### Deploy Documentation Source: https://github.com/mottosso/allzpark/blob/master/README.md Deploy the documentation by running the deploy.ps1 script from the docs directory. This script builds and deploys the docs to the gh-pages branch. ```bash cd allzpark\docs . deploy.ps1 ``` -------------------------------- ### Add Payload Files (Powershell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Use this snippet to add an install script and payload files to a package using Powershell. ```powershell cd mypackage $null >> install.py # Additional script for build mkdir python # Payload directory cd python # "print('Hello World!')" | Add-Content mymodule.py # Python payload shipped alongside package ``` -------------------------------- ### Define Package Metadata and Environment Variables Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Configure package name, version, build command, metadata, and required dependencies. Set environment variables like PROJECT_ID, PROJECT_NAME, and PYTHONPATH. ```python name = "kingkong" version = "1.0.5" build_command = "python {root}/install.py" _data = { "label": "King Kong", "icon": "{root}/resources/icon.png", } requires = [ "python-2.7,<4", "~maya==2018.0.6", "~blender==2.80.0", "~texteditor==1.5.1", ] def commands(): global env env["PROJECT_ID"] = "12" env["PROJECT_NAME"] = "kingkong" env["PROJECT_FRAMERATE"] = "25" env["PROJECT_TAGS"] = "awesome,great,best" env["PYTHONPATH"].prepend("{root}/python") ``` -------------------------------- ### Building and Testing Weak Reference Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md These commands show how to build the 'spiderman' package with weak references and then enter its environment. As expected, 'maya' is not automatically available. ```powershell ~/spiderman $ rez build --install ~/spiderman $ rez env spiderman > ~/spiderman $ maya # Unrecognised command ``` -------------------------------- ### Get Process Environment PATH Variable Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/shells.md Retrieves the PATH environment variable from the startup information of a running 'maya' process. ```powershell PS> $maya = get-process -name maya PS> $si = $maya.startupinfo PS> $si.environment["PATH"] C:\Program Files\Docker\Docker\Resources\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\WINDOWS\System32\OpenSSH\ ``` -------------------------------- ### Export and Import Context with RXT Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Demonstrates using `rez env --output context.rxt` to save a context and `rez env --input context.rxt` to load it on another machine. This method embeds absolute paths, which may not be valid on remote systems. ```bash rez env packageA packageB --output context.rxt # Machine A rez env --input context.rxt # Machine B ``` ```bash rez env packageA packageB > Get-Content $env:REZ_RXT_FILE > context.rxt > exit rez env --input context.rxt ``` -------------------------------- ### Create Maya Project Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Commands to create a new directory and package file for the 'maya' application. ```powershell > $ exit $ cd .. $ mkdir maya $ cd maya $ touch package.py ``` -------------------------------- ### Display All Packages (Bash) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Use this Bash command to display all available packages. This is useful for checking package availability. ```bash allzparkdemo --packages ``` -------------------------------- ### Commit Multiple Projects to Git Repository Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Initializes a Git repository, adds all project files, commits them with a message, sets the remote URL, and pushes to the GitLab instance. ```bash git init git add --all git commit -m "Initial version" git remote add-url https://gitlab.mycompany.com/username/my_projects.git git push ``` -------------------------------- ### Build and Release Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/workflow.md Execute this command to build and release a package to the release path. This is typically done when a version is stable and ready for wider distribution. The operation is destructive. ```bash cd my_package rez build --install --release ``` -------------------------------- ### Setting Environment Variables in package.py Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Example of how to define custom environment variables within a package's commands function, referencing existing environment variables. ```python # package.py name = "my_package" version = "1.0" requires = ["my_package-1.0"] def commands(): global env env["MY_VARIABLE"] = r"c:\\path\\{env.REZ_MY_PACKAGE_VERSION}\\scripts" ``` -------------------------------- ### Define build command and version in package.py Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Specifies the build command and the package version in the package.py file. ```python name = "my_library" version = "1.0" build_command = "python {root}/install.py" ``` -------------------------------- ### Create Texteditor Application Package (PowerShell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Create a directory for the texteditor application, define its package.py with name, version, and build command using PowerShell. ```powershell mkdir ~/texteditor cd ~/texteditor @" name = "texteditor" version = "1.5.0" build_command = False "@ | Add-Content package.py rez build --install ``` -------------------------------- ### Package Requirements Example Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md This snippet shows a typical package requirement declaration within a project. It specifies dependencies like Maya, Arnold, and CMuscle, allowing for version compatibility to be resolved. ```python requires = ["maya-2019", "arnold", "cmuscle"] ``` -------------------------------- ### Package Resolution Iterations Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Illustrates the step-by-step process of resolving package dependencies. Each iteration shows the expansion and potential adjustment of package versions to satisfy all requirements and constraints. ```powershell iteration 01 # maya-2019 arnold cmuscle iteration 02 # maya-2019.0.3 arnold-4.12 cmuscle-1.4 iteration 03 # maya-2019.0.3 arnold-4.12 cmuscle-1.4 libpng-12 libtiff-1 qt-5.12 iteration 04 # maya-2019.0.3 arnold-4.9 cmuscle-1.4 libpng-12 libtiff-1 qt-5.12 qtbase-5.12 qtgui-5-12 openiio-3.41 complete ``` -------------------------------- ### GitLab CI Configuration for Release Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Example GitLab CI configuration to release a package when a new tag is created. It sets the Rez configuration file and runs 'rez build --release'. ```yaml release: environment: - REZ_CONFIG_FILE=/packages/rezconfig.py script: - rez build --release only: - tags ``` -------------------------------- ### Set Environment Variable in Rez Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md This example shows how to set a custom environment variable within a Rez package. Use this when your package needs to expose specific configuration or data to its environment. ```python name = "mypackage" version = "1.1" build_command = False def commands(): global env # Global variable available to `commands()` env["MYVARIABLE"] = "Yes" ``` ```powershell rez build --install rez env mypackage > $env:MYVARIABLE # Yes ``` ```bash rez build --install rez env mypackage > echo $MYVARIABLE # Yes ``` -------------------------------- ### Clone and Run Allzpark Development Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/contributing.md Clone the Allzpark repository and run it from the Git repository for development. ```bash git clone https://github.com/mottosso/allzpark.git cd allzpark python -m allzpark ``` -------------------------------- ### Define package name and version in package.py Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Basic definition of a package's name and version in its package.py file. ```python name = "my_library" version = "1.0" ``` -------------------------------- ### Initialize package version to 'dev' Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Initializes the package version to 'dev' and attempts to import a '__version__' module for the actual version. ```python try: from . import __version__ version = __version__.version except ImportError: version = "dev" ``` -------------------------------- ### Create Package Directory (Bash) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Use this snippet to create a new package directory and an empty package file using Bash. ```bash cd mypackage cd .. mkdir mypackage2 touch mypackage2/package.py ``` -------------------------------- ### Display All Packages (PowerShell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Use this PowerShell command to display all available packages. This is useful for checking package availability. ```powershell start $(allzparkdemo --packages) ``` -------------------------------- ### Initial Package Definition with Strong References Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md This initial package definition for 'spiderman' includes 'maya' and 'texteditor' as strong requirements. This means they will always be included in the environment when 'spiderman' is requested, which can lead to conflicts if other dependencies have incompatible requirements. ```python name = "spiderman" version = "1.3" build_command = False requires = ["texteditor-1", "maya-2018"] def commands(): global env env["PROJECT_NAME"] = "Spiderman" ``` -------------------------------- ### Launch Maya 2018 and Maya 2019 Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Demonstrates launching Maya 2018 and Maya 2019 using their respective aliases after resolving the environment. ```bash $ rez env maya2018 maya2019 > $ maya2018 # Launching Maya 2018.. ``` -------------------------------- ### Initialize Python module version to '?' Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Initialize the version variable in a Python module to a placeholder '?' until it is explicitly set. ```python version = "?" ``` -------------------------------- ### Enable Graphviz for Allzpark Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Include the graphviz package in your Rez environment before launching Allzpark to enable graph drawing capabilities. ```powershell rez env graphviz pyside2 python-3 bleeding_rez -- python -m allzpark ``` -------------------------------- ### Building a Specific Variant Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Shows how to build a specific variant of a package using the 'rez build --variants' command, specifying the variant index. ```bash $ rez build --variants 0 ``` -------------------------------- ### Create Texteditor Package Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Commands to create a new directory and package file for the 'texteditor' dependency. ```powershell > $ exit $ cd .. $ mkdir texteditor $ cd texteditor $ touch package.py ``` -------------------------------- ### Define Package Structure Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md Illustrates the directory structure for a package, including resources and Python modules. ```text kingkong/ resources/ icon.png python/ kingkong.py ``` -------------------------------- ### Executing Python from System PATH Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/getting-started.md This snippet shows the standard way to execute Python from the system's PATH, which is how it's typically accessed without a package manager like Rez. ```bash python ``` -------------------------------- ### Inherit Filter for Environment Replication Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/reference.md Illustrates passing environment filters to both local and remote commands to ensure consistent environment replication. It highlights a potential issue with `--patch`ed environments and excluded beta versions. ```bash rez env packageA packageB --exclude *.beta -- echo $env:REZ_USED_RESOLVE # packageA-2.33.3 packageB-5.12.3 ``` ```bash rez env packageA-2.33.3 packageB-5.12.3 --exclude *.beta ``` ```bash rez env packageA packageB --exclude *.beta > rez env packageB-5.12.3.beta >> $env:REZ_USED_RESOLVE # packageA-2.33.3 packageB-5.12.3.beta ``` -------------------------------- ### Create Package Directory (Powershell) Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/rez.md Use this snippet to create a new package directory and an empty package file using Powershell. ```powershell cd mypackage cd .. mkdir mypackage2 $null >> mypackage2/package.py ``` -------------------------------- ### Build and Test Texteditor Dependency Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/guides.md Commands to build the 'texteditor' package, then rebuild and activate the 'spiderman' environment to test the dependency. ```powershell $ rez build --install $ rez env spiderman > $ texteditor ``` -------------------------------- ### Handling Applications from Package Data Source: https://github.com/mottosso/allzpark/blob/master/docs/pages/gui.md This Python snippet defines a function to retrieve applications from a package's '_data' dictionary. It includes a fallback to the default Allzpark configuration if the 'apps' key is not found. ```python def applications_from_package(package): try: return package._data["apps"] except (AttributeError, KeyError): # If there isn't any data, just do what you normally do from allzpark.allzparkconfig import _applications_from_package # Every variable and function from allzparkconfig has this hidden # alternative reference, with a "_" prefix. return _applications_from_package(package) ```