### GDK Component Configuration File (gdk-config.json) Examples Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/README.md Provides examples of the `gdk-config.json` file, showing both the initial structure with placeholders and a configured version with example values for author, S3 bucket, and AWS region. ```JSON { "component": { "com.example.PythonHelloWorld": { "author": "", "version": "NEXT_PATCH", "build": { "build_system": "zip" }, "publish": { "bucket": "", "region": "" } } }, "gdk_version": "1.0.0" } ``` ```JSON { "component": { "com.example.PythonHelloWorld": { "author": "J. Doe", "version": "NEXT_PATCH", "build": { "build_system": "zip" }, "publish": { "bucket": "my-s3-bucket", "region": "us-east-1" } } }, "gdk_version": "1.0.0" } ``` -------------------------------- ### Install GDK CLI from Source Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/uat/README.md These commands first upgrade the pip package installer to its latest version and then install the GDK CLI tool from the current directory, allowing installation directly from the cloned source code. ```shell python3 -m pip install --upgrade pip pip install . ``` -------------------------------- ### Install and Verify Greengrass Development Kit CLI Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/README.md Installs the latest version of the GDK CLI tool using pip from the GitHub repository and verifies the installation by displaying help information. ```Shell pip3 install git+https://github.com/aws-greengrass/aws-greengrass-gdk-cli.git@v1.6.2 gdk --help ``` -------------------------------- ### Install Pre-commit Hooks for Development Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/CONTRIBUTING.md Instructions to install and set up pre-commit hooks using pip, ensuring code quality checks are run automatically before committing changes. These hooks help maintain code standards and prevent common issues. ```shell pip install pre-commit pre-commit install ``` -------------------------------- ### Install GDK CLI Test Dependencies Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/uat/README.md This command installs all required test dependencies listed in the `test-requirements.txt` file. These dependencies are necessary for running the end-to-end test suite for the GDK CLI. ```shell pip install -r test-requirements.txt ``` -------------------------------- ### Python Project Dependencies for aws-greengrass-gdk-cli Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/requirements.txt This snippet enumerates the core Python packages that the aws-greengrass-gdk-cli project relies on. These dependencies are crucial for the application's functionality and are typically managed through a `requirements.txt` file for installation. ```Python boto3 jsonschema PyYAML requests packaging semver aenum ``` -------------------------------- ### Initialize and Navigate to a New Greengrass Component Project Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/README.md Initializes a new project with a HelloWorld Greengrass v2 component using the GDK CLI, specifying Python as the language, and then navigates into the newly created project directory. ```Shell gdk component init --template HelloWorld --language python -n HelloWorld cd HelloWorld ``` -------------------------------- ### Build Greengrass Component Artifacts and Recipes Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/README.md Builds the artifacts and recipes for the Greengrass component defined in the current project, preparing it for publishing. ```Shell gdk component build ``` -------------------------------- ### Publish New Greengrass Component Version to AWS Account Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/README.md Creates a new version of the Greengrass component in your AWS account, making it available for deployment to Greengrass devices. ```Shell gdk component publish ``` -------------------------------- ### Run Unit and Integration Tests for GDK CLI Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/README.md Executes both unit and integration tests for the Greengrass Development Kit CLI to ensure its functionality and stability. ```Shell make tests_unit make tests_integration ``` -------------------------------- ### Run GDK CLI End-to-End Test Suite Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/uat/README.md This command executes the end-to-end test suite for the GDK CLI using the `behave` framework. The `uat` argument specifies the User Acceptance Testing profile for the test run. ```shell behave uat ``` -------------------------------- ### Track Code Coverage with GDK CLI Tests Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/uat/README.md Use this command in combination with the `coverage` tool to track code coverage by the test suite. The `coverage` tool is required to instrument the code and generate coverage reports. ```shell coverage run --source=gdk -m behave uat -D instrumented=true ``` -------------------------------- ### Run GDK CLI Tests Against Specific Version Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/uat/README.md This flag allows running the test suite considering a specific GDK CLI version. If not provided, the target version defaults to `HEAD`, which means tests will run against the most recent commit. ```shell behave uat -D target-version=1.1.0 ``` -------------------------------- ### Clone GDK CLI Repository Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/uat/README.md This command clones the AWS Greengrass GDK CLI repository from GitHub at a specific version (v1.6.2) and then changes the current directory to the newly cloned repository. ```shell git clone https://github.com/aws-greengrass/aws-greengrass-gdk-cli.git@v1.6.2 cd aws-greengrass-gdk-cli ``` -------------------------------- ### Apply Version Constraints to Pytest Tests Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/uat/README.md The `@version(...)` pytest marker enforces version constraints for any test. It takes keyword arguments like `eq`, `min`, `ge`, `gt`, `max`, `le`, and `lt` to define exact, lower, or upper bounds for GDK CLI versions, which can be combined. ```python @version(eq='1.1.0') @version(min='1.1.0') or @version(ge='1.1.0') @version(max='1.1.0') or @version(le='1.1.0') @version(gt='1.1.0') @version(lt='1.1.0') @version(min='1.0.0', max='1.1.0') ``` -------------------------------- ### Enable GDK CLI Debug Logs for Tests Source: https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/main/uat/README.md Pass this flag to the `behave` command to enable and emit debug logs from the GDK CLI during all test runs. This option is useful for detailed troubleshooting and understanding test execution flow. ```shell behave uat -D gdk-debug=true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.