Skip to content

Switch to hatch #15

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

Merged
merged 3 commits into from
Jul 18, 2023
Merged

Switch to hatch #15

merged 3 commits into from
Jul 18, 2023

Conversation

frankier
Copy link
Collaborator

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 frankier requested a review from flying-sheep July 17, 2023 15:05
@frankier
Copy link
Collaborator Author

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

@flying-sheep
Copy link
Collaborator

flying-sheep commented Jul 17, 2023

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.

Copy link
Collaborator

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! As said, there’s a different way to do dependencies, but that’s up to you.

@frankier frankier marked this pull request as ready for review July 18, 2023 10:49
@frankier frankier merged commit 883a584 into main Jul 18, 2023
@flying-sheep flying-sheep deleted the switch-to-hatch branch July 18, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants