From 95fdc92c1f7852d24e68e19ec7c366594b3f9484 Mon Sep 17 00:00:00 2001 From: Alex Richert <82525672+AlexanderRichert-NOAA@users.noreply.github.com> Date: Sat, 24 Feb 2024 07:25:59 -0800 Subject: [PATCH] Allow awscli-v2 to be installed without examples/ dir (#42773) * Allow awscli-v2 to be installed without examples/ dir * [@spackbot] updating style on behalf of AlexanderRichert-NOAA * Update var/spack/repos/builtin/packages/awscli-v2/package.py Co-authored-by: Adam J. Stewart --------- Co-authored-by: Adam J. Stewart --- var/spack/repos/builtin/packages/awscli-v2/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/var/spack/repos/builtin/packages/awscli-v2/package.py b/var/spack/repos/builtin/packages/awscli-v2/package.py index 821321e6227..dfa354430aa 100644 --- a/var/spack/repos/builtin/packages/awscli-v2/package.py +++ b/var/spack/repos/builtin/packages/awscli-v2/package.py @@ -29,3 +29,11 @@ class AwscliV2(PythonPackage): depends_on("py-python-dateutil@2.1:2", type=("build", "run")) depends_on("py-jmespath@0.7.1:1.0", type=("build", "run")) depends_on("py-urllib3@1.25.4:1.26", type=("build", "run")) + + variant("examples", default=True, description="Install code examples") + + @run_after("install") + @when("~examples") + def post_install(self): + examples_dir = join_path(python_purelib, "awscli", "examples") + remove_directory_contents(examples_dir)