Skip to content

Commit 444acea

Browse files
authored
Merge pull request #34 from bojunliu0818/merge-050825
Address issue #33, check compatibility and update CI
2 parents 6e1f294 + 5378456 commit 444acea

File tree

5 files changed

+63
-50
lines changed

5 files changed

+63
-50
lines changed

.github/workflows/build-code.yml

+53-44
Original file line numberDiff line numberDiff line change
@@ -25,53 +25,62 @@ jobs:
2525
- macOS-latest
2626
- ubuntu-latest
2727
- windows-latest
28-
include:
29-
- os: ubuntu-latest
30-
path: ~/.cache/pip
31-
- os: macos-latest
32-
path: ~/Library/Caches/pip
33-
- os: windows-latest
34-
path: ~\AppData\Local\pip\Cache
28+
exclude:
29+
- os: macOS-latest
30+
python-version: "3.9"
3531
defaults:
3632
run:
3733
shell: bash -el {0}
3834

3935
steps:
40-
- uses: actions/checkout@v4
41-
- uses: actions/cache@v4
42-
with:
43-
path: ${{ matrix.path }}
44-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
45-
restore-keys: |
46-
${{ runner.os }}-pip-
47-
- uses: conda-incubator/setup-miniconda@v3
48-
with:
49-
auto-activate-base: true
50-
auto-update-conda: true
51-
python-version: ${{ matrix.python-version }}
52-
activate-environment: test
53-
- name: Install required packages
54-
run: |
55-
conda config --add channels conda-forge
56-
# conda install -yq conda-build jinja2 conda-verify
57-
conda install -yq zlib
58-
conda install h5py
59-
python -m pip install --upgrade pip
60-
# conda update conda-build
61-
# - name: Conda build
62-
# run: |
63-
# conda build --quiet devtools/conda-recipe
64-
- name: Pip install
65-
run: |
66-
python -m pip install .
67-
- name: Test with pytest
68-
run: |
69-
# conda install -yq -c ${CONDA_PREFIX}/conda-bld/ msmbuilder2022
70-
conda install -yq numdifftools hmmlearn
71-
pip install pytest
72-
mkdir ../../pkgs
73-
cp -r msmbuilder/tests ../../pkgs
74-
cd ../../pkgs
75-
python tests/data_init.py
76-
pytest tests/ -v
36+
- uses: actions/checkout@v4
37+
- name: Set pip cache path
38+
run: |
39+
if [[ "$RUNNER_OS" == "Linux" ]]; then
40+
echo "PIP_CACHE=~/.cache/pip" >> $GITHUB_ENV
41+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
42+
echo "PIP_CACHE=~/Library/Caches/pip" >> $GITHUB_ENV
43+
else
44+
echo "PIP_CACHE=$LOCALAPPDATA\\pip\\Cache" >> $GITHUB_ENV
45+
fi
46+
- uses: actions/cache@v4
47+
with:
48+
path: ${{ env.PIP_CACHE }}
49+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
50+
restore-keys: |
51+
${{ runner.os }}-pip-
52+
- uses: conda-incubator/setup-miniconda@v3
53+
with:
54+
auto-activate-base: true
55+
auto-update-conda: true
56+
python-version: ${{ matrix.python-version }}
57+
activate-environment: test
58+
- name: Install required packages
59+
run: |
60+
conda config --add channels conda-forge
61+
# conda install -yq conda-build jinja2 conda-verify
62+
if [[ "$RUNNER_OS" == "Linux" ]]; then
63+
conda install -yq zlib libstdcxx-ng h5py
64+
else
65+
conda install -yq zlib h5py
66+
fi
67+
python -m pip install --upgrade pip
68+
# conda update conda-build
69+
# - name: Conda build
70+
# run: |
71+
# conda build --quiet devtools/conda-recipe
72+
- name: Pip install
73+
run: |
74+
python -m pip install .
75+
- name: Test with pytest
76+
run: |
77+
# conda install -yq -c ${CONDA_PREFIX}/conda-bld/ msmbuilder2022
78+
# conda install -yq numdifftools hmmlearn
79+
pip install numdifftools hmmlearn statsmodels
80+
pip install pytest
81+
mkdir ../../pkgs
82+
cp -r msmbuilder/tests ../../pkgs
83+
cd ../../pkgs
84+
python tests/data_init.py
85+
pytest tests/ -v
7786

.github/workflows/build-wheels.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ jobs:
4949
run: |
5050
conda config --add channels conda-forge
5151
# conda install -yq conda-build jinja2 conda-verify
52-
conda install -yq zlib
53-
conda install h5py
52+
if [[ "$RUNNER_OS" == "Linux" ]]; then
53+
conda install -yq zlib libstdcxx-ng h5py
54+
else
55+
conda install -yq zlib h5py
56+
fi
5457
python -m pip install --upgrade pip
5558
# Used to host cibuildwheel
5659
- name: Pip install and build wheels
@@ -63,7 +66,8 @@ jobs:
6366
run: |
6467
pip install wheelhouse/msmbuilder2022*.whl
6568
66-
conda install -yq numdifftools hmmlearn
69+
# conda install -yq numdifftools hmmlearn
70+
pip install numdifftools hmmlearn statsmodels
6771
pip install pytest
6872
pip install pytest-cov
6973
mkdir ../../pkgs

msmbuilder/cluster/src/kmedoids.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ The cluster number to which an element was assigned.
359359
/* j = binomial(n, p); */
360360
args = Py_BuildValue("(dd)", static_cast<double>(n), p);
361361
result = PyObject_Call(binomial, args, NULL);
362-
j = PyInt_AsLong(result);
362+
j = PyLong_AsLong(result);
363363
Py_DECREF(args);
364364
Py_DECREF(result);
365365

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
requires = ["setuptools",
33
"wheel",
44
"Cython~=0.29.36",
5-
"numpy",
5+
"numpy<=1.26",
66
"mdtraj",
77
#"mdtraj @ https://files.pythonhosted.org/packages/88/12/ecbe28c87bc3df8c4880cc742923a6f40633ca076c8f44b03533dfce0b66/mdtraj-1.9.9-cp39-cp39-macosx_10_9_x86_64.whl",
88
]

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
],
211211
},
212212
install_requires=[
213-
'numpy',
213+
'numpy<=1.26',
214214
'mdtraj',
215215
'scikit-learn',
216216
'pandas',

0 commit comments

Comments
 (0)