diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06a5b57fd3790d01a739fdeea5d42b0a976e9e5c..540dd471d259d7b7581de031fb06fb98296fe921 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -168,11 +168,16 @@ build-spack-env-on-runner: script: - git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch $SPACK_VERSION https://github.com/spack/spack $SPACK_DEV_PATH - cp packages.yaml $SPACK_DEV_PATH/etc/spack/packages.yaml + # SPACK PATCH: see https://github.com/spack/spack/pull/35290 + - sed -i 's/solver.solve(abstract_specs)/solver.solve(abstract_specs, tests=kwargs.get("tests", False))/g' $SPACK_DEV_PATH/lib/spack/spack/concretize.py + # the post-build logs on install-time-test-logs.txt gets ovewritten by the post-install logs. + # quick fix for that: (TODO: investigate more and open PR) + - sed -i "s/self.file_like, 'w'/self.file_like, 'a'/g" $SPACK_DEV_PATH/lib/spack/llnl/util/tty/log.py - | cat <<EOF > $SPACK_DEV_PATH/etc/spack/defaults/upstreams.yaml upstreams: ebrains-gitlab-spack-instance: - install_tree: /mnt/spack_v0.18.1/opt/spack + install_tree: /mnt/spack_v0.18.1_t/opt/spack EOF - . $SPACK_DEV_PATH/share/spack/setup-env.sh - spack find @@ -181,8 +186,7 @@ build-spack-env-on-runner: - spack repo add . - spack env create $SPACK_DEV_ENV spack.yaml - spack env activate $SPACK_DEV_ENV - - spack concretize -f --fresh - - spack install -y -j2 --fresh --no-check-signature + - spack install -y -j2 --fresh --test root after_script: - mkdir spack_logs - | @@ -214,7 +218,6 @@ build-spack-env-on-runner: # - "$SPACK_USER_CONFIG_PATH" # when: always - sync-gitlab-spack-instance: stage: build tags: @@ -223,15 +226,21 @@ sync-gitlab-spack-instance: image: docker-registry.ebrains.eu/tc/ebrains-spack-build-env/gitlab_runners_nfs:gitlab_runners_nfs_22.09 variables: SPACK_NFS_ENV: ebrains-runner-build - SPACK_PATH: /mnt/spack_v0.18.1 + SPACK_PATH: /mnt/spack_v0.18.1_t SPACK_USER_CACHE_PATH: $SPACK_PATH/.spack SPACK_USER_CONFIG_PATH: $SPACK_PATH/.spack SPACK_REPO_PATH: $SPACK_PATH/ebrains-spack-builds script: + - echo $CI_PROJECT_NAMESPACE - | if [ ! -d $SPACK_PATH ]; then git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch $SPACK_VERSION https://github.com/spack/spack $SPACK_PATH fi + # SPACK PATCH: see https://github.com/spack/spack/pull/35290 + - sed -i 's/solver.solve(abstract_specs)/solver.solve(abstract_specs, tests=kwargs.get("tests", False))/g' $SPACK_PATH/lib/spack/spack/concretize.py + # the post-build logs on install-time-test-logs.txt gets ovewritten by the post-install logs. + # quick fix for that: (TODO: investigate more and open PR) + - sed -i "s/self.file_like, 'w'/self.file_like, 'a'/g" $SPACK_PATH/lib/spack/llnl/util/tty/log.py - cp $CI_PROJECT_DIR/packages.yaml $SPACK_PATH/etc/spack/packages.yaml - . $SPACK_PATH/share/spack/setup-env.sh # - spack bootstrap untrust github-actions @@ -249,8 +258,10 @@ sync-gitlab-spack-instance: - spack env list | grep -q $SPACK_NFS_ENV && echo "Environment created already" || spack env create $SPACK_NFS_ENV $CI_PROJECT_DIR/spack.yaml - spack env activate $SPACK_NFS_ENV - cp $CI_PROJECT_DIR/spack.yaml $SPACK_ROOT/var/spack/environments/$SPACK_NFS_ENV/spack.yaml - - spack concretize -f --fresh - - spack install -y -j2 --fresh --no-check-signature + # There is a known spack bug (https://github.com/spack/spack/issues/29447) in installing test dependencies for installation tests. The workaround suggested + # in the issue is to NOT concretize separately, but simply remove the .lock file and let the enironment be concretized by the spack install command: + - rm $SPACK_ROOT/var/spack/environments/$SPACK_NFS_ENV/spack.lock || echo "No spack.lock file" + - spack install -y -j2 --fresh --test root - spack module tcl refresh -y - spack reindex - spack env loads -r @@ -276,5 +287,5 @@ sync-gitlab-spack-instance: - spack_logs when: always rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_NAMESPACE =~ /technical-coordination/ + - if: '$CI_COMMIT_BRANCH =~ /test-spacktests-workaround/ && $CI_PROJECT_NAMESPACE =~ /technical-coordination/' when: manual diff --git a/install_spack_env.sh b/install_spack_env.sh index 761c751e88eeaacffcb9c2491bd53615493a4356..c5aaa511890310e7df2b1f8f615b4e9812643b76 100644 --- a/install_spack_env.sh +++ b/install_spack_env.sh @@ -21,6 +21,9 @@ if [ ! -d $INSTALLATION_ROOT/spack ] then git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch $SPACK_VERSION https://github.com/spack/spack $INSTALLATION_ROOT/spack fi +# SPACK PATCH: see https://github.com/spack/spack/pull/35290 +sed -i 's/solver.solve(abstract_specs)/solver.solve(abstract_specs, tests=kwargs.get("tests", False))/g' $SPACK_PATH/lib/spack/spack/concretize.py + cp $EBRAINS_REPO/packages.yaml $INSTALLATION_ROOT/spack/etc/spack/packages.yaml source $INSTALLATION_ROOT/spack/share/spack/setup-env.sh @@ -46,10 +49,13 @@ fi # activate environment cp $EBRAINS_REPO/spack.yaml $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/spack.yaml spack env activate $EBRAINS_SPACK_ENV -# remove any existing concrete specs from spack.lock and re-concretize everything -spack concretize --fresh --force +# There is a known spack bug (https://github.com/spack/spack/issues/29447) in installing test dependencies +# for installation tests. The workaround suggested in the issue is to NOT concretize separately, but simply +# remove the .lock file and let the enironment be concretized by the spack install command: +rm $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/spack.lock || echo "No spack.lock file" # install the environment, use 2 jobs to reduce the amount of required RAM -spack install --fresh --no-check-signature -y -j2 +spack install -y -j2 --fresh --test root + # rebuild spack's database spack reindex diff --git a/packages/apbs/package.py b/packages/apbs/package.py index f53769a3f2e5b2ce8008067ce7e79bd1493a6d74..5cae20099c56c7263fe06ec5d1b8847964a43bbb 100644 --- a/packages/apbs/package.py +++ b/packages/apbs/package.py @@ -57,6 +57,9 @@ class Apbs(CMakePackage): # add suite-sparse libs to path because tests can't find them env.prepend_path("LD_LIBRARY_PATH", self.spec['suite-sparse'].prefix.lib) + def setup_dependent_build_environment(self, env, dependent_spec): + self.setup_build_environment(env) + @run_after('install') @on_package_attributes(run_tests=True) def install_test(self): diff --git a/packages/arbor/package.py b/packages/arbor/package.py index 34a30425b85d0185301a52855a1786444ab8e264..2f93d3cfab50b9e0196e01a7dda44062686a2866 100644 --- a/packages/arbor/package.py +++ b/packages/arbor/package.py @@ -123,3 +123,8 @@ class Arbor(CMakePackage, CudaPackage): args.append("-DARB_CXX_FLAGS_TARGET=" + opt_flags) return args + + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + python('-c', 'import arbor') diff --git a/packages/nest/package.py b/packages/nest/package.py index 4bfe0ce98a631faa13bd62a5bcaf3fdb4098bd30..aa32a588983ca6033eb221f65206a64bc724e701 100644 --- a/packages/nest/package.py +++ b/packages/nest/package.py @@ -60,6 +60,8 @@ class Nest(CMakePackage): description="Enable GNU Scientific Library") variant('shared', default=True, description="Build shared libraries") + variant('testsuite', default=False, + description="Run extended testsuite with full number of unit- and integration tests") variant('boost', default=True, description="Enable optimizations provided via Boost library algorithms and containers") # TODO add variants for neurosim and music when these are in spack @@ -76,20 +78,35 @@ class Nest(CMakePackage): depends_on('python@2.6:', when='@2.16:+python', type=('build', 'run')) depends_on('python@3.8:', when='@3:', type=('build', 'run')) depends_on('py-numpy@:1.16.99', when='@:2.14.99+python', type=('build', 'run')) - depends_on('py-numpy', when='+python', type=('build', 'run')) + depends_on('py-numpy', when='+python', type=('build', 'run', 'test')) + depends_on('py-pandas', when='@3:', type=('test')) depends_on('py-cython@0.19.2:', when='+python', type='build') - depends_on('py-nose', when='+python', type='test') depends_on('py-setuptools', when='+python', type='build') depends_on('boost', when="@2.16:+boost", type='build') depends_on('py-setuptools@:44.99.99', when='@:2.15.99+python', type='build') - depends_on('mpi', when='+mpi') - depends_on('doxygen', type='build') - depends_on('gsl', when='+gsl') - depends_on('readline') - depends_on('ncurses') - depends_on('libtool') - depends_on('pkgconfig', type='build') + depends_on('py-nose', when='@:2.99.99+python+testsuite', type='test') + depends_on('py-pytest', when='@3.0:+testsuite', type='test') + depends_on('py-pytest-xdist', when='@3.0:+testsuite', type='test') + depends_on('py-pytest-timeout', when='@3.0:+testsuite', type='test') + depends_on('py-junitparser@2:', when='+testsuite', type='test') + depends_on('py-terminaltables', when='@3:+testsuite', type='test') + depends_on('py-pycodestyle', when='@3:+testsuite', type='test') + depends_on('cppcheck', when='+testsuite', type='test') + + # for `clang-format` + depends_on('py-clang-format@3.6', when='@:3.1.99+testsuite', type='test') + depends_on('py-clang-format@9', when='@3.2:3.3.99+testsuite', type='test') + depends_on('py-clang-format@13', when='@3.4:+testsuite', type='test') + + depends_on('mpi', when='+mpi') + depends_on('py-mpi4py', when='+python+mpi', type=('run', 'test')) + depends_on('doxygen', type='build') + depends_on('gsl', when='+gsl') + depends_on('readline', type=('build', 'run', 'test')) + depends_on('ncurses', type=('build', 'run', 'test')) + depends_on('libtool', type=('build', 'run', 'test')) + depends_on('pkgconfig', type='build') extends('python', when='+python') @@ -179,12 +196,31 @@ class Nest(CMakePackage): @run_after('install') @on_package_attributes(run_tests=True) def installcheck(self): - make("installcheck") + if self.spec.variants['testsuite'].value: + print(''' + ########################################## + ### + ### RUNNING MAKE INSTALLCHECK + ### + ########################################## + ''') + with working_dir(self.build_directory): + make("installcheck") def setup_run_environment(self, env): pass + @run_after('install') + @on_package_attributes(run_tests=True) def install_test(self): # test inspired by py-numpy spack package with working_dir('spack-test', create=True): python('-c', 'from pprint import pprint; import nest; pprint(nest.get())') + + @when('@2.11.0:') + @run_after('build') + @on_package_attributes(run_tests=True) + def check(self): + # 'make test' currently does not run any useful tests, as the focus is on 'make installcheck'. + # So we override this to no-op and use a post-install method instead (see above). + pass diff --git a/packages/neuron/package.py b/packages/neuron/package.py index e3c181ab50b832ff9683bfe055379218324b9e26..25ea3219cf0c17ea98566bced345622169280710 100644 --- a/packages/neuron/package.py +++ b/packages/neuron/package.py @@ -145,8 +145,16 @@ class Neuron(CMakePackage): env.prepend_path("PYTHONPATH", self.spec.prefix.lib.python) # override setup_{build/run}_environment for standalone package tests + def setup_build_environment(self, env): + self.setup_run_environment(env) + def setup_dependent_build_environment(self, env, dependent_spec): self.setup_run_environment(env) def setup_dependent_run_environment(self, env, dependent_spec): self.setup_run_environment(env) + + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + python('-c', 'import neuron') diff --git a/packages/py-bct/package.py b/packages/py-bct/package.py new file mode 100644 index 0000000000000000000000000000000000000000..9b65a3869640da2e6a6e07d6f53e3def4bbcde7a --- /dev/null +++ b/packages/py-bct/package.py @@ -0,0 +1,33 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyBct(PythonPackage): + """ + Requirement necessary for py-tvb-framework package. + """ + + homepage = "https://pypi.org/project/bctpy/" + pypi = 'bctpy/bctpy-0.6.0.tar.gz' + + maintainers = ['paulapopa', 'ldomide'] + + version('0.6.0', '36392049ec5a2ccae75a0cf89b21838fda41a351c31fe6c6622cfcff1c997933') + + # python_requires + depends_on('python@3.8:', type=('build', 'run')) + + # setup_requires + depends_on('py-pip', type=('build')) + depends_on('py-setuptools', type='build') + depends_on('py-numpy', type=('build', 'run')) + depends_on('py-scipy', type=('build', 'run')) + depends_on('py-tox', type=('build', 'run')) + depends_on('py-duecredit', type=('build', 'run')) + + depends_on('py-pytest', type='test') + diff --git a/packages/py-cerebrus/package.py b/packages/py-cerebrus/package.py index a274ddea09dcb5e3303d9dc6f6befe63a8dce854..0377acb86dfc47eea4f380d22bd40cba16d68f64 100644 --- a/packages/py-cerebrus/package.py +++ b/packages/py-cerebrus/package.py @@ -17,4 +17,5 @@ class PyCerebrus(PythonPackage): version('1.3.4', sha256='d1b21b3954b2498d9a79edf16b3170a3ac1021df88d197dc2ce5928ba519237c') depends_on('python@3.6.9:') - depends_on('py-setuptools', type=('build', 'run')) \ No newline at end of file + depends_on('py-setuptools', type=('build', 'run')) + depends_on('py-pytest', type=('test')) diff --git a/packages/py-clang-format/package.py b/packages/py-clang-format/package.py new file mode 100644 index 0000000000000000000000000000000000000000..8ff04332f6dbdf6f06f575f0b192180fc73e438c --- /dev/null +++ b/packages/py-clang-format/package.py @@ -0,0 +1,46 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyClangFormat(PythonPackage): + """FIXME: Put a proper description of your package here.""" + + homepage = "https://pypi.org/project/clang-format" + url = "https://files.pythonhosted.org/packages/17/fd/723876a1e55397e4b060f2e9e3d4a5e4820f6e09ea05fe8c8cf4ddfd1ae8/clang_format-13.0.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl" + + maintainers = ['terhorstd'] + + version('13.0.1', url='https://files.pythonhosted.org/packages/17/fd/723876a1e55397e4b060f2e9e3d4a5e4820f6e09ea05fe8c8cf4ddfd1ae8/clang_format-13.0.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl', sha256='58e91debc2b2d14d174c73c678ffac676cb171152ee3f4239b6cbe6975e4ede1', expand=False) + version('9.0.0', url='https://files.pythonhosted.org/packages/25/f2/d989afaf8a91385f18fd06e6202644be0bc3a1d14548c18a8ece4911e005/clang_format-9.0.0-py2.py3-none-manylinux1_x86_64.whl', sha256='085342f9e238c9b03a019e20ec23f242f8795a3cca9296ab2427b1dea45e7014', expand=False) + + # FIXME: Only add the python/pip/wheel dependencies if you need specific versions + # or need to change the dependency type. Generic python/pip/wheel dependencies are + # added implicity by the PythonPackage base class. + # depends_on('python@2.X:2.Y,3.Z:', type=('build', 'run')) + # depends_on('py-pip@X.Y:', type='build') + # depends_on('py-wheel@X.Y:', type='build') + + # FIXME: Add a build backend, usually defined in pyproject.toml. If no such file + # exists, use setuptools. + # depends_on('py-setuptools', type='build') + # depends_on('py-flit-core', type='build') + # depends_on('py-poetry-core', type='build') + + # FIXME: Add additional dependencies if required. + # depends_on('py-foo', type=('build', 'run')) + + #def global_options(self, spec, prefix): + # # FIXME: Add options to pass to setup.py + # # FIXME: If not needed, delete this function + # options = [] + # return options + + #def install_options(self, spec, prefix): + # # FIXME: Add options to pass to setup.py install + # # FIXME: If not needed, delete this function + # options = [] + # return options diff --git a/packages/py-elephant/package.py b/packages/py-elephant/package.py index ded03723a95c7230903030e02165689b328119f0..779cae51a435195416b06b32aa29fbaa28d34637 100644 --- a/packages/py-elephant/package.py +++ b/packages/py-elephant/package.py @@ -3,53 +3,79 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack import * +from spack.package import * class PyElephant(PythonPackage): - """Elephant is a package for analysis of electrophysiology data in Python - """ + """Elephant is a package for analysis of electrophysiology data in Python""" homepage = "http://neuralensemble.org/elephant/" pypi = "elephant/elephant-0.11.0.tar.gz" git = "https://github.com/NeuralEnsemble/elephant.git" # list of GitHub accounts to notify when the package is updated. - maintainers = ['Moritz-Alexander-Kern'] - - version('0.11.2', sha256='f8759fff0bbb136ae4ffc8d1eacadeea8ba56610d705c3bf207de87ada3ba240') - version('0.11.1', sha256='d604a202583440fdf9d95d42cef50a410bd74fcaaa1a925b139435f27ab012ef') - version('0.11.0', sha256='7b547964dbd196361edc922db2c5a7c0c886ef1effcca6c6dc7adb06f966a3be') - version('0.10.0', sha256='7e69a113475e4db01b3563328953c037d37f1597d9f2edf0d51fb65e9aebf096') - version('0.9.0', sha256='3e3d4a8e45d708f48bdcadcc4933c66f757d1ede6a1e172af0c07331b64ca180') - version('0.8.0', sha256='f7c2649d5b7cfdbaa4442457c75f86af01cc8e7ce2c63f5b3d4687bb94e10af2') - version('0.7.0', sha256='76785fe10c40042504928fde2fc57182230bbe39cf0fb0dcaffaba76219b046a') - version('0.6.4', sha256='b8c5f2c00ad3249e1fe428d0b8a1dbcaee4a69464481f5f8fd55d2f7f22c45a3') - version('0.4.1', sha256='86b21a44cbacdc09a6ba6f51738dcd5b42ecd553d73acb29f71a0be7c82eac81') - version('0.3.0', sha256='747251ccfb5820bdead6391411b5faf205b4ddf3ababaefe865f50b16540cfef') - - variant('docs', default=False, description='Install documentation dependencies') - variant('pandas', default=False, description='Build with pandas', when='@0.3.0:0.4.1') - variant('extras', default=True, description='Build with extras for GPFA, ASSET', when='@0.6.4:') - - depends_on('py-setuptools', type='build') - depends_on('python@3.7:', type=('build', 'run'), when='@0.11.0:') - depends_on('py-neo@0.3.4:', type=('build', 'run'), when='@0.3.0:0.4.1') # > 0.3.3 ? - depends_on('py-numpy@1.8.2:', type=('build', 'run'), when='@0.3.0:0.4.1') - depends_on('py-quantities@0.10.1:', type=('build', 'run'), when='@0.3.0:0.4.1') - depends_on('py-scipy@0.14.0:', type=('build', 'run'), when='@0.3.0:0.4.1') - depends_on('py-pandas@0.14.1:', type=('build', 'run'), when='+pandas') - depends_on('py-numpydoc@0.5:', type=('build', 'run'), when='+docs') - depends_on('py-sphinx@1.2.2:', type=('build', 'run'), when='+docs') - depends_on('py-pandas@0.18.0:', type=('build', 'run'), when='+extras') - depends_on('py-scikit-learn@0.23.2:', type=('build', 'run'), when='+extras') - depends_on('py-statsmodels@0.12.1:', type=('build', 'run'), when='+extras') - depends_on('py-jinja2@2.11.2:', type=('build', 'run'), when='+extras') - depends_on('py-neo@0.10.0:', type=('build', 'run'), when='@0.11.0:') - depends_on('py-neo@0.9.0', type=('build', 'run'), when='@0.9.0:0.10.0') - depends_on('py-neo@0.8.0', type=('build', 'run'), when='@0.6.4:0.8.0') - depends_on('py-numpy@1.18.1:', type=('build', 'run'), when='@0.6.4:') - depends_on('py-quantities@0.12.1:', type=('build', 'run'), when='@0.6.4:') - depends_on('py-scipy@1.5.4:', type=('build', 'run'), when='@0.6.4:') - depends_on('py-six@1.10.0:', type=('build', 'run'), when='@0.6.4:') - depends_on('py-tqdm', type=('build', 'run'), when='@0.6.4:') + maintainers = ["Moritz-Alexander-Kern"] + + version('develop', branch='master') + version("0.12.0", sha256="81f8d668f92d8688344bb7a9c5abaa8438d824560c935a411e6e36ddf7dc7c72") + version("0.11.2", sha256="f8759fff0bbb136ae4ffc8d1eacadeea8ba56610d705c3bf207de87ada3ba240") + version("0.11.1", sha256="d604a202583440fdf9d95d42cef50a410bd74fcaaa1a925b139435f27ab012ef") + version("0.11.0", sha256="7b547964dbd196361edc922db2c5a7c0c886ef1effcca6c6dc7adb06f966a3be") + version("0.10.0", sha256="7e69a113475e4db01b3563328953c037d37f1597d9f2edf0d51fb65e9aebf096") + version("0.9.0", sha256="3e3d4a8e45d708f48bdcadcc4933c66f757d1ede6a1e172af0c07331b64ca180") + version("0.8.0", sha256="f7c2649d5b7cfdbaa4442457c75f86af01cc8e7ce2c63f5b3d4687bb94e10af2") + version("0.7.0", sha256="76785fe10c40042504928fde2fc57182230bbe39cf0fb0dcaffaba76219b046a") + version("0.6.4", sha256="b8c5f2c00ad3249e1fe428d0b8a1dbcaee4a69464481f5f8fd55d2f7f22c45a3") + version("0.4.1", sha256="86b21a44cbacdc09a6ba6f51738dcd5b42ecd553d73acb29f71a0be7c82eac81") + version("0.3.0", sha256="747251ccfb5820bdead6391411b5faf205b4ddf3ababaefe865f50b16540cfef") + + variant("docs", default=False, description="Install documentation dependencies") + variant( + "extras", default=False, description="Build with extras for GPFA, ASSET", when="@0.6.4:" + ) + + depends_on("py-setuptools", type="build") + depends_on("python@3.7:", type=("build", "run"), when="@0.11.0:") + depends_on("py-neo@0.3.4:", type=("build", "run"), when="@0.3.0:0.4.1") + depends_on("py-numpy@1.8.2:", type=("build", "run"), when="@0.3.0:0.4.1") + depends_on("py-quantities@0.10.1:0.13.0", type=("build", "run"), when="@0.3.0:0.4.1") + depends_on("py-scipy@0.14.0:", type=("build", "run"), when="@0.3.0:0.4.1") + depends_on("py-pandas@0.14.1:", type=("build", "run"), when="+extras") + depends_on("py-numpydoc@0.5:", type=("build", "run"), when="@0.3.0:0.8.0+docs") + depends_on("py-numpydoc@1.1.0:", type=("build", "run"), when="@0.9.0:+docs") + depends_on("py-sphinx@1.2.2:", type=("build", "run"), when="@0.3.0:0.6.0+docs") + depends_on("py-sphinx@2.4.3:", type=("build", "run"), when="@0.7.0:0.8.0+docs") + depends_on("py-sphinx@3.3.0:", type=("build", "run"), when="@0.9.0:+docs") + depends_on("py-jupyter@1.0.0:", type=("build", "run"), when="@0.7.0:+docs") + depends_on("py-nbsphinx@0.5.0:", type=("build", "run"), when="@0.7.0:0.8.0+docs") + depends_on("py-nbsphinx@0.8.0:", type=("build", "run"), when="@0.9.0:+docs") + depends_on("py-sphinxcontrib-bibtex@1.0.0", type=("build", "run"), when="@0.7.0:+docs") + depends_on("py-sphinx-tabs@1.1.13:", type=("build", "run"), when="@0.7.0:0.8.0+docs") + depends_on("py-sphinx-tabs@1.3.0:", type=("build", "run"), when="@0.9.0:+docs") + depends_on("py-matplotlib@3.1.0:", type=("build", "run"), when="@0.8.0+docs") + depends_on("py-matplotlib@3.3.2:", type=("build", "run"), when="@0.9.0:+docs") + depends_on("py-pandas@0.18.0:", type=("build", "run"), when="+extras") + depends_on("py-scikit-learn@0.23.2:", type=("build", "run"), when="+extras") + depends_on("py-statsmodels@0.12.1:", type=("build", "run"), when="+extras") + depends_on("py-jinja2@2.11.2:", type=("build", "run"), when="+extras") + depends_on("py-neo@0.10.0:", type=("build", "run"), when="@0.11.0:") + depends_on("py-neo@0.9.0", type=("build", "run"), when="@0.9.0:0.10.0") + depends_on("py-neo@0.8.0", type=("build", "run"), when="@0.6.4:0.8.0") + depends_on("py-numpy@1.18.1:1.23.5", type=("build", "run"), when="@0.6.4:0.11.2") + depends_on("py-numpy@1.18.1:", type=("build", "run"), when="@0.12.0:") + depends_on("py-numpy@1.18.1:", type=("build", "run"), when="@develop") + depends_on("py-quantities@0.12.1:0.13.0", type=("build", "run"), when="@0.6.4:0.11.2") + depends_on("py-quantities@0.14.0:", type=("build", "run"), when="@develop") + depends_on("py-quantities@0.14.1:", type=("build", "run"), when="@0.12.0:") + depends_on("py-scipy@1.5.4:", type=("build", "run"), when="@0.6.4:") + depends_on("py-six@1.10.0:", type=("build", "run"), when="@0.6.4:") + depends_on("py-tqdm", type=("build", "run"), when="@0.6.4:") + depends_on("py-pytest", type=("test"), when="@0.6.4:") + depends_on("py-statsmodels@0.12.1:", type=("test"),when="@0.6.4:") + + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + # run tests here (this is just an example): + pytest = which('pytest') + pytest() diff --git a/packages/py-flask-restx/package.py b/packages/py-flask-restx/package.py new file mode 100644 index 0000000000000000000000000000000000000000..df6f3888144604b1af1d80f09c7a7382da2ea34d --- /dev/null +++ b/packages/py-flask-restx/package.py @@ -0,0 +1,31 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyFlaskRestx(PythonPackage): + """ + Requirement necessary for py-tvb-framework package. + """ + + homepage = "https://pypi.org/project/flask-restx" + pypi = 'flask-restx/flask-restx-1.0.5.tar.gz' + + maintainers = ['paulapopa', 'ldomide'] + + version('1.0.5', 'e23dc4ff24869c92faa719b7a58be1203ed741275ff32c9f03d0ab56ed01546c') + + # python_requires + depends_on('python@3.8:', type=('build', 'run')) + + # setup_requires + depends_on('py-pip', type=('build')) + depends_on('py-flask', type=('build', 'run')) + depends_on('py-aniso8601', type=('build', 'run')) + depends_on('py-jsonschema', type=('build', 'run')) + depends_on('py-pytz', type=('build', 'run')) + depends_on('py-werkzeug', type=('build', 'run')) + diff --git a/packages/py-formencode/package.py b/packages/py-formencode/package.py index 7f78c770f65ef224378cadf77f1b9bddbcfdf8c0..de5983bdbdf1862ab966b388f94d9839a17ff0a3 100644 --- a/packages/py-formencode/package.py +++ b/packages/py-formencode/package.py @@ -8,14 +8,15 @@ from spack import * class PyFormencode(PythonPackage): """ - Requirement necessary for tvb-framework package. + Requirement necessary for py-tvb-framework package. """ homepage = "https://pypi.org/project/FormEncode" - pypi = 'FormEncode/FormEncode-2.0.0.tar.gz' + pypi = 'FormEncode/FormEncode-2.0.1.tar.gz' - maintainers = ['paulapopa'] + maintainers = ['paulapopa', 'ldomide'] + version('2.0.1', '8f2974112c2557839d5bae8b76490104c03830785d923abbdef148bf3f710035') version('2.0.0', 'f2eb92297417eb64e4aa8e368783a5ac1311e385d4f3ff3a181090608ea83711') # python_requires diff --git a/packages/py-frites/package.py b/packages/py-frites/package.py index 33622ed8765cfc6d15d625cd270b7df40cf1dfa1..3c9d569f8f90fcbb0249df248d6cbb2ad00dbb29 100644 --- a/packages/py-frites/package.py +++ b/packages/py-frites/package.py @@ -59,3 +59,4 @@ class PyFrites(PythonPackage): depends_on('py-netcdf4', type=('build', 'run')) depends_on('py-h5netcdf', type=('build', 'run')) depends_on('py-scikit-learn', type=('build', 'run')) + depends_on('py-decorator', type=('build', 'run')) diff --git a/packages/py-hippounit/package.py b/packages/py-hippounit/package.py index 1b82e32326b050f2c7785024795ab2c936b98546..2ed9e0bfd0f409a48e333b7917890dba922a3836 100644 --- a/packages/py-hippounit/package.py +++ b/packages/py-hippounit/package.py @@ -17,5 +17,6 @@ class PyHippounit(PythonPackage): version('1.3.6', sha256='7342f77575b6d223db4194be37ab73f0eb6370844cbefd2f8374b2c7e27d7d15') depends_on('python@3.6.9:') + depends_on('py-future', type=('build', 'run')) depends_on('py-sciunit@0.2.5.1:', type=('build', 'run')) depends_on('py-efel@4.0.4:', type=('build', 'run')) diff --git a/packages/py-junitparser/package.py b/packages/py-junitparser/package.py new file mode 100644 index 0000000000000000000000000000000000000000..7a1cf8d23ce45645c168c9a4d752523794114338 --- /dev/null +++ b/packages/py-junitparser/package.py @@ -0,0 +1,30 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyJunitparser(PythonPackage): + """ + junitparser handles JUnit/xUnit Result XML files. Use it to parse and + manipulate existing Result XML files, or create new JUnit/xUnit result XMLs + from scratch. + """ + + homepage = "https://github.com/weiwei/junitparser" + #url = "https://files.pythonhosted.org/packages/py2.py3/j/junitparser/junitparser-2.8.0-py2.py3-none-any.whl" + url = "https://github.com/weiwei/junitparser/archive/refs/tags/2.8.0.tar.gz" + + maintainers = ['terhorstd'] + + version('2.8.0', sha256='94f7e0e45a1e6d729e35f29f28d06d5d314f17bdf68c9a4b1abc20eff0a6cca5') + + # Only add the python dependency if you need specific versions. A generic + # python dependency is added implicity by the PythonPackage class. + # depends_on('python@2.X:2.Y,3.Z:', type=('build', 'run')) + depends_on('py-setuptools@44.0:', type='build') + depends_on('py-wheel@0.37:', type=('build', 'run')) + depends_on('py-future', type=('build', 'run')) + diff --git a/packages/py-lems/package.py b/packages/py-lems/package.py new file mode 100644 index 0000000000000000000000000000000000000000..74db6f060092bec77d632fd1b847273b73a800f2 --- /dev/null +++ b/packages/py-lems/package.py @@ -0,0 +1,26 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyLems(PythonPackage): + """ + Requirement necessary for py-tvb-library package. + """ + + homepage = "https://pypi.org/project/PyLEMS/" + pypi = 'PyLEMS/PyLEMS-0.6.0.tar.gz' + + maintainers = ['paulapopa', 'ldomide'] + + version('0.6.0', '809cb1186be18fc0390f9656677847d3a2666cfae816ed82897cc91dfdfa8a1c') + + # python_requires + depends_on('python@3.8:', type=('build', 'run')) + + # setup_requires + depends_on('py-pip', type=('build')) + depends_on('py-setuptools', type=('build', 'run')) diff --git a/packages/py-lfpy/package.py b/packages/py-lfpy/package.py index f5c0f23bda1204d41a3ce573f472e220e6756cbb..0d0ae426730d2c48afd9b9acc9034ba6e06be1e9 100644 --- a/packages/py-lfpy/package.py +++ b/packages/py-lfpy/package.py @@ -10,7 +10,7 @@ class PyLfpy(PythonPackage): pypi = "LFPy/LFPy-2.3.tar.gz" git = 'https://github.com/LFPy/LFPy.git' - maintainers = ['espenhgn'] + maintainers = ['espenhgn', 'ness'] version('2.2.6', sha256='105046db3628c6f72a6ab96ee8ac0f4833bf8eee428dcee50cb7f2926b755966') version('2.3', sha256='29b2551fcd0391dcc5fa378750e2fcf58bec68f75568b590823c9b105da0c97e') @@ -27,3 +27,12 @@ class PyLfpy(PythonPackage): depends_on('neuron@7.7.2:', type=('build', 'run')) depends_on('py-lfpykit@0.5:', type=('build', 'run')) depends_on('py-pytest', type='test') + + + # Code to run post installation tests + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + with working_dir('spack-test', create=True): + python('-c', 'import LFPy; LFPy.run_tests()') + diff --git a/packages/py-pyaescrypt/package.py b/packages/py-pyaescrypt/package.py index f8ec576a23bcc5165343a652c33e223c274f9b71..d784aa1e2a91a416232b7a516ae97dadab866628 100644 --- a/packages/py-pyaescrypt/package.py +++ b/packages/py-pyaescrypt/package.py @@ -8,13 +8,13 @@ from spack import * class PyPyaescrypt(PythonPackage): """ - Requirement necessary for tvb-framework package. + Requirement necessary for py-tvb-framework package. """ homepage = "https://pypi.org/project/pyAesCrypt" pypi = 'pyAesCrypt/pyAesCrypt-6.0.0.tar.gz' - maintainers = ['paulapopa'] + maintainers = ['paulapopa', 'ldomide'] version('6.0.0', 'a26731960fb24b80bd3c77dbff781cab20e77715906699837f73c9fcb2f44a57') diff --git a/packages/py-pynn/package.py b/packages/py-pynn/package.py index f175e2df14946e9bc92f2d4eca64b3b4ee98c441..3d5db6325426298d7a02ab0c24be59aa355450b5 100644 --- a/packages/py-pynn/package.py +++ b/packages/py-pynn/package.py @@ -46,6 +46,15 @@ class PyPynn(PythonPackage): depends_on('py-neo@0.10.0:', type=('build', 'run'), when="@0.10.0") depends_on('py-neo@0.11.0:', type=('build', 'run'), when="@0.10.1:") + depends_on('neuron@8.1:', type=('build','run'), when="@0.10.1:") + depends_on('nest@3.3:', type=('build','run'), when="@0.10.1:") + depends_on('py-brian2', type=('build','run')) + depends_on('py-mock@1.0:', type='test') patch('pynn-0.9.6-python3.patch', when='@0.9.6 ^python@3:') + + # neuroml and nineml are optional dependencies. Leave out of import_modules to avoid errors in tests + import_modules = ['pyNN', 'pyNN.recording', 'pyNN.standardmodels', 'pyNN.common', 'pyNN.neuron', 'pyNN.serialization', 'pyNN.nest', 'pyNN.brian2', 'pyNN.descriptions', 'pyNN.utility', 'pyNN.mock'] + # TODO: for Spack>v0.19.0, skip_modules can be used instead + # skip_modules = ['pyNN.neuroml', 'pyNN.nineml'] diff --git a/packages/py-python-jose/package.py b/packages/py-python-jose/package.py new file mode 100644 index 0000000000000000000000000000000000000000..3c8ceb8e00828c3479a75f31d52ff03c9ebb3072 --- /dev/null +++ b/packages/py-python-jose/package.py @@ -0,0 +1,21 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + +class PyPythonJose(PythonPackage): + """JOSE implementation in Python""" + + homepage = "http://github.com/mpdavis/python-jose" + pypi = "python-jose/python-jose-3.3.0.tar.gz" + + version("3.3.0", sha256="55779b5e6ad599c6336191246e95eb2293a9ddebd555f796a65f838f07e5d78a") + + depends_on("python@3.6:", type=("build", "run")) + depends_on("py-setuptools", type="build") + + depends_on("py-rsa", type=("build", "run")) + depends_on("py-ecdsa@:0.14.1,0.16.0:", type=("build", "run")) + depends_on("py-pyasn1", type=("build", "run")) diff --git a/packages/py-python-keycloak/package.py b/packages/py-python-keycloak/package.py new file mode 100644 index 0000000000000000000000000000000000000000..e991898c658d155936f06c988e1bc2d64cadfbfa --- /dev/null +++ b/packages/py-python-keycloak/package.py @@ -0,0 +1,29 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + +class PyPythonKeycloak(PythonPackage): + """python-keycloak is a Python package providing access to the Keycloak API""" + + homepage = "https://github.com/marcospereirampj/python-keycloak" + url = "https://files.pythonhosted.org/packages/py3/p/python_keycloak/python_keycloak-2.9.0-py3-none-any.whl" + + version('2.9.0', sha256='f2b42fc27b474ac791900eee38049ba9342613118f599e8214e85cfd58d4329e', expand=False) + version('2.8.0', sha256='73baa30d5a45ac7e1167ad99ef39013cd7621c2cfc44745680b0351a3959e0c9', expand=False) + version('2.7.0', sha256='e16897249c18e63782d3c88c8de36e1abf0aded6fbd93ad57866184fa25e3a84', expand=False) + version('2.6.1', sha256='5da72c18640b9a02cb53c405673d764b8374a759bb36eba7c6aaf440c8449ede', expand=False) + version('2.6.0', sha256='a1ce102b978beb56d385319b3ca20992b915c2c12d15a2d0c23f1104882f3fb6', expand=False) + version('2.5.0', sha256='ed1c1935ceaf5d7f928b1b3ab945130f7d54685e4b17da053dbc7bfee0c0271e', expand=False) + version('2.4.0', sha256='001d50f9aba5cafb012a5e6f4842ea97d59d12287a86fa3c848ad97db0c3c2bc', expand=False) + version('2.3.0', sha256='b93d3d5a67d56da86a744f57b180e3d091dfd7859ea0b125363a3d9fccc0a47b', expand=False) + version('2.2.0', sha256='c860bbdaadc28dabbe990daf71910448aa5e238d280ede9cd53f8b035869de37', expand=False) + version('2.1.1', sha256='140d95ca08a2acae1f4cdaf6130bbba3ba3309f059326f7bebd87f150561c4b4', expand=False) + + depends_on('py-poetry-core', type='build') + depends_on('py-requests', type=('build', 'run')) + depends_on('py-python-jose', type=('build', 'run')) + depends_on('py-urllib3', type=('build', 'run')) + depends_on('py-requests-toolbelt', type=('build', 'run')) diff --git a/packages/py-quantities-scidash/package.py b/packages/py-quantities-scidash/package.py index b92484b777637b00e84300ccb31b16fc960ce4e0..1e115c92578e3fc988d61df43ce56abfd2ca5b87 100644 --- a/packages/py-quantities-scidash/package.py +++ b/packages/py-quantities-scidash/package.py @@ -16,4 +16,5 @@ class PyQuantitiesScidash(PythonPackage): version('0.12.4.3', sha256='c281383b989ae19bfe1526c09e452c82880b633a735f9494d8bb469412a33ea2') - depends_on('python@3.6.9:') \ No newline at end of file + depends_on('python@3.6.9:') + depends_on('py-numpy@1.19:') diff --git a/packages/py-snudda/package.py b/packages/py-snudda/package.py index 08fb34bb7370fb752cfa75d35f977bc6c06956bd..a56336c083998f7547ffbdd5a0a79f39a54443bd 100644 --- a/packages/py-snudda/package.py +++ b/packages/py-snudda/package.py @@ -29,3 +29,14 @@ class PySnudda(PythonPackage): depends_on("py-psutil", type=("build","run")) depends_on("py-cython", type=("build","run")) depends_on("py-numba@0.53.1:", type=("build","run")) + + # snudda tarballs in pypi do not include the tests/ dir: just use default spack tests for now + # @run_after('install') + # @on_package_attributes(run_tests=True) + # def install_test(self): + # python('-m', 'unittest', 'discover', '-v', '-s' './tests') + + # blender is for now an optional dependency: leave out of import_modules to avoid errors in tests + import_modules = ['snudda', 'snudda.utils', 'snudda.neurons', 'snudda.plotting', 'snudda.analyse', 'snudda.simulate', 'snudda.place', 'snudda.prune', 'snudda.neuromodulation', 'snudda.input', 'snudda.init', 'snudda.detect'] + # TODO: for Spack>v0.19.0, skip_modules can be used instead + # skip_modules = ['snudda.plotting.Blender', 'snudda.plotting.Blender.io_mesh_swc', 'snudda.plotting.Blender.visualisation'] diff --git a/packages/py-tvb-data/package.py b/packages/py-tvb-data/package.py new file mode 100644 index 0000000000000000000000000000000000000000..3f7dc670efe92d4f1cb761da0b15c508a1069510 --- /dev/null +++ b/packages/py-tvb-data/package.py @@ -0,0 +1,40 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyTvbData(PythonPackage): + """ + Various demonstration datasets for use with The Virtual Brain are provided here. + """ + + homepage = "https://zenodo.org/record/7574266" + url = 'https://zenodo.org/record/7574266/files/tvb_data.zip' + + maintainers = ['paulapopa', "ldomide"] + + version('2.7', 'f74ec53edadb4540da3de7268257dd20') + version('2.0.3', '1e02cdc21147f46644c57b14429f564f') + + # python_requires + depends_on('python@3.8:', type=('build', 'run')) + + # setup_requires + depends_on('py-pip', type='build') + + # this is only a data holder package, thus no real python code exists inside. + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + + with working_dir('spack-test', create=True): + python('-c', + 'import tvb_data; ' + 'import os; ' + 'RR = tvb_data.__path__[0]; ' + 'assert os.path.exists(os.path.join(RR, "Default_Project.zip")); ' + 'assert os.path.exists(os.path.join(RR, "connectivity"))' + '') diff --git a/packages/tvb-framework/package.py b/packages/py-tvb-framework/package.py similarity index 53% rename from packages/tvb-framework/package.py rename to packages/py-tvb-framework/package.py index 5f48bcbd292a314939d9556e110bf8dd6db8d906..16a0f3fd55b9e3901474b79961ed78eb9b098d27 100644 --- a/packages/tvb-framework/package.py +++ b/packages/py-tvb-framework/package.py @@ -6,7 +6,7 @@ from spack import * -class TvbFramework(PythonPackage): +class PyTvbFramework(PythonPackage): """ "The Virtual Brain" Project (TVB Project) has the purpose of offering modern tools to the Neurosciences community, for computing, simulating and analyzing functional and structural data of human brains, brains modeled at the level @@ -14,16 +14,16 @@ class TvbFramework(PythonPackage): """ homepage = "https://www.thevirtualbrain.org/" - pypi = 'tvb-framework/tvb-framework-2.3.tar.gz' + pypi = 'tvb-framework/tvb-framework-2.7.3.1.tar.gz' - maintainers = ['paulapopa'] + maintainers = ['paulapopa', 'ldomide'] + version('2.7.3.1', 'e1de0df0b8f43a317962b066790a5d724e1e6ae98ee124ad8b977f92aa228877') + version('2.7.2', '1109c956c22e737d276bc822a69716c811d22e12f0606b47cc61700067af3ff4') + version('2.7.1', '4645a489f24bc877370b213819bf4d31fbc4104bbfd0f3abde91a8d56635ee54') + version('2.7', '6c16d95071283c3866660132f3f0ea789100d0e3b4c57daacbdb63506be7e29f') version('2.4', 'af75c07e35565cfcf12e6a9052934c58a45c855455cec2f2cd3bd47fdf90e31d') version('2.3', '0f3386135cdbd80bfd7d31f2e056b015a27ff6d081492db16274deed581b0aac') - version('2.2', 'dfcdecee7325dd9b75eb63ddca56d046a4a6f3a20a9bc71a609315b6f151d68b') - version('2.0.10', '082c8c742680804a62fd20b80d0ac0fa7421b0e1cd3a54293ff2fec2abc4f15d') - version('2.0.9', '8a3af6d52e057db901d38c524d4bf1c7f78e793b990b27950d0765b8edf03c61') - version('2.0.8', '95a8585b3095eecbdc8ca389269471a350b6876e732f62c260d75b615d10a237') # python_requires depends_on('python@3.8:', type=('build', 'run')) @@ -33,24 +33,42 @@ class TvbFramework(PythonPackage): # install_requires depends_on('py-alembic', type=('build', 'run')) + depends_on('py-bct', type=('build', 'run')) depends_on('py-cherrypy', type=('build', 'run')) + depends_on('py-docutils', type=('build', 'run')) depends_on('py-formencode', type=('build', 'run')) - # depends_on('py-gevent', type=('build', 'run')) + depends_on('py-flask', type=('build', 'run')) + depends_on('py-flask-restx', type=('build', 'run')) depends_on('py-h5py', type=('build', 'run')) depends_on('py-jinja2', type=('build', 'run')) + depends_on('py-matplotlib', type=('build', 'run')) depends_on('py-nibabel', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) depends_on('py-pandas', type=('build', 'run')) depends_on('py-pillow', type=('build', 'run')) depends_on('py-psutil', type=('build', 'run')) - depends_on('py-pyaescrypt', type=('build', 'run')) + depends_on('py-python-keycloak', type=('build', 'run')) depends_on('py-requests', type=('build', 'run')) depends_on('py-scikit-learn', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) + # siibra depends_on('py-simplejson', type=('build', 'run')) depends_on('py-six', type=('build', 'run')) depends_on('py-sqlalchemy', type=('build', 'run')) - depends_on('tvb-data', type='run') - depends_on('tvb-library', type=('build', 'run')) - depends_on('tvb-storage', type=('build', 'run'), when='@2.3') + depends_on('py-tvb-data', type=('run', 'test')) + depends_on('py-tvb-gdist', type='run') + depends_on('py-tvb-library', type=('build', 'run')) + depends_on('py-tvb-storage', type=('build', 'run')) depends_on('py-werkzeug', type=('build', 'run')) + + depends_on('py-pytest', type='test') + depends_on('py-pytest-benchmark', type='test') + depends_on('py-pytest-mock', type='test') + depends_on('py-beautifulsoup4', type='test') + + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + pytest = which('pytest') + pytest('--ignore', 'tvb/tests/framework/adapters/creators/siibra_base_test.py', + '--ignore', 'tvb/tests/framework/adapters/creators/siibra_creator_test.py') diff --git a/packages/tvb-storage/package.py b/packages/py-tvb-gdist/package.py similarity index 60% rename from packages/tvb-storage/package.py rename to packages/py-tvb-gdist/package.py index 2e1b7cfa6414f8c22181843d2158f557e63f408b..13e4a40734dcdbe21713f302314be7eef5ab3136 100644 --- a/packages/tvb-storage/package.py +++ b/packages/py-tvb-gdist/package.py @@ -6,7 +6,7 @@ from spack import * -class TvbStorage(PythonPackage): +class PyTvbGdist(PythonPackage): """ "The Virtual Brain" Project (TVB Project) has the purpose of offering modern tools to the Neurosciences community, for computing, simulating and analyzing functional and structural data of human brains, brains modeled at the level @@ -14,21 +14,26 @@ class TvbStorage(PythonPackage): """ homepage = "https://www.thevirtualbrain.org/" - pypi = 'tvb-storage/tvb-storage-2.3.tar.gz' + pypi = 'tvb-gdist/tvb-gdist-2.1.0.tar.gz' - maintainers = ['paulapopa'] + maintainers = ['paulapopa', 'ldomide'] - version('2.4', '1af5586db3adeda02089a9cccd16dbfec1fc5bd1df1e4985fba5837efa72debc') - version('2.3', 'e10bb40a486771703ba2776555ea5a453e619b07f10e4dea0d347043dee8f54b') + version('2.1.0', '802fcc65d8007aaa14c0f6e6aded419fb38c27995ac94a2f945499b1f2218fd8') # python_requires depends_on('python@3.8:', type=('build', 'run')) # setup_requires depends_on('py-setuptools', type='build') - - # install_requires - depends_on('py-h5py', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) - depends_on('tvb-library', type=('build', 'run')) + depends_on('py-cython', type=('build', 'run')) + + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + # TODO tests are not packed on Pypi from tvb-gdist repo + with working_dir('spack-test', create=True): + python('-c', 'import gdist') + + diff --git a/packages/py-tvb-library/package.py b/packages/py-tvb-library/package.py new file mode 100644 index 0000000000000000000000000000000000000000..577a6076d201db49cc39a7a089f85c27df7de1a6 --- /dev/null +++ b/packages/py-tvb-library/package.py @@ -0,0 +1,65 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyTvbLibrary(PythonPackage): + """ + "The Virtual Brain" Project (TVB Project) has the purpose of offering modern tools to the Neurosciences community, + for computing, simulating and analyzing functional and structural data of human brains, brains modeled at the level + of population of neurons. + """ + + homepage = "https://www.thevirtualbrain.org/" + pypi = 'tvb-library/tvb-library-2.7.3.tar.gz' + + maintainers = ['paulapopa', 'ldomide'] + + version('2.7.3', 'bcf7ad291ff4549508f6720e207561f5f0bad638cd0d8507fd4ed9a7bcc561ff') + version('2.7.2', 'cc93c15a3b2c59e9e808d099466b3cb38a07ef81f693f32f24d9a94c0cedd39f') + version('2.7.1', '971f6a354231f7608484b17aa37ac053374b7beeab9c4676d3d28227f1fb100e') + version('2.7', '0b28ee0221818f677ee26bd3cd590e42ccdfb6dea705bd78abf4788779f53f7d') + version('2.6', '3912f6881688f2ec6eda31d179d630922257a861cf6f161e90aea831cfc63583') + version('2.5', 'd3fc26cdee145d73c459eff9172fd5b8eeb4ef264a146a1f0aca062993123793') + version('2.4', 'f90a34a94310cb8e709d9ff888e0d066c1b5549a117ecf65516bae1872c5d0c9') + version('2.3', '0595f2eca95e5ed4c7a1c88425914cc71d0ea7a9f4ec575b6a315ca2408ea801') + + # python_requires + depends_on('python@3.8:', type=('build', 'run')) + + # setup_requires + depends_on('py-setuptools', type='build') + + # install_requires + depends_on('py-autopep8', type=('build', 'run')) + depends_on('py-deprecated', type=('build', 'run')) + depends_on('py-docutils', type=('build', 'run')) + depends_on('py-ipywidgets', type=('build', 'run')) + depends_on('py-lxml', type=('build', 'run')) + depends_on('py-lems', type=('build', 'run')) + depends_on('py-mako', type=('build', 'run')) + depends_on('py-matplotlib', type=('build', 'run')) + depends_on('py-networkx', type=('build', 'run')) + depends_on('py-numpy', type=('build', 'run')) + depends_on('py-numba', type=('build', 'run')) + depends_on('py-numexpr', type=('build', 'run')) + depends_on('py-scipy', type=('build', 'run')) + depends_on('py-six', type=('build', 'run')) + depends_on('py-tvb-data', type=('run', 'test')) + depends_on('py-tvb-gdist', type=('run', 'test')) + + depends_on('py-pytest', type='test') + depends_on('py-h5py', type='test') + depends_on('py-pytest-benchmark', type='test') + depends_on('py-pytest-xdist', type='test') + + skip_modules = ['tvb.tests.library.simulator.rateml_test', "tvb/tests/library/simulator/rateml_test"] + + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + pytest = which('pytest') + pytest() diff --git a/packages/py-tvb-storage/package.py b/packages/py-tvb-storage/package.py new file mode 100644 index 0000000000000000000000000000000000000000..a859e4071ec33227baac8c6bf4847afcdf74c3ef --- /dev/null +++ b/packages/py-tvb-storage/package.py @@ -0,0 +1,50 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyTvbStorage(PythonPackage): + """ + "The Virtual Brain" Project (TVB Project) has the purpose of offering modern tools to the Neurosciences community, + for computing, simulating and analyzing functional and structural data of human brains, brains modeled at the level + of population of neurons. + """ + + homepage = "https://www.thevirtualbrain.org/" + pypi = 'tvb-storage/tvb-storage-2.7.3.tar.gz' + + maintainers = ['paulapopa', 'ldomide'] + + version('2.7.3', '7f8b4d60313003e3c2b5b2f370f0a3a33ea5b22fde8b3f428eee7f2874673e4f') + version('2.7.2', '501443ceb9f6374922a024b07ef09138f826fd0deaa69883c63dd0dff34fb16c') + version('2.7', 'fd9e4d48517e91c0ad09de828668e27a9b19e5372d92fa3e3c8544b1cd8724a3') + version('2.5', '749d1ef421a24a6f899ce8642c91660b4cccc72b1f00b1bbe08368e10f4f1159') + version('2.4', '1af5586db3adeda02089a9cccd16dbfec1fc5bd1df1e4985fba5837efa72debc') + version('2.3', 'e10bb40a486771703ba2776555ea5a453e619b07f10e4dea0d347043dee8f54b') + + # python_requires + depends_on('python@3.8:', type=('build', 'run')) + + # setup_requires + depends_on('py-setuptools', type='build') + + # install_requires + depends_on('py-cryptography', type=('build', 'run')) + depends_on('py-h5py', type=('build', 'run')) + depends_on('py-kubernetes', type=('build', 'run')) + depends_on('py-numpy', type=('build', 'run')) + depends_on('py-pyaescrypt', type=('build', 'run')) + depends_on('py-requests', type=('build', 'run')) + depends_on('py-tvb-library', type=('build', 'run')) + + depends_on('py-pytest', type='test') + depends_on('py-decorator', type='test') + + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + pytest = which('pytest') + pytest() \ No newline at end of file diff --git a/packages/py-viziphant/package.py b/packages/py-viziphant/package.py index 9853eb54d5d62325cad3b8f074d7aca604cc12d9..8d75c691fe6efcbde6c4dc47fafc8e4d92815f50 100644 --- a/packages/py-viziphant/package.py +++ b/packages/py-viziphant/package.py @@ -15,6 +15,7 @@ class PyViziphant(PythonPackage): # notify when the package is updated. maintainers = ['Moritz-Alexander-Kern'] + version('0.3.0', sha256='40d2970b8384d8e1c5d324caf1b1188391d7e651375ce08dd518bcf4ac6477f2') version('0.2.0', sha256='044b5c92de169dfafd9665efe2c310e917d2c21980bcc9f560d5c727161f9bd8') version('0.1.0', sha256='8fd56ec8633f799396dc33fbace95d2553bedb17f680a8c0e97f43b3a629bf6c') @@ -27,3 +28,15 @@ class PyViziphant(PythonPackage): depends_on('py-six@1.10.0:', type=('build', 'run')) depends_on('py-matplotlib@3.3.2:', type=('build', 'run')) depends_on('py-seaborn@0.9.0:', type=('build', 'run')) + + depends_on("py-pytest", type=("test"), when="@0.3.0:") + depends_on("py-elephant@0.9.0:+extras", type=("test"), when="@0.3.0:") + + @run_after('install') + @on_package_attributes(run_tests=True) + def install_test(self): + # run tests + # TODO: replace if clause with @run_after('install', when='@0.3.0:') after update to Spack v0.19 + if self.spec.version >= Version('0.3.0'): + pytest = which('pytest') + pytest() diff --git a/packages/sda/package.py b/packages/sda/package.py index b5c5c606fc0250688ef5e7d0e9da726f450a6233..8ff8aa207313200c866a4375ee7e3f6ff761d415 100644 --- a/packages/sda/package.py +++ b/packages/sda/package.py @@ -1,4 +1,4 @@ -# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -27,8 +27,9 @@ class Sda(MakefilePackage): version('7.3.3d', sha256='295ca0142532759a43375422a4ebc050e15b1c248e45493f5864765a9fe8076f') # Dependencies. + depends_on('apbs', type=('build','run')) depends_on('python@3.8:', type=('build','run')) - conflicts('%gcc@:9.3.999', when='@7.3.3d') + conflicts('%gcc@:9.3', when='@7.3.3d') conflicts('%intel') build_directory = 'src' @@ -42,9 +43,21 @@ class Sda(MakefilePackage): makefile.filter(r'\${CC_plus}', '${CXX}') makefile.filter(r'^\s*CC_moins\s*=.*', 'CC = ' + spack_cc) makefile.filter(r'\${CC_moins}', '${CC}') - - @property - def install_targets(self): - build_directory = 'sda_flex-7.3.3d/src/' - targets = ['init libsda sda_flex tools auxi clust test_module'] - return ['prefix={0}'.format(self.prefix), 'install'] + + def install(self, spec, prefix): + install_tree('auxi', prefix.auxi) + install_tree('bin', prefix.bin) + install_tree('examples', prefix.examples) + install_tree('lib', prefix.lib) + install_tree('src', prefix.src) + + @run_after('install') + def test_install(self): + # prepare grid + with working_dir(self.prefix.examples + '/lysozymes/prepare_grids_and_ecm'): + run_script = Executable('bash') + run_script('./run_ed_hd_ecm.sh') + # run random test + with working_dir(self.prefix.examples + '/lysozymes/unit_test'): + test = Executable(self.prefix.bin.test_force_energy2) + test('128_lysph6_2interactions.in') diff --git a/packages/tvb-data/package.py b/packages/tvb-data/package.py deleted file mode 100644 index 2c2a36892cdff8d49df799371f916e62c8a829b8..0000000000000000000000000000000000000000 --- a/packages/tvb-data/package.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class TvbData(PythonPackage): - """ - Various demonstration datasets for use with The Virtual Brain are provided here. - """ - - homepage = "https://zenodo.org/record/4263723" - url = 'https://zenodo.org/record/4263723/files/tvb_data.zip' - - maintainers = ['paulapopa'] - - version('2.0.3', '1e02cdc21147f46644c57b14429f564f') - - # python_requires - depends_on('python@3.8:', type=('build', 'run')) - - # setup_requires - depends_on('py-setuptools', type='build') diff --git a/packages/tvb-library/package.py b/packages/tvb-library/package.py deleted file mode 100644 index 9cb09dc334ea916be4c98d6ddfb8ef3ebde998fd..0000000000000000000000000000000000000000 --- a/packages/tvb-library/package.py +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class TvbLibrary(PythonPackage): - """ - "The Virtual Brain" Project (TVB Project) has the purpose of offering modern tools to the Neurosciences community, - for computing, simulating and analyzing functional and structural data of human brains, brains modeled at the level - of population of neurons. - """ - - homepage = "https://www.thevirtualbrain.org/" - pypi = 'tvb-library/tvb-library-2.3.tar.gz' - - maintainers = ['paulapopa'] - - version('2.4', 'f90a34a94310cb8e709d9ff888e0d066c1b5549a117ecf65516bae1872c5d0c9') - version('2.3', '0595f2eca95e5ed4c7a1c88425914cc71d0ea7a9f4ec575b6a315ca2408ea801') - version('2.2', 'de70440b0cfd517e49a8ef52aa01f3bfde87a907abbf68ae5d85fef9a28000dd') - version('2.1', '99c2817d9d341abd6d7ff07c4a827f58462d85a4dbb975e514840f362b3ca5cc') - version('2.0.10', '27ece9ec3a79125b037fdd67963da23dc4fad7bd7154b884faa6c26c2775a1b8') - version('2.0.9', '0c3109c03665e3dd516fda12ba2155d718cd9933fb25b9f7bd0906851e937f39') - version('2.0.8', '41e912723b66fe7beeff79f6b760d8ae8c34b0e80e668e81ce59c380ad00506d') - version('2.0.7', 'b9a6c03b8b7c55e512b0a601260934c984870c875f958423c360e3813e70100b') - version('2.0.6', 'f1ee168939e522f698b2fe18c2b7013b827ace198d4af777b38cf80fc2ab5db3') - version('2.0.5', 'a1af85c3a376b52daa140416320f59794263fac99796a3a9e47ec1db46bda160') - version('2.0.3', 'f4ebe3f3bba13dd6b32568cc016cb218251002a8c20acb992e030ab2ca5b30c8') - version('2.0.2', '1893e641108c8fdbafc7c3400ac95b0f5f0a714fd0a378258ac065d11d2de071') - version('2.0', 'a89bcd1949788d35722a1dc1e3bb8d5e32fa02a4eef977fd476ab6df18285e9b') - - # python_requires - depends_on('python@3.8:', type=('build', 'run')) - - # setup_requires - depends_on('py-setuptools', type='build') - - # install_requires - depends_on('py-autopep8', type=('build', 'run')) - depends_on('py-mako', type=('build', 'run')) - depends_on('py-matplotlib', type=('build', 'run')) - depends_on('py-numpy', type=('build', 'run')) - depends_on('py-numba', type=('build', 'run')) - depends_on('py-numexpr', type=('build', 'run')) - depends_on('py-requests', type=('build', 'run')) - depends_on('py-scipy', type=('build', 'run')) - depends_on('py-six', type=('build', 'run')) - depends_on('tvb-data', type=('run')) - - # extra_requires - # ["h5py", "mpl_toolkits", "tvb-gdist"] - - # test_requires - # ["pytest", "pytest-benchmark"] diff --git a/spack.yaml b/spack.yaml index b545c2aa4d81ab0a06723a9b15686ee3fd11a705..5d73282bafcaab8a6f466ff0c94017e14eebf2b7 100644 --- a/spack.yaml +++ b/spack.yaml @@ -10,12 +10,12 @@ spack: # Collab utils - clb-nb-utils@0.1.0 # General - - py-pip - - py-numpy - - py-scipy - - py-pandas - - py-seaborn - - py-matplotlib + # - py-pip + # - py-numpy + # - py-scipy + # - py-pandas + # - py-seaborn + # - py-matplotlib - py-nameparser - py-lazyarray #- py-version-query @@ -25,12 +25,11 @@ spack: - neuron +mpi - py-pynn@0.10.1 +mpi - py-brian2 - - tvb-data - - tvb-library ^py-numba@0.54.0 ^binutils+ld+gold - - tvb-storage ^binutils+ld+gold - - py-pyaescrypt - - py-formencode - - tvb-framework ^binutils+ld+gold + - py-tvb-data + - py-tvb-gdist + - py-tvb-library + - py-tvb-storage + - py-tvb-framework - pynn-brainscales@4.0-a4 - hxtorch@4.0-a4 - py-neo @@ -41,7 +40,7 @@ spack: #- py-cerebunit - py-cerebrus - py-sciunit@0.2.5.1 - - py-quantities + - py-quantities@0.14.1 - py-quantities-scidash@0.12.4.3 #- py-ebrains-drive@0.4.0 - py-ebrains-kg-core @@ -74,3 +73,4 @@ spack: #- funniest1022 concretizer: unify: true +