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
This commit is contained in:
parent
12e87ebf14
commit
c152e558e9
4
.github/workflows/unit_tests.yaml
vendored
4
.github/workflows/unit_tests.yaml
vendored
@ -337,10 +337,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
brew install dash fish gcc gnupg2 kcov
|
brew install dash fish gcc gnupg2 kcov
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
|
env:
|
||||||
|
SPACK_TEST_SOLVER: clingo
|
||||||
run: |
|
run: |
|
||||||
git --version
|
git --version
|
||||||
. .github/workflows/setup_git.sh
|
. .github/workflows/setup_git.sh
|
||||||
. share/spack/setup-env.sh
|
. share/spack/setup-env.sh
|
||||||
|
$(which spack) bootstrap untrust spack-install
|
||||||
|
$(which spack) solve zlib
|
||||||
if [ "${{ needs.changes.outputs.with_coverage }}" == "true" ]
|
if [ "${{ needs.changes.outputs.with_coverage }}" == "true" ]
|
||||||
then
|
then
|
||||||
coverage run $(which spack) unit-test -x
|
coverage run $(which spack) unit-test -x
|
||||||
|
@ -1019,7 +1019,9 @@ class SpecBuildInterface(lang.ObjectWrapper):
|
|||||||
|
|
||||||
def __init__(self, spec, name, query_parameters):
|
def __init__(self, spec, name, query_parameters):
|
||||||
super(SpecBuildInterface, self).__init__(spec)
|
super(SpecBuildInterface, self).__init__(spec)
|
||||||
|
# Adding new attributes goes after super() call since the ObjectWrapper
|
||||||
|
# resets __dict__ to behave like the passed object
|
||||||
|
self.token = spec, name, query_parameters
|
||||||
is_virtual = spack.repo.path.is_virtual(name)
|
is_virtual = spack.repo.path.is_virtual(name)
|
||||||
self.last_query = QueryState(
|
self.last_query = QueryState(
|
||||||
name=name,
|
name=name,
|
||||||
@ -1027,6 +1029,9 @@ def __init__(self, spec, name, query_parameters):
|
|||||||
isvirtual=is_virtual
|
isvirtual=is_virtual
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __reduce__(self):
|
||||||
|
return SpecBuildInterface, self.token
|
||||||
|
|
||||||
|
|
||||||
@lang.lazy_lexicographic_ordering(set_hash=False)
|
@lang.lazy_lexicographic_ordering(set_hash=False)
|
||||||
class Spec(object):
|
class Spec(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user