package_base.py: remove deprecated props (#48066)

This commit is contained in:
Harmen Stoppels 2024-12-13 10:19:16 +01:00 committed by GitHub
parent 0c2b546825
commit 11b86ca75c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 31 deletions

View File

@ -24,7 +24,6 @@
import time import time
import traceback import traceback
import typing import typing
import warnings
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, TypeVar, Union from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, TypeVar, Union
import llnl.util.filesystem as fsys import llnl.util.filesystem as fsys
@ -1360,24 +1359,6 @@ def tester(self):
self._tester = spack.install_test.PackageTest(self) self._tester = spack.install_test.PackageTest(self)
return self._tester return self._tester
@property
def installed(self):
msg = (
'the "PackageBase.installed" property is deprecated and will be '
'removed in Spack v0.19, use "Spec.installed" instead'
)
warnings.warn(msg)
return self.spec.installed
@property
def installed_upstream(self):
msg = (
'the "PackageBase.installed_upstream" property is deprecated and will '
'be removed in Spack v0.19, use "Spec.installed_upstream" instead'
)
warnings.warn(msg)
return self.spec.installed_upstream
@property @property
def fetcher(self): def fetcher(self):
if not self.spec.versions.concrete: if not self.spec.versions.concrete:

View File

@ -1718,7 +1718,7 @@ def test_uninstall_keeps_in_env(mock_stage, mock_fetch, install_mockery):
assert test.concretized_order == orig_concretized_specs assert test.concretized_order == orig_concretized_specs
assert test.user_specs.specs == orig_user_specs.specs assert test.user_specs.specs == orig_user_specs.specs
assert mpileaks_hash in test.specs_by_hash assert mpileaks_hash in test.specs_by_hash
assert not test.specs_by_hash[mpileaks_hash].package.installed assert not test.specs_by_hash[mpileaks_hash].installed
def test_uninstall_removes_from_env(mock_stage, mock_fetch, install_mockery): def test_uninstall_removes_from_env(mock_stage, mock_fetch, install_mockery):

View File

@ -248,7 +248,7 @@ def test_basic_env_sanity(self, environment_setup):
e = spack.environment.read(env_name) e = spack.environment.read(env_name)
with e: with e:
for _, concretized_spec in e.concretized_specs(): for _, concretized_spec in e.concretized_specs():
assert concretized_spec.package.installed assert concretized_spec.installed
def test_uninstall_force_dependency_shared_between_envs(self, environment_setup): def test_uninstall_force_dependency_shared_between_envs(self, environment_setup):
"""If you "spack uninstall -f --dependents diamond-link-bottom" from """If you "spack uninstall -f --dependents diamond-link-bottom" from
@ -266,7 +266,7 @@ def test_uninstall_force_dependency_shared_between_envs(self, environment_setup)
) )
for _, concretized_spec in e1.concretized_specs(): for _, concretized_spec in e1.concretized_specs():
assert not concretized_spec.package.installed assert not concretized_spec.installed
# Everything in e2 depended on diamond-link-bottom, so should also # Everything in e2 depended on diamond-link-bottom, so should also
# have been uninstalled. The roots should be unchanged though. # have been uninstalled. The roots should be unchanged though.
@ -276,7 +276,7 @@ def test_uninstall_force_dependency_shared_between_envs(self, environment_setup)
["diamond-link-right", "diamond-link-bottom"] ["diamond-link-right", "diamond-link-bottom"]
) )
for _, concretized_spec in e2.concretized_specs(): for _, concretized_spec in e2.concretized_specs():
assert not concretized_spec.package.installed assert not concretized_spec.installed
def test_uninstall_remove_dependency_shared_between_envs(self, environment_setup): def test_uninstall_remove_dependency_shared_between_envs(self, environment_setup):
"""If you "spack uninstall --dependents --remove diamond-link-bottom" from """If you "spack uninstall --dependents --remove diamond-link-bottom" from
@ -294,7 +294,7 @@ def test_uninstall_remove_dependency_shared_between_envs(self, environment_setup
output = uninstall("-y", "--dependents", "--remove", "diamond-link-bottom") output = uninstall("-y", "--dependents", "--remove", "diamond-link-bottom")
assert "The following specs will be removed but not uninstalled" in output assert "The following specs will be removed but not uninstalled" in output
assert not list(e1.roots()) assert not list(e1.roots())
assert not dtdiamondleft.package.installed assert not dtdiamondleft.installed
# Since -f was not specified, all specs in e2 should still be installed # Since -f was not specified, all specs in e2 should still be installed
# (and e2 should be unchanged) # (and e2 should be unchanged)
@ -304,7 +304,7 @@ def test_uninstall_remove_dependency_shared_between_envs(self, environment_setup
["diamond-link-right", "diamond-link-bottom"] ["diamond-link-right", "diamond-link-bottom"]
) )
for _, concretized_spec in e2.concretized_specs(): for _, concretized_spec in e2.concretized_specs():
assert concretized_spec.package.installed assert concretized_spec.installed
def test_uninstall_dependency_shared_between_envs_fail(self, environment_setup): def test_uninstall_dependency_shared_between_envs_fail(self, environment_setup):
"""If you "spack uninstall --dependents diamond-link-bottom" from """If you "spack uninstall --dependents diamond-link-bottom" from
@ -323,7 +323,7 @@ def test_uninstall_dependency_shared_between_envs_fail(self, environment_setup):
["diamond-link-left", "diamond-link-bottom"] ["diamond-link-left", "diamond-link-bottom"]
) )
for _, concretized_spec in e1.concretized_specs(): for _, concretized_spec in e1.concretized_specs():
assert concretized_spec.package.installed assert concretized_spec.installed
def test_uninstall_force_and_remove_dependency_shared_between_envs(self, environment_setup): def test_uninstall_force_and_remove_dependency_shared_between_envs(self, environment_setup):
"""If you "spack uninstall -f --dependents --remove diamond-link-bottom" from """If you "spack uninstall -f --dependents --remove diamond-link-bottom" from
@ -340,7 +340,7 @@ def test_uninstall_force_and_remove_dependency_shared_between_envs(self, environ
) )
uninstall("-f", "-y", "--dependents", "--remove", "diamond-link-bottom") uninstall("-f", "-y", "--dependents", "--remove", "diamond-link-bottom")
assert not list(e1.roots()) assert not list(e1.roots())
assert not dtdiamondleft.package.installed assert not dtdiamondleft.installed
e2 = spack.environment.read("e2") e2 = spack.environment.read("e2")
with e2: with e2:
@ -348,7 +348,7 @@ def test_uninstall_force_and_remove_dependency_shared_between_envs(self, environ
["diamond-link-right", "diamond-link-bottom"] ["diamond-link-right", "diamond-link-bottom"]
) )
for _, concretized_spec in e2.concretized_specs(): for _, concretized_spec in e2.concretized_specs():
assert not concretized_spec.package.installed assert not concretized_spec.installed
def test_uninstall_keep_dependents_dependency_shared_between_envs(self, environment_setup): def test_uninstall_keep_dependents_dependency_shared_between_envs(self, environment_setup):
"""If you "spack uninstall -f --remove diamond-link-bottom" from """If you "spack uninstall -f --remove diamond-link-bottom" from
@ -367,7 +367,7 @@ def test_uninstall_keep_dependents_dependency_shared_between_envs(self, environm
# diamond-link-bottom was removed from the list of roots (note that # diamond-link-bottom was removed from the list of roots (note that
# it would still be installed since diamond-link-left depends on it) # it would still be installed since diamond-link-left depends on it)
assert set(x.name for x in e1.roots()) == set(["diamond-link-left"]) assert set(x.name for x in e1.roots()) == set(["diamond-link-left"])
assert dtdiamondleft.package.installed assert dtdiamondleft.installed
e2 = spack.environment.read("e2") e2 = spack.environment.read("e2")
with e2: with e2:
@ -379,10 +379,10 @@ def test_uninstall_keep_dependents_dependency_shared_between_envs(self, environm
for (_, concrete) in e2.concretized_specs() for (_, concrete) in e2.concretized_specs()
if concrete.name == "diamond-link-right" if concrete.name == "diamond-link-right"
) )
assert dtdiamondright.package.installed assert dtdiamondright.installed
dtdiamondbottom = next( dtdiamondbottom = next(
concrete concrete
for (_, concrete) in e2.concretized_specs() for (_, concrete) in e2.concretized_specs()
if concrete.name == "diamond-link-bottom" if concrete.name == "diamond-link-bottom"
) )
assert not dtdiamondbottom.package.installed assert not dtdiamondbottom.installed