diff options
author | Harmen Stoppels <me@harmenstoppels.nl> | 2024-01-31 17:22:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 17:22:20 +0100 |
commit | 2bcfb72d38daa2d148b5551c21a424633339649c (patch) | |
tree | 7231bacaf86adb36ef62ae14d83954b043f0109b /lib | |
parent | f27bff81ba9cd53416ceda109aa9a6708dd13760 (diff) | |
download | spack-2bcfb72d38daa2d148b5551c21a424633339649c.tar.gz spack-2bcfb72d38daa2d148b5551c21a424633339649c.tar.bz2 spack-2bcfb72d38daa2d148b5551c21a424633339649c.tar.xz spack-2bcfb72d38daa2d148b5551c21a424633339649c.zip |
environment/view: small cleanup (#42395)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/environment/environment.py | 12 | ||||
-rw-r--r-- | lib/spack/spack/filesystem_view.py | 3 |
2 files changed, 6 insertions, 9 deletions
diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py index c8496f255d..605eaf222c 100644 --- a/lib/spack/spack/environment/environment.py +++ b/lib/spack/spack/environment/environment.py @@ -680,8 +680,8 @@ class ViewDescriptor: with spack.store.STORE.db.read_transaction(): return [s for s in specs if s in self and s.installed] - def regenerate(self, concretized_root_specs): - specs = self.specs_for_view(concretized_root_specs) + def regenerate(self, concrete_roots: List[Spec]) -> None: + specs = self.specs_for_view(concrete_roots) # To ensure there are no conflicts with packages being installed # that cannot be resolved or have repos that have been removed @@ -698,14 +698,14 @@ class ViewDescriptor: old_root = self._current_root if new_root == old_root: - tty.debug("View at %s does not need regeneration." % self.root) + tty.debug(f"View at {self.root} does not need regeneration.") return _error_on_nonempty_view_dir(new_root) # construct view at new_root if specs: - tty.msg("Updating view at {0}".format(self.root)) + tty.msg(f"Updating view at {self.root}") view = self.view(new=new_root) @@ -715,7 +715,7 @@ class ViewDescriptor: # Create a new view try: fs.mkdirp(new_root) - view.add_specs(*specs, with_dependencies=False) + view.add_specs(*specs) # create symlink from tmp_symlink_name to new_root if os.path.exists(tmp_symlink_name): @@ -729,7 +729,7 @@ class ViewDescriptor: try: shutil.rmtree(new_root, ignore_errors=True) os.unlink(tmp_symlink_name) - except (IOError, OSError): + except OSError: pass # Give an informative error message for the typical error case: two specs, same package diff --git a/lib/spack/spack/filesystem_view.py b/lib/spack/spack/filesystem_view.py index 771c19cf62..5c346f1f67 100644 --- a/lib/spack/spack/filesystem_view.py +++ b/lib/spack/spack/filesystem_view.py @@ -666,9 +666,6 @@ class SimpleFilesystemView(FilesystemView): tty.warn("Skipping external package: " + s.short_spec) specs = [s for s in specs if not s.external] - if kwargs.get("exclude", None): - specs = set(filter_exclude(specs, kwargs["exclude"])) - self._sanity_check_view_projection(specs) # Ignore spack meta data folder. |