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 <ajstewart426@gmail.com>

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Alex Richert 2024-02-24 07:25:59 -08:00 committed by GitHub
parent 6680c6b72e
commit 95fdc92c1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)