Skip to content

Commit

Permalink
Update to IMP 2.22.0, drop Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Dec 12, 2024
1 parent 9c749cc commit 96ea4bb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
os: [ubuntu-latest]
python-version: ["3.12"]
imp-branch: [main, develop]
include:
- os: [ubuntu-latest]
python-version: "2.7"
imp-branch: main
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -37,8 +33,7 @@ jobs:
source ${CONDA_PREFIX}/etc/conda/activate.d/activate-gxx_linux-64.sh
cd modules/foo
mkdir build && cd build
if test "${{ matrix.python-version }}" = "2.7" ; then PY2=on; else PY2=off; fi
cmake .. -DIMP_DIR=${CONDA_PREFIX}/lib/cmake/IMP -DUSE_PYTHON2=${PY2} -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage"
cmake .. -DIMP_DIR=${CONDA_PREFIX}/lib/cmake/IMP -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage"
make
./setup_environment.sh pytest --cov=.. --cov-branch --cov-report=xml -v ../test/test_*.py test/*/*.py
${GCC/gcc/gcov} $(find . -name "*.gcno")
Expand Down
4 changes: 2 additions & 2 deletions doc/valgrind.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"source": [
"# Build procedure<a id=\"build\"></a>\n",
"\n",
"To build the custom module, either drop the entire module into IMP's `modules` directory and then build IMP from source code [in the usual way](https://integrativemodeling.org/2.21.0/doc/manual/installation.html#installation_compilation), or build the module [out of tree](https://integrativemodeling.org/2.21.0/doc/manual/outoftree.html) pointing CMake to an existing IMP installation. In order for Valgrind to be maximally useful, build the module with extra debugging information available by passing `-DCMAKE_CXX_FLAGS=\"-g\"` to CMake. The module should build without errors (or even warnings) with gcc."
"To build the custom module, either drop the entire module into IMP's `modules` directory and then build IMP from source code [in the usual way](https://integrativemodeling.org/2.22.0/doc/manual/installation.html#installation_compilation), or build the module [out of tree](https://integrativemodeling.org/2.22.0/doc/manual/outoftree.html) pointing CMake to an existing IMP installation. In order for Valgrind to be maximally useful, build the module with extra debugging information available by passing `-DCMAKE_CXX_FLAGS=\"-g\"` to CMake. The module should build without errors (or even warnings) with gcc."
]
},
{
Expand Down Expand Up @@ -145,7 +145,7 @@
" - In more complex programs with multiple code paths it can be tricky to make sure that every `new` is paired with a `delete` and that we never try to free the same memory more than once.\n",
" \n",
"\n",
"In this case where the object is small it would be better to avoid dynamic memory allocation entirely and just create the `ScoreCalculator` object as an automatic variable (on the stack) as `ScoreCalculator calc(d, k_);` For a larger object, derive from the [IMP::Object](https://integrativemodeling.org/2.21.0/doc/ref/classIMP_1_1Object.html) class and use a [smart pointer](https://en.wikipedia.org/wiki/Smart_pointer) to make sure it gets cleaned up automatically (replacing `new` with `IMP_NEW` and using `IMP::Pointer` rather than raw C++ pointers).\n",
"In this case where the object is small it would be better to avoid dynamic memory allocation entirely and just create the `ScoreCalculator` object as an automatic variable (on the stack) as `ScoreCalculator calc(d, k_);` For a larger object, derive from the [IMP::Object](https://integrativemodeling.org/2.22.0/doc/ref/classIMP_1_1Object.html) class and use a [smart pointer](https://en.wikipedia.org/wiki/Smart_pointer) to make sure it gets cleaned up automatically (replacing `new` with `IMP_NEW` and using `IMP::Pointer` rather than raw C++ pointers).\n",
"\n",
"(Valgrind also reports some small memory leaks from IMP's SWIG interface. These aren't worth worrying about, since this is not our code, and they should be one-time allocations, which get cleaned up at the end of the program anyway.)\n"
]
Expand Down
20 changes: 2 additions & 18 deletions support/setup_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,8 @@ if [ ${imp_branch} = "develop" ]; then
else
IMP_CONDA="imp"
fi
if [ ${python_version} = "2.7" ]; then
BOOST=""
pip="pip<=19.3.1"
# Python.h includes crypt.h, which is no longer provided by default
crypt="libxcrypt"
else
BOOST="libboost-devel"
pip="pip"
crypt=""
fi
conda create --yes -q -n python${python_version} -c salilab python=${python_version} ${pip} ${crypt} ${IMP_CONDA} ${BOOST} gxx_linux-64 eigen cereal swig cmake numpy
conda create --yes -q -n python${python_version} -c salilab python=${python_version} pip ${IMP_CONDA} libboost-devel gxx_linux-64 eigen cereal swig cmake numpy
eval "$(conda shell.bash hook)"
conda activate python${python_version}

if [ ${python_version} = "2.7" ]; then
# pytest-flake8 1.1.0 tries to import contextlib.redirect_stdout, which
# isn't present in Python 2
pip install pytest-cov coverage 'pytest-flake8<1.1'
else
pip install pytest-cov coverage pytest-flake8
fi
pip install pytest-cov coverage pytest-flake8

0 comments on commit 96ea4bb

Please sign in to comment.