Skip to content

Commit

Permalink
Pytest-cov uses a large amount of memory in CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Oct 15, 2023
1 parent 462c3e7 commit 785aff2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- name: Install and Test
run: ./.github/workflows/run_ci.sh
- name: Upload to codecov
if: matrix.python-version == "3.8"
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
Expand Down Expand Up @@ -71,7 +72,7 @@ jobs:
echo 'pbc_tools_pbc_fft_engine = "NUMPY"' > .pyscf_conf.py && \
echo "dftd3_DFTD3PATH = './pyscf/lib/deps/lib'" >> .pyscf_conf.py && \
echo "scf_hf_SCF_mute_chkfile = True" >> .pyscf_conf.py && \
ulimit -s 20000 && /opt/python/${{ matrix.pyver }}/bin/pytest pyscf/ --ignore=pyscf/adc --ignore=pyscf/pbc/df --ignore=pyscf/pbc/cc -s -c setup.cfg --cov-report xml --cov-report term --cov-config .coveragerc --cov pyscf'
ulimit -s 20000 && /opt/python/${{ matrix.pyver }}/bin/pytest pyscf/ --ignore=pyscf/adc --ignore=pyscf/pbc/df --ignore=pyscf/pbc/cc -s -c setup.cfg pyscf'
macos-build:
runs-on: macos-latest
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci_linux/python_deps.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env bash
python -m pip install --upgrade pip
pip install "numpy!=1.16,!=1.17" "scipy!=1.5" h5py pytest pytest-cov
pip install "numpy!=1.16,!=1.17" "scipy!=1.5" h5py pytest pytest-cov pytest-timer
pip install pyberny
pip install spglib

version=$(python -c 'import sys; version=sys.version_info[:2]; print("{0}.{1}".format(*version))')
if [ $version != '3.12' ]; then
pip install geometric
pip install pytest-timer
fi

#cppe
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci_macos/python_deps.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/usr/bin/env bash
python -m pip install --upgrade pip
pip install "numpy!=1.16,!=1.17" scipy h5py pytest pytest-cov pytest-timer
pip install pyberny geometric
pip install pyberny

#cppe
version=$(python -c 'import sys; version=sys.version_info[:2]; print("{0}.{1}".format(*version))')
if [ $version != '2.7' ] && [ $version != '3.5' ]; then
if [ $version != '3.12' ]; then
pip install geometric
fi

if [ $version != '3.5' ]; then
pip install cppe
fi
8 changes: 7 additions & 1 deletion .github/workflows/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ echo 'pbc_tools_pbc_fft_engine = "NUMPY"' > .pyscf_conf.py
echo "dftd3_DFTD3PATH = './pyscf/lib/deps/lib'" >> .pyscf_conf.py
echo "scf_hf_SCF_mute_chkfile = True" >> .pyscf_conf.py

pytest pyscf/ -s -c setup.cfg \
version=$(python -c 'import sys; print("{0}.{1}".format(*sys.version_info[:2]))')
# pytest-cov on Python 3.12 consumes huge memory
if [ "$RUNNER_OS" == "Linux" ] && [ $version != "3.12" ]; then
pytest pyscf/ -s -c setup.cfg \
--cov-report xml --cov-report term --cov-config .coveragerc --cov pyscf
else
pytest pyscf/ -s -c setup.cfg pyscf
fi

0 comments on commit 785aff2

Please sign in to comment.