File tree Expand file tree Collapse file tree 4 files changed +22
-22
lines changed Expand file tree Collapse file tree 4 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,12 @@ perform competitively in high dimensional spaces.
53
53
Development
54
54
===========
55
55
56
- This project is managed using Hatch _ and pre-commit _. To get started, run ``pre-commit
57
- install `` and ``hatch env create ``. Run all commands using ``hatch run python
58
- <command> `` which will ensure the environment is kept up to date. pre-commit _ comes into
59
- play on every `git commit ` after installation.
56
+ This project is managed using Hatch _ and pre-commit _.
57
+ To get started, run ``pre-commit install ``.
58
+ pre-commit _ comes into play on every `git commit ` after installation.
59
+
60
+ Use the commands `hatch test ` and `hatch run docs:build ` to
61
+ run the tests and build the documentation, respectively.
60
62
61
63
Consult ``pyproject.toml `` for which dependency groups and extras exist,
62
64
and the Hatch help or user guide for more info on what they are.
Original file line number Diff line number Diff line change 5
5
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6
6
7
7
import os
8
+ from pathlib import PurePosixPath
8
9
9
10
# -- Path setup --------------------------------------------------------------
10
11
61
62
repository_url = "https://github.com/frankier/sklearn-ann" ,
62
63
repository_branch = os .environ .get ("READTHEDOCS_GIT_IDENTIFIER" , "main" ),
63
64
)
64
- rtd_links_prefix = "src"
65
+ rtd_links_prefix = PurePosixPath ( "src" )
65
66
66
67
autodoc_mock_imports = ["annoy" , "faiss" , "pynndescent" , "nmslib" ]
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ content-type = "text/x-rst"
54
54
path = " README.rst"
55
55
start-after = " .. inclusion-marker-do-not-remove\n\n "
56
56
57
+ [tool .hatch .build .targets .wheel ]
58
+ packages = [" src/sklearn_ann" ]
59
+
57
60
[tool .pytest .ini_options ]
58
61
addopts = [
59
62
" --import-mode=importlib" ,
@@ -84,19 +87,14 @@ ignore = [
84
87
[tool .ruff .lint .isort ]
85
88
known-first-party = [" sklearn_ann" ]
86
89
87
- [tool .hatch .envs .default ]
88
- features = [
89
- " tests" ,
90
- " docs" ,
91
- " annlibs" ,
92
- ]
90
+ [tool .hatch .envs .hatch-test ]
91
+ features = [" tests" , " annlibs" ]
92
+ default-args = []
93
93
94
- [tool .hatch .envs .default .scripts ]
95
- test = " pytest {args:tests}"
96
- build-docs = " sphinx-build -M html docs docs/_build"
97
-
98
- [tool .hatch .build .targets .wheel ]
99
- packages = [" src/sklearn_ann" ]
94
+ [tool .hatch .envs .docs ]
95
+ features = [" docs" ]
96
+ [tool .hatch .envs .docs .scripts ]
97
+ build = " sphinx-build -M html docs docs/_build"
100
98
101
99
[build-system ]
102
100
requires = [" hatchling" , " hatch-vcs" , " hatch-fancy-pypi-readme" ]
Original file line number Diff line number Diff line change 1
1
from sklearn_ann .test_utils import assert_row_close , needs
2
2
3
- try :
4
- from sklearn_ann .kneighbors .faiss import FAISSTransformer
5
- except ImportError :
6
- pass
7
-
8
3
9
4
@needs .faiss
10
5
def test_euclidean (random_small , random_small_pdists ):
6
+ from sklearn_ann .kneighbors .faiss import FAISSTransformer
7
+
11
8
trans = FAISSTransformer (metric = "euclidean" )
12
9
mat = trans .fit_transform (random_small )
13
10
euclidean_dist = random_small_pdists ["euclidean" ]
@@ -16,6 +13,8 @@ def test_euclidean(random_small, random_small_pdists):
16
13
17
14
@needs .faiss
18
15
def test_cosine (random_small , random_small_pdists ):
16
+ from sklearn_ann .kneighbors .faiss import FAISSTransformer
17
+
19
18
trans = FAISSTransformer (metric = "cosine" )
20
19
mat = trans .fit_transform (random_small )
21
20
cosine_dist = random_small_pdists ["cosine" ]
You can’t perform that action at this time.
0 commit comments