Commit graph

125 commits

Author SHA1 Message Date
Massimiliano Culpo
3efa4ee26f
Remove support for running with Python 2.7 (#33063)
* Remove CI jobs related to Python 2.7

* Remove Python 2.7 specific code from Spack core

* Remove externals for Python 2 only

* Remove llnl.util.compat
2022-11-14 13:11:28 +01:00
Massimiliano Culpo
5558940ce6
Add support for Python 3.11 (#33505)
Argparse started raising ArgumentError exceptions
when the same parser is added twice. Therefore, we
perform the addition only if the parser is not there
already

Port match syntax to our unparser
2022-11-05 15:59:12 +01:00
Massimiliano Culpo
23aef6bb94
Let pytest-cov create the xml directly (#33619)
`coverage` sometimes failed to combine, even if there were multiple reports.
2022-11-01 19:04:45 +01:00
Massimiliano Culpo
7e645f54c5
Deprecate spack bootstrap trust/untrust (#33600)
* Deprecate spack bootstrap trust/untrust
* Update CI
* Update tests
2022-10-29 12:24:26 -07:00
Massimiliano Culpo
ec50906943
Update macOS Python version in CI to 3.10 (#33560) 2022-10-27 20:25:26 +02:00
Massimiliano Culpo
4b237349a3
Remove recursive symbolic link in lib/spack/docs from git repository (#33483)
Delete code removing the symlink during CI
2022-10-25 12:27:13 +02:00
Massimiliano Culpo
329adc1d22
CI: speed-up tests by dropping coverage on Python 2.7 (#33497) 2022-10-25 11:41:29 +02:00
Massimiliano Culpo
dc110db65d
Don't install xdist in CI on Python 2.7 (#33474) 2022-10-22 15:53:42 +02:00
dependabot[bot]
8e3c088a7a
Bump actions/setup-python from 4.2.0 to 4.3.0 (#33166)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](b55428b188...13ae5bb136)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-11 09:54:17 +02:00
dependabot[bot]
bfd848089f
build(deps): bump actions/checkout from 3.0.2 to 3.1.0 (#32998) 2022-10-06 02:58:13 -06:00
dependabot[bot]
e656b4659a
build(deps): bump codecov/codecov-action from 3.1.0 to 3.1.1 (#32717)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](81cd2dc814...d9f34f8cd5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-20 14:03:47 +02:00
Massimiliano Culpo
1427ddaa59
ci: restore coverage computation (#32585)
* ci: restore coverage computation

* Mark "test_foreground_background" as xfail

* Mark "test_foreground_background_output" as xfail

* Make number of processes explicit, remove verbosity on linux

* Run coverage on just 3 Python jobs for linux

* Run coverage on just 3 Python jobs for linux

* Run coverage on just 2 Python jobs for linux

* Add back verbose, since before we didn't encounter the xdist internal error

* Reduce the workers to 2

* Try to use command line
2022-09-10 07:25:44 -06:00
Massimiliano Culpo
67534516c7
ci: avoid running coverage on package only PRs (#32573)
* ci: remove !docs from "core" filters

Written like it is now it causes package only PRs
to run with coverage.

* Try to skip job under condition, see if the workflow proceed

* Try to cancel a running CI job

* Simplify linux unit-tests, skip windows unit-tests on package PRs

* Reduce the inputs to unit-tests workflow

* Move control logic to main workflow, remove inputs

* Revert "Move control logic to main workflow, remove inputs"

This reverts commit 0c46fece4c49eb7a37585ec3ba651a31d7f958af.

* Do not compute "with_coverage" since it's always == to "core"

* Remove workflow dispatch from unit tests

* Revert "Revert "Move control logic to main workflow, remove inputs""

This reverts commit dd4e4a4e61a825901e736348fd044d37e88c90b5.

* Try to skip all from the main workflow

* Add back bootstrap to needed checks for "all"

* Restore the correct logic for conditionals
2022-09-08 10:58:53 -07:00
Tom Scogland
762ba27036
Make GHA tests parallel by using xdist (#32361)
* Add two no-op jobs named "all-prechecks" and "all"

These are a suggestion from @tgamblin, they are stable named markers we
can use from gitlab and possibly for required checks to make CI more
resilient to refactors changing the names of specific checks.

* Enable parallel testing using xdist for unit testing in CI

* Normalize tmp paths to deal with macos

* add -u flag compatibility to spack python

As of now, it is accepted and ignored.  The usage with xdist, where it
is invoked specifically by `python -u spack python` which is then passed
`-u` by xdist is the entire reason for doing this.  It should never be
used without explicitly passing -u to the executing python interpreter.

* use spack python in xdist to support python 2

When running on python2, spack has many import cycles unless started
through main.  To allow that, this uses `spack python` as the
interpreter, leveraging the `-u` support so xdist doesn't error out when
it unconditionally requests unbuffered binary IO.

* Use shutil.move to account for tmpdir being in a separate filesystem sometimes
2022-09-07 20:12:57 +02:00
Tom Scogland
69f7a8f4d1
Reorder workflow execution in GHA (#32183)
This patchset refactors our GitHub actions into a single top-level ci workflow that
invokes a series of reusable actions.  The main goal of this is to be able to easily
control which tests run and in what order based on the success or failure of top-level
prechecks.  Our previous workflows ran in three sets:

* nix tests: style and verification first, then linux and macos tests if successful
* windows tests: style and verification first, then linux and macos tests if successful
* bootstrap tests

As a result, the bootstrap tests ran even if the style failed, and style and verification
had to run on two different platforms despite running identical checks.  I'm relatively
sure that's because of the limitation on dependencies between steps in the jobs.
Reusable workflows allow us to run the style, verification and now audit checks once,
then depending on the results, and the files changed, run the appropriate nix, windows
and bootstrap tests.  While it saves only a few minutes by itself, this makes it easier to
refactor checks to subset tests without having to replicate tests or other workflow
components in the future.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2022-09-02 14:09:23 -07:00
Massimiliano Culpo
01298287f6
Fix CI for package only PRs (#32473) 2022-09-01 14:41:28 +02:00
Massimiliano Culpo
6979d47cb6
CI: reduce the amount of tests run in the original concretizer (#32179)
* CI: reduce the amount of tests run in the original concretizer
* Don't test Python 3.6 on the original concretizer
2022-08-17 09:16:19 +02:00
Massimiliano Culpo
0e40804cd0
Deprecate support for Python 3.5 (by removing it from CI) (#31908)
* Deprecate support for Python 3.5 (by removing it from CI)

* Restore Python 3.9
2022-08-04 15:26:56 +02:00
dependabot[bot]
4aaa3841b8
build(deps): bump actions/setup-python from 4.1.0 to 4.2.0 (#31882)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](c4e89fac7e...b55428b188)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-03 09:08:03 +02:00
Todd Gamblin
67d27841ae black: configuration
This adds necessary configuration for flake8 and black to work together.

This also sets the line length to 99, per the data here:

* https://github.com/spack/spack/pull/24718#issuecomment-876933636

Given the data and the spirit of black's 88-character limit, we set the limit to 99
characters for all of Spack, because:

* 99 is one less than 100, a nice round number, and all lines will fit in a
  100-character wide terminal (even when the text editor puts a \ at EOL).
* 99 is just past the knee the file size curve for packages, and it means that packages
  remain readable and not significantly longer than they are now.
* It doesn't seem to hurt core -- files in core might change length by a few percent but
  seem like they'll be mostly the same as before -- just a bit more roomy.

- [x] set line length to 99
- [x] remove most exceptions from `.flake8` and add the ones black cares about
- [x] add `[tool.black]` to `pyproject.toml`
- [x] make `black` run if available in `spack style --fix`

Co-Authored-By: Tom Scogland <tscogland@llnl.gov>
2022-07-31 13:29:20 -07:00
dependabot[bot]
e33a57ab65
build(deps): bump actions/setup-python from 4.0.0 to 4.1.0 (#31526)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](d09bd5e600...c4e89fac7e)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-12 13:50:30 +02:00
Massimiliano Culpo
667c39987c
py-setuptools: install setuptools from wheels directly (#31131)
When installing setuptools from sources in Spack, we might
get into weird failures due to the way we use pip.

In particular, for Spack it's necessary to install in a
non-isolated pip environment to allow using PYTHONPATH as a
selection method for all the build requirements of a
Python package.

This can fail when installing setuptools since there might
be a setuptools version already installed for the Python
interpreter being used, with different entry points than
the one we want to install.

Installing from wheels both pip and setuptools should
harden our installation procedure in the context of:
- Bootstrapping Python dependencies of Spack
- Using external Python packages
2022-06-17 10:42:28 +02:00
Massimiliano Culpo
7d96a0aa5a
Pin setuptools version in Github Action Workflows (#31118)
fixes #31109
2022-06-13 21:09:16 +02:00
dependabot[bot]
163251aa65
build(deps): bump actions/setup-python from 3.1.2 to 4 (#31059)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3.1.2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](98f2ad02fd...d09bd5e600)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-10 11:03:36 +02:00
Massimiliano Culpo
3fdb3f832a
Cancel running workflows automatically on PR update (#31044)
* Cancel running workflows automatically on PR update
* Add the last update later to check cancellation is working
* Use github.run_number instead of github.sha
2022-06-08 15:46:46 -07:00
Adam J. Stewart
2bda10edb5
Fix typo in GitHub Actions step name (#30924) 2022-06-02 16:33:39 +00:00
dependabot[bot]
1243717012
build(deps): bump actions/checkout from 2 to 3.0.2 (#30235)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...2541b1294d2704b0964813337f33b291d3f8596b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-27 13:47:50 +02:00
dependabot[bot]
3dbbf3a101
build(deps): bump codecov/codecov-action from 3.0.0 to 3.1.0 (#30234)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](e3c560433a...81cd2dc814)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-27 11:26:19 +02:00
dependabot[bot]
bbb3f724af
build(deps): bump actions/setup-python from 3.1.1 to 3.1.2 (#30017)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](21c0493ecf...98f2ad02fd)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-14 10:47:01 +02:00
Massimiliano Culpo
c846b5149d
Add support for Python 3.10 (#29581)
* Add support for Python 3.10

* Update unit-tests to use 3.10

* Update Getting started section of the docs

* Update bootstrap action
2022-04-13 14:32:23 -07:00
dependabot[bot]
714573cdbc
build(deps): bump actions/setup-python from 3.1.0 to 3.1.1 (#29956)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](9c644ca2ab...21c0493ecf)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 10:50:08 +02:00
dependabot[bot]
764a97d428
build(deps): bump codecov/codecov-action from 2.1.0 to 3 (#29908)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.1.0 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](f32b3a3741...e3c560433a)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 06:08:22 +02:00
dependabot[bot]
105b42c15f
build(deps): bump actions/setup-python from 2 to 3.1.0 (#29843)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...9c644ca2ab8e57ea0a487b5ec2f8290740378bfd)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 09:55:49 +02:00
dependabot[bot]
f6ea56276f
build(deps): bump actions/setup-python from 2.3.1 to 3 (#29253)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2.3.1 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](f382193329...0ebf233433)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-03 19:10:47 +01:00
dependabot[bot]
ed6274a0bf
build(deps): bump actions/checkout from 2 to 3 (#29276)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...a12a3943b4bdde767164f792f33f40b04645d846)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-03 14:43:49 +01:00
Massimiliano Culpo
ffa58a20c6
CI: pin the version of pathlib to v2.3.6 (#28832) 2022-02-08 20:00:20 +00:00
Massimiliano Culpo
4bd761d1d5
Update actions/setup-python to latest version (#28634) 2022-01-28 14:17:59 +01:00
Massimiliano Culpo
b9b1665cb2
Pin the version of "coverage" in CI to 6.2 (#28638)
Hotfix for coverage v6.3 blocking our CI workflows
2022-01-27 20:35:05 +01:00
Massimiliano Culpo
82bdda9a89 Reduce the unit tests jobs for the original concretizer
Only test Python 2.7, 3.6 and 3.9
2021-12-23 16:45:06 +01:00
Massimiliano Culpo
948bc98fa6
Add a CI job to audit all the packages in the built-in repository (#27945)
* Add a CI job to audit all the packages in the built-in repository

* flecsi: fixed typo for dependency on legion

* py-pythonqwt: fix a typo in variant name

* sollve: removed a conflict with a non-existing variant

* acts: fixed use of wrong variant in dd4hep

Also removed duplicated variant declaration in dd4hep

* aoflagger: update variant of a dependency

Issues introduced indirectly in #22925

* camellia: removed unused variant

Issue introduced indirectly in #26150

* cbtf-*: remove cti variants and dependency on mrnet+cti

Issue introduced in #14178

* flecsale: update variants to match flecsi

Issue introduced in #11679

* grnboost: fixed issue with non-existing variant in a dependency

This package possibly never worked since #8763

* nalu: fixed issue with non-existing variant in a dependency

* open-iscsi: fixed issue with non-existing variant in a dependency

* openspeedshop-*: remove use of non-existing mrnet+cti variant

* percept: fixed issue with non-existing variant in a dependency

* phyluce: fixed issue with non-existing variant in a dependency

Issue introduced in #12952

* phyluce: fixed issue with non-existing variant in a dependency

Issue introduced in #22340
2021-12-13 10:44:15 -08:00
Massimiliano Culpo
fa7189b480
Remove support for Python 2.6 (#27256)
Modifications:
- [x] Removed `centos:6` unit test, adjusted vermin checks
- [x] Removed backport of `collections.OrderedDict`
- [x] Removed backport of `functools.total_ordering`
- [x] Removed Python 2.6 specific skip markers in unit tests
- [x] Fixed a few minor Python 2.6 related TODOs in code

Updating the vendored dependencies will be done in separate PRs
2021-11-23 09:06:17 -08:00
Massimiliano Culpo
f981682bdc
Allow recent pytest versions to be used with Spack (#25371)
Currently Spack vendors `pytest` at a version which is three major 
versions behind the latest (3.2.5 vs. 6.2.4). We do that since v3.2.5 
is the latest version supporting Python 2.6. Remaining so much 
behind the currently supported versions though might introduce 
some incompatibilities and is surely a technical debt.

This PR modifies Spack to:
- Use the vendored `pytest@3.2.5` only as a fallback solution, 
  if the Python interpreter used for Spack doesn't provide a newer one
- Be able to parse `pytest --collect-only` in all the different output 
  formats from v3.2.5 to v6.2.4 and use it consistently for `spack unit-test --list-*`
- Updating the unit tests in Github Actions to use a more recent `pytest` version
2021-11-18 15:08:59 +01:00
Harmen Stoppels
8f7640dbef
ci: run style unit tests only if we target develop (#27472)
Some tests assume the base branch is develop, but this branch may not
have been checked out.
2021-11-18 13:00:39 +01:00
dependabot[bot]
a382a6c0e2
build(deps): bump actions/checkout from 2.3.5 to 2.4.0 (#27179)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.5 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1e204e9a92...ec3a7ce113)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-03 02:52:28 +00:00
dependabot[bot]
94e0bf0112
build(deps): bump actions/checkout from 2.3.4 to 2.3.5 (#27135)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](5a4ac9002d...1e204e9a92)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-02 08:55:28 +01:00
Harmen Stoppels
6845307384
Pin actions to a commit sha instead of tag (#26538) 2021-11-01 10:44:03 -07:00
Massimiliano Culpo
3d5444fdd8
Remove documentation tests from GitHub Actions (#26981)
We moved documentation tests to readthedocs since a while,
so remove the one on GitHub.
2021-10-27 19:02:52 +02:00
Harmen Stoppels
7cec6476c7
Remove hard-coded repository in centos6 unit test (#26885)
This makes it easier to run tests in a fork.
2021-10-22 10:24:03 +02:00
dependabot[bot]
5d23638fdc
build(deps): bump codecov/codecov-action from 2.0.3 to 2.1.0 (#25925)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.3 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.0.3...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-15 16:02:05 +02:00
Massimiliano Culpo
c52426ea7a
Make clingo the default solver (#25502)
Modifications:
- [x] Change `defaults/config.yaml`
- [x] Add a fix for bootstrapping patchelf from sources if `compilers.yaml` is empty
- [x] Make `SPACK_TEST_SOLVER=clingo` the default for unit-tests
- [x] Fix package failures in the e4s pipeline

Caveats:
1. CentOS 6 still uses the original concretizer as it can't connect to the buildcache due to issues with `ssl` (bootstrapping from sources requires a C++14 capable compiler)
1. I had to update the image tag for GitlabCI in e699f14.  
1. libtool v2.4.2 has been deprecated and other packages received some update
2021-09-14 22:44:16 -07:00
dependabot[bot]
a2293e6ee1
build(deps): bump codecov/codecov-action from 2.0.2 to 2.0.3 (#25594)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 10:58:12 +02:00
Massimiliano Culpo
c152e558e9
Make SpecBuildInterface pickleable (#25628)
* Add a __reduce__ method to SpecBuildInterface

This class was confusing pickle when being serialized,
due to its scary nature of being an object that disguise
as another type.

* Add more MacOS tests, switch them to clingo

* Fix condition syntax

* Remove Python v3.6 and v3.9 with macOS
2021-08-27 09:10:03 +00:00
Massimiliano Culpo
10695f1ed3
Use kcov from official Ubuntu 20.04 repository (#25385)
* Ubuntu 20.04 provides kcov, so don't build from source

* Use two undocumented options for kcov v3.8
2021-08-19 14:03:10 -07:00
Massimiliano Culpo
4318ceb2b3
Bootstrap clingo from binaries (#22720)
* Bootstrap clingo from binaries

* Move information on clingo binaries to a JSON file

* Add support to bootstrap on Cray

Bootstrapping on Cray requires, at the moment, to
swap the platform when looking for binaries - due
to #22800.

* Add SHA256 verification for bootstrapped software

Use sha256 verification for binaries necessary to bootstrap
the concretizer and gpg for signature verification

* patchelf: use Spec._old_concretize() to bootstrap

As noted in #24450 we may happen to need the
concretizer when bootstrapping clingo. In that case
only the old concretizer is available.

* Add a schema for bootstrapping methods

Two fields have been added to bootstrap.yaml:
  "sources" which lists the methods available for
       bootstrapping software
  "trusted" which records if a source is trusted or not

A subcommand has been added to "spack bootstrap" to list
the sources currently available.

* Methods used for bootstrapping are configurable from bootstrap:sources

The function that tries to ensure a given Python module
is importable now tries bootstrapping methods in the same
order as they are defined in `bootstrap.yaml`

* Permit to trust/untrust bootstrapping methods

* Add binary tests for MacOS, Ubuntu

* Add documentation

* Add a note on bash
2021-08-18 11:14:02 -07:00
Todd Gamblin
c8efec0295
spack style: add --root option (#25085)
This adds a `--root` option so that `spack style` can check style for
a spack instance other than its own.

We also change the inner workings of `spack style` so that `--config FILE`
(and similar options for the various tools) options are used. This ensures
that when `spack style` runs, it always uses the config from the running spack,
and does *not* pick up configuration from the external root.

- [x] add `--root` option to `spack style`
- [x] add `--config` (or similar) option when invoking style tools
- [x] add a test that verifies we can check an external instance
2021-07-27 15:09:17 -06:00
vsoch
4208cf66be spack style: automatically bootstrap dependencies
This uses our bootstrapping logic to automatically install dependencies for
`spack style`. Users should no longer have to pre-install all of the tools
(`isort`, `mypy`, `black`, `flake8`). The command will do it for them.

- [x] add logic to bootstrap specs with specific version requirements in `spack style`
- [x] remove style tools from CI requirements (to ensure we test bootstrapping)
- [x] rework dependencies for `mypy` and `py-typed-ast`
      - `py-typed-ast` needs to be a link dependency
      - it needs to be at 1.4.1 or higher to work with python 3.9

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
2021-07-24 07:07:35 -07:00
Massimiliano Culpo
a30e6c6158
Bump codecov/action to v2.0.2 (#24983)
* build(deps): bump codecov/codecov-action from 1 to 2.0.1

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 2.0.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1...v2.0.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update arguments to codecov action

* Try to delete the symbolic link to root folder

Hopefully this should get rid of the ELOOP error

* Delete also for shell tests and MacOS

* Bump to v2.0.2

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-24 07:23:56 -04:00
Todd Gamblin
084bafe18c coverage: move config from .coveragerc to pyproject.toml
Getting rid of another top-level file.

`coverage.py` has supported `pyproject.toml` since version 5.0, and
all versions of coverage so far work with python 2.7. We just need to
ensure that a version of coverage with the `toml` extra is installed
in the test environment.

I tested this with `coverage run`, `coverage report`, and `coverage html`.
2021-07-09 22:49:47 -07:00
Todd Gamblin
eff7f20118
mypy: move configuration to pyproject.toml (#24802)
This moves our `mypy` configuration from `.mypy.ini` to `.pyproject.toml`
and increases the minimum `mypy` version in the tests.

- [x] move `mypy` configuration to `pyproject.toml`
- [x] remove `.mypy.ini`
- [x] ensure that `mypy` version .900 or higher is used in tests
2021-07-09 11:52:23 +02:00
Todd Gamblin
24c01d57cf
imports: sort imports everywhere in Spack (#24695)
* fix remaining flake8 errors

* imports: sort imports everywhere in Spack

We enabled import order checking in #23947, but fixing things manually drives
people crazy. This used `spack style --fix --all` from #24071 to automatically
sort everything in Spack so PR submitters won't have to deal with it.

This should go in after #24071, as it assumes we're using `isort`, not
`flake8-import-order` to order things. `isort` seems to be more flexible and
allows `llnl` mports to be in their own group before `spack` ones, so this
seems like a good switch.
2021-07-08 22:12:30 +00:00
Todd Gamblin
a22686279c cvs tests: don't use dateutil at all
`dateutil.parser` was an optional dependency for CVS tests. It was failing on macOS
beacuse the dateutil types were not being installed, and mypy was failing *even when the
CVS tests were skipped*. This seems like it was an oversight on macOS --
`types-dateutil-parser` was not installed there, though it was on Linux unit tests.

It takes 6 lines of YAML and some weird test-skipping logic to get `python-dateutil` and
`types-python-dateutil` installed in all the tests where we need them, but it only takes
4 lines of code to write the date parser we need for CVS, so I just did that instead.

Note that CVS date format can vary from system to system, but it seems like it's always
pretty similar for the parts we care about.

- [x] Replace dateutil.parser with a simpler date regex
- [x] Lose the dependency on `dateutil.parser`
2021-07-07 17:27:31 -07:00
Todd Gamblin
b5d2c30d26 style: Move isort configuration to pyproject.toml
- [x] Remove flake8-import-order checks, as we only need isort for this
- [x] Clean up configuration and requirements
2021-07-07 17:27:31 -07:00
Danny McClanahan
7a9fe189e1 style: add support for isort and --fix 2021-07-07 17:27:31 -07:00
Massimiliano Culpo
2b65c53d2b
vermin: show line numbers of violations (#24580)
This commit runs vermin with the --violations option
that shows details of the violations to target requirements.
2021-06-29 19:41:22 +02:00
Adam J. Stewart
2284007db9
Use flake8-import-order to enforce PEP-8 compliance (#23947) 2021-06-28 08:03:20 -05:00
Massimiliano Culpo
1bccd866ae
Fix broken CI for package only PRs, make dateutil not strictly required (#24484)
* Force the Python interpreter with an env variable

This commit forces the Python interpreter with an
environment variable, to ensure that the Python set
by the "setup-python" action is the one being used.

Due to the policy adopted by Spack to prefer python3
over python we may end up picking a Python 3.X
interpreter where Python 2.7 was meant to be used.

* Revert "Update conftest.py (#24473)"

This reverts commit 477c8ce820.

* Make python-dateutil a soft dependency for unit tests

Before #23212 people could clone spack and run
```
spack unit-tests
```
while now this is not possible, since python-dateutil is
a required but not vendored dependency. This change makes
it not a hard requirement, i.e. it will be used if found
in the current interpreter.

* Workaround mypy complaint
2021-06-23 07:56:07 -04:00
Erik Schnetter
e3b220f699
Implement CVS fetcher (#23212)
Spack packages can now fetch versions from CVS repositories. Note
this fetch mechanism is unsafe unless using :extssh:. Most public
CVS repositories use an insecure protocol implemented as part of CVS.
2021-06-22 09:51:31 -07:00
Massimiliano Culpo
fd03d539cc
mypy: add types-six to the list of installed packages (#24207)
See https://mypy-lang.blogspot.com/2021/05/the-upcoming-switch-to-modular-typeshed.html
for a broader explanation.
2021-06-08 20:46:25 +00:00
Todd Gamblin
d45674c1cb
Spack can Use RHEL8's platform-python if nothing else is available. (#23857)
This adds RHEL8's `/usr/libexec/platform-python` to Spack's list of preferred
pythons. It will only be used if no other `python` is available in the `PATH`.

We have been testing with this python for a while now, and it seems to do all
that we need. If Spack one day isn't able to work with it, we'll take it out,
but for now it is useful to allow Spack to be used on RHEL8 without a dedicated
`python` installation.
2021-05-22 15:35:07 -07:00
Massimiliano Culpo
46088aa5da
qa: install clingo-cffi from pip (#23163)
Clingo has been released on PyPI, so there
are no more concerns on our CI depending
on pypy.test for installing the wheel.

Apparently we have parts of Spack which
are not compatible with kcov > 3.4
2021-04-22 09:35:17 +02:00
Massimiliano Culpo
03e10b3cde
QA: reduce number of unit tests for jobs not in the matrix (#22426)
* QA: reduce number of unit tests for jobs not in the matrix

* Fixup for CentOS6 dependencies

* Put correct conditions back in place

* Add dependency on changes
2021-03-20 07:16:52 -07:00
Massimiliano Culpo
0209d15ffd
CI: treat push to develop in the same way as PRs (#22421) 2021-03-19 15:08:32 -07:00
Massimiliano Culpo
629f94b4e1
CI: drastically reduce the number of tests for package only PRs (#22410)
PRs that change only package recipes will only run tests under "package_sanity.py" and without coverage. This should result in a huge drop the cpu-time spent in CI for most PRs.
2021-03-19 11:04:53 -07:00
Massimiliano Culpo
2aab415f3d
The action to detect changes needs a repository to be checked out on push event (#22324) 2021-03-16 17:27:41 +00:00
Massimiliano Culpo
b304b4bdb0
Speed-up CI by reorganizing tests (#22247)
* unit tests: mark slow tests as "maybeslow"

This commit also removes the "network" marker and
marks every "network" test as "maybeslow". Tests
marked as db are maintained, but they're not slow
anymore.

* GA: require style tests to pass before running unit-tests

* GA: make MacOS unit tests fail fast

* GA: move all unit tests into the same workflow, run style tests as a prerequisite

All the unit tests have been moved into the same workflow so that a single
run of the dorny/paths-filter action can be used to ask for coverage based
on the files that have been changed in a PR. The basic idea is that for PRs
that introduce only changes to packages coverage is not necessary, this
resulting in a faster execution of the tests.

Also, for package only PRs slow unit tests are skipped.

Finally, MacOS and linux unit tests are now conditional on style tests passing
meaning that e.g. we won't waste a MacOS worker if we know that the PR has
flake8 issues.

* Addressed review comments

* Skipping slow tests on MacOS for package only recipes

* QA: make tests on changes correct before merging
2021-03-16 08:16:31 -07:00