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

Add cibuildwheel #124

Merged
merged 1 commit into from
Nov 10, 2023
Merged

Add cibuildwheel #124

merged 1 commit into from
Nov 10, 2023

Conversation

severinsimmler
Copy link
Contributor

This PR introduces cibuildwheel to build wheels for different platforms (i.e. Windows, Linux and macOS).

I'll add a GitHub Actions workflow in the next PR where this can actually be used, but you can try it out locally by running:

$ cibuildwheel --platform linux

(Assuming you have installed build dependencies with poetry install --only build --no-root)

Note that specifying macos or windows as platform only works on that operating system, but linux works on all three, as long as Docker/Podman is installed.

This will produce 8 wheels:

$ tree wheelhouse/
wheelhouse/
├── lda-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
├── lda-2.0.0-cp310-cp310-musllinux_1_1_x86_64.whl
├── lda-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
├── lda-2.0.0-cp311-cp311-musllinux_1_1_x86_64.whl
├── lda-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
├── lda-2.0.0-cp312-cp312-musllinux_1_1_x86_64.whl
├── lda-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
└── lda-2.0.0-cp39-cp39-musllinux_1_1_x86_64.whl

@@ -51,6 +51,6 @@ def test_lda_sparse(self):
np.testing.assert_array_almost_equal(model.topic_word_.sum(axis=1), np.ones(K))

def test_lda_sparse_error_float(self):
dtm = self.dtm.astype(np.float)
dtm = self.dtm.astype(float)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This raised:

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?


[tool.cibuildwheel]
build = "cp39-* cp310-* cp311-* cp312-*"
skip = ["pp*", "*i686", "*win32"]
Copy link
Contributor Author

@severinsimmler severinsimmler Oct 30, 2023

Choose a reason for hiding this comment

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

We have to skip these because of numpy/numpy#24703 (comment)
and there were also problems with win32 builds (some files NumPy relies on were unavailable iirc).

@severinsimmler severinsimmler marked this pull request as ready for review October 30, 2023 16:55
@ariddell
Copy link
Contributor

This looks great. Thank you!

Might take me a week or two to check everything.

@ariddell ariddell merged commit 715e7df into lda-project:develop Nov 10, 2023
@ariddell
Copy link
Contributor

Thanks. This all looks good.

@severinsimmler severinsimmler deleted the feat/cibuildwheel branch November 13, 2023 15:47
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