Skip to content

Commit

Permalink
Fix some dependencies for easy installation (#47)
Browse files Browse the repository at this point in the history
* 🎨 lessen dependencies

* 🔥 remove py3.5 tests

* texmex-python as extra package

* cannot installed with python3.10

---------

Co-authored-by: Keisuke Ogaki <[email protected]>
  • Loading branch information
Hi-king and Keisuke Ogaki authored Oct 15, 2023
1 parent 1290070 commit 530f8f9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 3
matrix:
platform: [ubuntu-latest]
python-version: [3.5, 3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ python setup.py install


```
# evaluation needs extra texmex package
pip install pqkmeans[texmex]
# with artificial data
python bin/run_experiment.py --dataset artificial --algorithm bkmeans pqkmeans --k 100
# with texmex dataset (http://corpus-texmex.irisa.fr/)
Expand Down
5 changes: 4 additions & 1 deletion pqkmeans/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import six.moves.urllib
import tarfile
import texmex_python


def get_gmm_random_dataset(k, dimension=100, test_size=5000, train_size=500):
Expand Down Expand Up @@ -39,6 +38,10 @@ def get_sift1m_dataset(cache_directory="."):


def get_texmex_dataset(url, filename, member_names, cache_directory="."):
try:
import texmex_python
except ImportError:
raise ImportError("Missing optional dependency 'texmex_python'. You must install it to use this dataset.")
path = os.path.join(cache_directory, filename)
if not os.path.exists(path):
print("downloading {}".format(url))
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
numpy
numpy<1.21
scikit-learn
pipe
pipe<2.0
scipy
six
texmex_python==1.0.0
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,7 @@ def build_extension(self, ext):
cmdclass=dict(build_ext=CMakeBuild),
test_suite='test',
zip_safe=False,
extras_require={
"texmex": ["texmex-python>=1.0.0"],
},
)

0 comments on commit 530f8f9

Please sign in to comment.