scikit-learn-contrib / sklearn-ann

Integration with (approximate) nearest neighbors libraries for scikit-learn + clustering based on with kNN-graphs.
https://sklearn-ann.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
15 stars 6 forks source link

Switch to hatch #15

Closed frankier closed 1 year ago

frankier commented 1 year ago

Is this what you were thinking of @flying-sheep ? It seems to work quite well, and Hatch does seem to be a small but noticeable improvement over Poetry. The one thing I couldn't figure out is how throw an error if Python == 3.11 and nmslib is selected (Python 3.11 is not currently supported by nmslib). Any ideas? (No idea how to do this in Poetry either).

frankier commented 1 year ago

Okay looks like I have to update the CI. Will work on that tomorrow.

flying-sheep commented 1 year ago

Okay looks like I have to update the CI

it was easy enough, unless we want a lockfile (which I’m not a huge fan for in CI for a library)

Hatch does seem to be a small but noticeable improvement over Poetry.

I think its environments are really nice to work with.

One thing we could do if you want is move the tests and so on features to hatch’s env config, something like this

[tool.hatch.envs.test]
dependencies = ['pytest', '...']
scripts.test = 'pytest {args}'

It would require using hatch in CI, but would keep the test dependencies from leaking into package metadata.

he one thing I couldn't figure out is how throw an error if Python == 3.11 and nmslib is selected (Python 3.11 is not currently supported by nmslib).

They should specify requires-python >="...", <"3.11" in the metadata of all affected PyPI versions. If they didn’t, there’s nothing we can do.