Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
pip install ."[test]"
- name: Run tests
run: |
pytest --pyargs responsefun -v -s
pytest --pyargs responsefun -v -m "not slow"

formatting:
name: Code style
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@ ENV/

# other
*.zarr
*tar.gz

responsefun/_version.py
2 changes: 1 addition & 1 deletion ci_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
- libblas =*=*mkl
- adcc >=0.15.16
- adcc >=0.15.16,<0.16.0
- respondo >=0.0.5
- numpy >=1.14
- isort
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
requires-python = ">=3.7"
# Declare any run-time dependencies that should be installed with the package.
dependencies = [
"adcc>=0.15.16",
"adcc>=0.15.16,<0.16.0",
"respondo>=0.0.5",
"numpy>=1.14",
"sympy",
Expand All @@ -40,7 +40,7 @@ test = [
"pytest-cov",
"pytest-runner",
"pyscf",
"zarr",
"zarr>=2,<3",
]

[tool.pytest.ini_options]
Expand Down
27 changes: 27 additions & 0 deletions responsefun/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# taken from respondo

import os


def update_testdata(session):
import subprocess

testdata_dir = os.path.join(os.path.dirname(__file__), "testdata")
cmd = [testdata_dir + "/0_download_testdata.sh"]
subprocess.check_call(cmd)


#
# Pytest Hooks
#


def pytest_addoption(parser):
parser.addoption(
"--skip-update", default=False, action="store_true", help="Skip updating testdata"
)


def pytest_collection(session):
if not session.config.option.skip_update:
update_testdata(session)
37 changes: 37 additions & 0 deletions responsefun/testdata/0_download_testdata.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# taken from respondo

SOURCE="https://wwwagdreuw.iwr.uni-heidelberg.de/responsefun_test_data/0.1.0"
DATAFILES=(
data_0.1.0.tar.gz
)
#
# -----
#

THISDIR=$(dirname "${BASH_SOURCE[0]}")
cd "$THISDIR"
echo "Updating testdata ... please wait."

download() {
if which wget &> /dev/null; then
echo $@
wget -w 1 -qN --show-progress --no-check-certificate $@
else
echo "wget not installed" >&2
exit 1
fi
}

download $(for file in ${DATAFILES[@]}; do echo $SOURCE/$file; done)

if which sha256sum &> /dev/null; then
sha256sum --ignore-missing -c SHA256SUMS || exit 1
fi

for file in ${DATAFILES[@]}; do
tar -xzf $file
done

exit 0
1 change: 1 addition & 0 deletions responsefun/testdata/SHA256SUMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7530b9a13c5ad9fccd25f23981e291f5baf158dfa4b939c6c20a3b2db1d2e184 data_0.1.0.tar.gz
Loading