8000 Add build and publication workflow of Python wheels by ajaust · Pull Request #16 · equinor/si4ti · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add build and publication workflow of Python wheels #16

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 5 commits into from
May 12, 2025

Conversation

ajaust
Copy link
Contributor
@ajaust ajaust commented May 8, 2025

No description provided.

@ajaust ajaust marked this pull request as ready for review May 8, 2025 09:40
@ajaust ajaust force-pushed the impr/add-publication-workflow branch 3 times, most recently from b5c517d to 50c3ba1 Compare May 8, 2025 12:05
@ajaust
Copy link
Contributor Author
ajaust commented May 8, 2025

Over the last weeks the memory tests of the wheels build on Ubuntu latest have become flaky. I did not observe any problems 1 month ago, but since recently, the memory tests occasionally fail on Python 3.11 and Python 3.12. The memory footprint is only slightly increased, but still increased. I wanted to mention this, but I am not sure what to do about it either.

Here is a failed GitHub Action run in which the memory limit was exceeded by 600 KB.

Copy link
Contributor
@achaikou achaikou left a comment

Choose a reason for hiding this comment

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

Looks nice! 👍 Tests seem to be running from virtual environment too, so good!

Copy link
Contributor Author
@ajaust ajaust left a comment

Choose a reason for hiding this comment

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

Thanks for the review! I added fixups to address the issues. 🙂

Copy link
Contributor
@achaikou achaikou left a comment

Choose a reason for hiding this comment

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

Great that you actually tested how it works with Test pypi! 😻
Now I know that we would be able to switch the same for segyio and dlisio as with last release we already got a complain as to why we are not using the Trusted Publisher.

@ajaust ajaust force-pushed the impr/add-publication-workflow branch from 5579acc to e04185e Compare May 9, 2025 11:15
Copy link
Contributor Author
@ajaust ajaust left a comment

Choose a reason for hiding this comment

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

👍 I added a fixup and a new commit to increase the memory limit for the memray tests.

Copy link
Contributor
@achaikou achaikou 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 to me! 🐱
Rebase and merge :)

ajaust added 5 commits May 12, 2025 07:50
The publication workflow is based on cibuildhweel [1] and is based on
the workflow of other repositories such as segyio [2]. The workflow is
pre-approved to run to publish as trusted publisher [3].

We currently only build wheels that are relevant for the foreseen
applications (Linux) and other platforms for which creation of wheels
was rather straightforward. Therefore, no Windows wheels are built.

The source distribution (sdist) is not build as it would require some
larger restructuring of the repository. It appears to be non-trivial to
package the sdist if the `pyproject.toml` is not in the root directory
of all files to be included in the sdist. In our case, the impedance
source code, test data, README etc. are all accessible from the parent
directory of `pyproject.toml` instead of the directory the
`pyproject.toml` resides in.

[1]: https://cibuildwheel.pypa.io/en/stable/
[2]: https://github.com/equinor/segyio
[3]: https://docs.pypi.org/trusted-publishers/using-a-publisher/
The previous version, 1.1.0a1, was released manually and is only
available on PyPI as it was inteded for testing the Python bindings. We
bump the version number to 1.1.0a2 with the intend to tag it. This
should trigger the publication workflow to push new wheels to PyPI and
lets us create a new release on GitHub.
It is almost end of life and we cannot test the wheels on MacOS due to
issues with h5py during the installation of xtgeo.
The bound is increased by 1 MB for each test. Without the change we
observe some flakyness of the memory tests on GitHub for the built
wheels. This is in accordance with the memray documentation [1] that
states

    As the Python interpreter has its own object allocator it’s possible
    that memory is not immediately released to the system when objects
    are deleted, so tests using this marker may need to give some room
    to account for this.

[1]: https://pytest-memray.readthedocs.io/en/latest/usage.html#pytest.mark.limit_memory
@ajaust ajaust force-pushed the impr/add-publication-workflow branch from e04185e to b8272e9 Compare May 12, 2025 05:52
@ajaust ajaust merged commit 4947fc2 into equinor:main May 12, 2025
10 checks passed
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
0