### Environment File Example (.env) Source: https://pydeployment.github.io/latest/user-guide/setting-options/using-both Example content for a .env file, defining FILENAME, APPNAME, and VERSION. ```env FILENAME=myapp APPNAME='My App' VERSION=0.1.0 ``` -------------------------------- ### Environment File Example (.env) - Overriding Source: https://pydeployment.github.io/latest/user-guide/setting-options/using-both Example content for a .env file where some options might be overridden by command-line arguments. ```env FILENAME=testing VERSION=0.1.0 ``` -------------------------------- ### Install PyDeployment Source: https://pydeployment.github.io/latest/user-guide/getting-started Install PyDeployment using pip. Ensure you have Python 3.10 or higher and pip installed. ```bash pip install --user pydeployment ``` -------------------------------- ### Install Pytest Requirements Source: https://pydeployment.github.io/latest/CONTRIBUTING Install the necessary requirements for running pytest, the testing framework. ```bash venv/bin/pip install -r requirements_pytest.txt ``` -------------------------------- ### Environment File Format Example Source: https://pydeployment.github.io/latest/user-guide/setting-options/env-file Demonstrates the basic format of an environment file, where each line is a 'Name=Value' pair. Values with whitespace should be enclosed in quotes. ```text Name=Value ``` -------------------------------- ### Select Xcode Version Source: https://pydeployment.github.io/latest/user-guide/advanced/macos-notarization Use this command to select the appropriate Xcode version if multiple are installed. Ensure Xcode 13 or later is installed. ```bash sudo xcode-select -s /path/to/Xcode13.app ``` -------------------------------- ### Install Project in Editable Mode Source: https://pydeployment.github.io/latest/CONTRIBUTING Install the PyDeployment project in editable mode, allowing for direct code changes to be reflected. ```bash venv/bin/pip install --editable . ``` -------------------------------- ### Set Build Options via Command Line Source: https://pydeployment.github.io/latest/user-guide/setting-options/command-line These commands demonstrate setting the filename, app name, and version using various argument orders. Ensure values with spaces are quoted. ```bash pydeploy -f myapp -a 'My App' --appv 0.1.0 my_app.py ``` ```bash pydeploy my_app.py -f myapp -a 'My App' --appv 0.1.0 ``` ```bash pydeploy -f myapp my_app.py -a 'My App' --appv 0.1.0 ``` -------------------------------- ### Create and Upgrade Virtual Environment Source: https://pydeployment.github.io/latest/CONTRIBUTING Create a new virtual environment and ensure all dependencies are up-to-date. ```bash python -m venv --upgrade-deps venv ``` -------------------------------- ### Platform-Specific Build Options in Environment File Source: https://pydeployment.github.io/latest/user-guide/setting-options/env-file Shows how to define platform-specific build options like 'ICON' within an environment file using platform prefixes (WINDOWS_, MACOS_, LINUX_). ```text WINDOWS_ICON=myapp.ico MACOS_ICON=myapp.icns LINUX_ICON=myapp.png ``` -------------------------------- ### Configure macOS Notarization Environment Variables Source: https://pydeployment.github.io/latest/CONTRIBUTING Set up the .env file with necessary credentials for macOS notarization. Ensure 'CERT' and 'KEYC' values are correctly replaced with your specific details. ```bash CERT="Developer ID Application: Name Here (TEAMIDHERE)" KEYC="keychain-profile-name" ``` -------------------------------- ### Sign and Notarize Without Stored Keychain Profile Source: https://pydeployment.github.io/latest/user-guide/advanced/macos-notarization Build and notarize an application directly using PyDeployment, providing all credentials (certificate, Apple ID, Team ID, App-Specific Password) as command-line arguments. ```bash pydeploy myapp.spec -C 'Developer ID Application: Name Here (TEAMIDHERE)' -A appleid@here.com -T TEAMIDHERE -P pass-word-goes-here ``` -------------------------------- ### Sign and Notarize with Stored Keychain Profile Source: https://pydeployment.github.io/latest/user-guide/advanced/macos-notarization Build and notarize an application using PyDeployment, specifying the code signing certificate and the name of the stored Keychain Profile. ```bash pydeploy myapp.spec -C 'Developer ID Application: Name Here (TEAMIDHERE)' -K 'profile-name' ``` -------------------------------- ### Clone PyDeployment Repository Source: https://pydeployment.github.io/latest/CONTRIBUTING Clone the PyDeployment repository and navigate into the project directory to begin development. ```bash git clone https://github.com/pydeployment/pydeployment && cd pydeployment ``` -------------------------------- ### Basic PyDeployment Usage Source: https://pydeployment.github.io/latest/user-guide/getting-started Use the `pydeploy` command with a Python script or PyInstaller spec file to package your application. ```bash pydeploy myapp.py ``` -------------------------------- ### Command Line Execution (Case 2) - Explicit Options Source: https://pydeployment.github.io/latest/user-guide/setting-options/using-both Executing pydeploy with explicit command-line flags for filename (-f) and app name (-a), overriding .env settings. ```bash pydeploy -f myapp -a 'My App' myapp.py ``` -------------------------------- ### Set Custom Environment File on Windows Source: https://pydeployment.github.io/latest/user-guide/setting-options/env-file Specifies a custom environment file named 'env_values.txt' for PyDeployment on Windows using the 'ENV_FILE' environment variable. ```bash cmd /C "set ENV_FILE=env_values.txt pydeploy myapp.py" ``` -------------------------------- ### Set Custom Environment File on macOS/Linux Source: https://pydeployment.github.io/latest/user-guide/setting-options/env-file Specifies a custom environment file named 'env_values.txt' for PyDeployment on macOS and Linux using the 'ENV_FILE' environment variable. ```bash env ENV_FILE=env_values.txt pydeploy myapp.py ``` -------------------------------- ### Store Keychain Profile with API Key Source: https://pydeployment.github.io/latest/user-guide/advanced/macos-notarization Store notarization credentials using an App Store Connect API key. This method is recommended over using App-Specific Passwords. ```bash xcrun notarytool store-credentials 'profile-name' -k /path/to/api/key -d KEYIDHERE0 -i issuerid-g0es-0ver-h3r3-in0this0spot ``` -------------------------------- ### Store Keychain Profile with Apple ID and Password Source: https://pydeployment.github.io/latest/user-guide/advanced/macos-notarization Store notarization credentials using your Apple ID, Team ID, and an App-Specific Password. ```bash xcrun notarytool store-credentials 'profile-name' --apple-id appleid@here.com --team-id TEAMIDHERE --password pass-word-goes-here ``` -------------------------------- ### Run All Pytest Tests Source: https://pydeployment.github.io/latest/CONTRIBUTING Execute all tests within the tests directory using pytest to ensure the project's functionality. ```bash venv/bin/pytest tests/ ``` -------------------------------- ### Code Sign App Bundle Source: https://pydeployment.github.io/latest/user-guide/advanced/macos-notarization Code sign an app bundle generated by PyInstaller using your Developer ID certificate. Include the certificate name via the -C argument. ```bash pydeploy myapp.spec -C 'Developer ID Application: Name Here (TEAMIDHERE)' ``` -------------------------------- ### Custom NSIS Header Variables Source: https://pydeployment.github.io/latest/user-guide/advanced/custom-nsis Include these definitions at the top of your custom NSIS script to access variables provided by PyDeployment. ```nsis !define /file APPDIR "APPDIR" !define /file FILENAME "FILENAME" !define /file APPNAME "APPNAME" !define /file VERSION "VERSION" !define /file AUTHOR "AUTHOR" !define /file PUBLISHER "PUBLISHER" !define /file DESCRIPTION "DESCRIPTION" !define /file ICON "ICON" !define /file LICENSE "LICENSE" !define /file INSTALLSIZE "INSTALLSIZE" !define /file ARCH "ARCH" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.