Skip to content

Commit

Permalink
#75: nmslib is now optional (fix tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Sep 15, 2022
1 parent 6258ca7 commit 973a2c7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
13 changes: 11 additions & 2 deletions .devel/pypi_howto.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
Versions:

1.0.9.9001 # development release
1.1.0 # Final Release
1.1.0 # major release


# platform wheels:
~~python3 setup.py bdist_wheel~~

```
~~python3 setup.py bdist_wheel~~
```

Github actions - cibuildwheel - run manually

# source distribution:

```
rm -f dist/*
python3 setup.py sdist
```

(copy files)


# upload to pypi:

```
twine upload dist/*
```

8 changes: 8 additions & 0 deletions .devel/pytest/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
except ImportError:
mlpack = None

try:
import nmslib
except ImportError:
nmslib = None


import os
if os.path.exists("devel/benchmark_data"):
Expand Down Expand Up @@ -53,6 +58,9 @@ def test_cache(metric='euclidean'):

for C in [genieclust.Genie, genieclust.GIc]:
for exact in [True, False]:
if not exact and not nmslib:
continue

for M in [10,2,1]:
os.environ["OMP_NUM_THREADS"] = '1'
t01 = time.time()
Expand Down
2 changes: 0 additions & 2 deletions .devel/pytest/test_warnerr.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,3 @@ def test_warnerr(metric='euclidean'):

if __name__ == "__main__":
test_warnerr()


3 changes: 2 additions & 1 deletion .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ env:
# nmslib does not build on 32bit Windows
# https://cibuildwheel.readthedocs.io/en/stable/options/
# cp39-win_amd64
CIBW_SKIP: cp2* pp* cp35* cp36* cp37-win32 cp38-win32 cp39-win32 cp310-win32 cp311-win32 cp310-manylinux_i686 cp311-manylinux_i686 *-musllinux*
# cp37-win32 cp38-win32 cp39-win32 cp310-win32 cp311-win32
CIBW_SKIP: cp2* pp* cp35* cp36* cp310-manylinux_i686 cp311-manylinux_i686 *-musllinux*
CIBW_BEFORE_BUILD: pip install -r requirements.txt --upgrade

#[ubuntu-latest, windows-latest, macos-latest]
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ jobs:
pip install pip wheel cython --upgrade
pip install -r requirements.txt --upgrade
pip install pytest pytest-cov --upgrade
- name: Install optional dependencies
- name: Install optional dependencies (nmslib)
continue-on-error: true
run: |
pip install nmslib --upgrade
- name: Install optional dependencies (mlpack)
continue-on-error: true
run: |
pip install mlpack --upgrade
Expand Down

0 comments on commit 973a2c7

Please sign in to comment.