Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use packaging instead of deprecated distutils for version handling #3191

Closed
wants to merge 6 commits into from
Closed
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
1 change: 1 addition & 0 deletions conda/faiss-gpu-raft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ outputs:
run:
- python {{ python }}
- numpy >=1.19,<2
- packaging
- {{ pin_subpackage('libfaiss', exact=True) }}
test:
requires:
Expand Down
1 change: 1 addition & 0 deletions conda/faiss-gpu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ outputs:
run:
- python {{ python }}
- numpy >=1.19,<2
- packaging
- {{ pin_subpackage('libfaiss', exact=True) }}
test:
requires:
Expand Down
1 change: 1 addition & 0 deletions conda/faiss/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ outputs:
run:
- python {{ python }}
- numpy >=1.19,<2
- packaging
- {{ pin_subpackage('libfaiss', exact=True) }}
test:
requires:
Expand Down
4 changes: 2 additions & 2 deletions faiss/python/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

from distutils.version import LooseVersion
from packaging.version import Version
import platform
import subprocess
import logging
Expand All @@ -25,7 +25,7 @@ def supported_instruction_sets():
{"NEON", "ASIMD", ...}
"""
import numpy
if LooseVersion(numpy.__version__) >= "1.19":
if Version(numpy.__version__) >= Version("1.19"):
# use private API as next-best thing until numpy/numpy#18058 is solved
from numpy.core._multiarray_umath import __cpu_features__
# __cpu_features__ is a dictionary with CPU features
Expand Down
2 changes: 1 addition & 1 deletion faiss/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
license='MIT',
keywords='search nearest neighbors',

install_requires=['numpy'],
install_requires=['numpy', 'packaging'],
packages=['faiss', 'faiss.contrib'],
package_data={
'faiss': ['*.so', '*.pyd'],
Expand Down