Skip to content
Snippets Groups Projects
  1. May 09, 2020
  2. Jan 23, 2020
    • Adam J. Stewart's avatar
      Use `spack commands --format=bash` to generate shell completion (#14393) · 11f2b612
      Adam J. Stewart authored
      
      This PR adds a `--format=bash` option to `spack commands` to
      auto-generate the Bash programmable tab completion script. It can be
      extended to work for other shells.
      
      Progress:
      
      - [x] Fix bug in superclass initialization in `ArgparseWriter`
      - [x] Refactor `ArgparseWriter` (see below)
      - [x] Ensure that output of old `--format` options remains the same
      - [x] Add `ArgparseCompletionWriter` and `BashCompletionWriter`
      - [x] Add `--aliases` option to add command aliases
      - [x] Standardize positional argument names
      - [x] Tests for `spack commands --format=bash` coverage
      - [x] Tests to make sure `spack-completion.bash` stays up-to-date
      - [x] Tests for `spack-completion.bash` coverage
      - [x] Speed up `spack-completion.bash` by caching subroutine calls
      
      This PR also necessitates a significant refactoring of
      `ArgparseWriter`. Previously, `ArgparseWriter` was mostly a single
      `_write` method which handled everything from extracting the information
      we care about from the parser to formatting the output. Now, `_write`
      only handles recursion, while the information extraction is split into a
      separate `parse` method, and the formatting is handled by `format`. This
      allows subclasses to completely redefine how the format will appear
      without overriding all of `_write`.
      
      Co-Authored-by: default avatarTodd Gamblin <tgamblin@llnl.gov>
      11f2b612
  3. Dec 31, 2019
  4. Jul 16, 2019
  5. Jul 05, 2019
    • Todd Gamblin's avatar
      tests: add tests for setup-env.sh · 47e9f7aa
      Todd Gamblin authored
      - tests use a shell-script harness and test all Spack commands that
        require special shell support.
      
      - tests work in bash, zsh, and dash
      
      - run setup-env.sh tests on macos and linux builds.
        - we run them on macos and linux
      47e9f7aa
  6. Jul 04, 2019
  7. Dec 30, 2018
  8. Sep 19, 2017
    • Massimiliano Culpo's avatar
      Modulefiles generated with a template engine (#3183) · b1d129e6
      Massimiliano Culpo authored
      * Module files now are generated using a template engine refers #2902 #3173
      
      jinja2 has been hooked into Spack.
      
      The python module `modules.py` has been splitted into several modules
      under the python package `spack/modules`. Unit tests stressing module
      file generation have been refactored accordingly.
      
      The module file generator for Lmod has been extended to multi-providers
      and deeper hierarchies.
      
      * Improved the support for templates in module files.
      
      Added an entry in `config.yaml` (`template_dirs`) to list all the
      directories where Spack could find templates for `jinja2`.
      
      Module file generators have a simple override mechanism to override
      template selection ('modules.yaml' beats 'package.py' beats 'default').
      
      * Added jinja2 and MarkupSafe to vendored packages.
      
      * Spec.concretize() sets mutual spec-package references
      
      The correct place to set the mutual references between spec and package
      objects at the end of concretization. After a call to concretize we
      should now be ensured that spec is the same object as spec.package.spec.
      
      Code in `build_environment.py` that was performing the same operation
      has been turned into an assertion to be defensive on the new behavior.
      
      * Improved code and data layout for modules and related tests.
      
      Common fixtures related to module file generation have been extracted
      in `conftest.py`. All the mock configurations for module files have been
      extracted from python code and have been put into their own yaml file.
      
      Added a `context_property` decorator for the template engine, to make
      it easy to define dictionaries out of properties.
      
      The default for `verbose` in `modules.yaml` is now False instead of True.
      
      * Extendable module file contexts + short description from docstring
      
      The contexts that are used in conjunction with `jinja2` templates to
      generate module files can now be extended from package.py and
      modules.yaml.
      
      Module files generators now infer the short description from package.py
      docstring (and as you may expect it's the first paragraph)
      
      * 'module refresh' regenerates all modules by default
      
      `module refresh` without `--module-type` specified tries to
      regenerate all known module types. The same holds true for `module rm`
      
      Configure options used at build time are extracted and written into the
      module files where possible.
      
      * Fixed python3 compatibility, tests for Lmod and Tcl.
      
      Added test for exceptional paths of execution when generating Lmod
      module files.
      
      Fixed a few compatibility issues with python3.
      
      Fixed a bug in Tcl with naming_scheme and autoload + unit tests
      
      * Updated module file tutorial docs. Fixed a few typos in docstrings.
      
      The reference section for module files has been reorganized. The idea is
      to have only three topics at the highest level:
      
        - shell support + spack load/unload use/unuse
        - module file generation (a.k.a. APIs + modules.yaml)
        - module file maintenance (spack module refresh/rm)
      
      Module file generation will cover the entries in modules.yaml
      
      Also:
      
        - Licenses have been updated to include NOTICE and extended to 2017
        - docstrings have been reformatted according to Google style
      
      * Removed redundant arguments to RPackage and WafPackage.
      
      All the callbacks in `RPackage` and `WafPackage` that are not build
      phases have been modified not to accept a `spec` and a `prefix`
      argument. This permits to leverage the common `configure_args` signature
      to insert by default the configuration arguments into the generated
      module files. I think it's preferable to handling those packages
      differently than `AutotoolsPackage`. Besides only one package seems
      to override one of these methods.
      
      * Fixed broken indentation + improved resiliency of refresh
      
      Fixed broken indentation in `spack module refresh` (probably a rebase
      gone silently wrong?). Filter the writers for blacklisted specs before
      searching for name clashes. An error with a single writer will not
      stop regeneration, but instead will print a warning and continue
      the command.
      b1d129e6
  9. Aug 19, 2017
    • Massimiliano Culpo's avatar
      Group Travis CI jobs in stages (#5104) · 99fb394a
      Massimiliano Culpo authored
      - This should speed-up Travis CI tests and refers to #5049
      
      - Travis uses build-stages to group tests together
          - The idea is to let fast tests fail first, then move to longer ones.
          - Added external perl to avoid download failure from CPAN and reduce build time
          - Disabling perl-dbi: continues to fail with (504 Gateway Time-out) on Travis
      
      - We now cover all the build systems in tests:
          - Add back `openblas` to Travis as a separate package.
          - Switched `openblas` for `astyle` to build a simpler MakefilePackage.
          - Added 'tut' (WafPackage)
          - Added 'py-setuptools' (PythonPackage)
          - Added 'perl-dbi' (PerlPackage)
          - Added 'build_systems' directory to the ones for which we get a summary
          - Added 'openjpeg' (CMakePackage)
          - Added 'r-rcpp' (RPackage)
          - Added comments to build tests to show the covered build system
      
      
      99fb394a
  10. Feb 09, 2017
  11. Feb 08, 2017
  12. Jan 26, 2017
Loading