package_base.py: do not depend on spack.environment (#46424)

This commit is contained in:
Harmen Stoppels 2024-09-17 14:43:03 +02:00 committed by GitHub
parent 673565aefe
commit 623c5a4d24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,7 +40,6 @@
import spack.dependency
import spack.deptypes as dt
import spack.directives
import spack.environment
import spack.error
import spack.fetch_strategy as fs
import spack.hooks
@ -1700,8 +1699,7 @@ def content_hash(self, content=None):
# should this attempt to download the source and set one? This
# probably only happens for source repositories which are
# referenced by branch name rather than tag or commit ID.
env = spack.environment.active_environment()
from_local_sources = env and env.is_develop(self.spec)
from_local_sources = "dev_path" in self.spec.variants
if self.has_code and not self.spec.external and not from_local_sources:
message = "Missing a source id for {s.name}@{s.version}"
tty.debug(message.format(s=self))