-
Notifications
You must be signed in to change notification settings - Fork 525
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
wheel building with scikit build core #3087
base: develop
Are you sure you want to change the base?
Conversation
for anyone interested in wheels that contain DAGMC, Double Down, Embree and Moab options in the OpenMC executable then I have that working on this branch, clone or checkout that branch |
just to note a new pip version is needed to pass in cmake arguments via the command line, if you get this error then upgrade pip (I'm using version 24.1.2)
solve with
|
nice the docs on readthedocs are now working, it needed a bit of tweaking as they now installing the package with this scikit build core method. |
9775ca8
to
b0995b8
Compare
Just solved a couple of conflicts to keep this branch up to date |
- name: Publish package to PyPI | ||
if: success() | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
twine upload wheelhouse/*.whl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the more modern trusted-publishers method and avoid the need to generate repo tokens
https://docs.pypi.org/trusted-publishers/
- name: Publish package to PyPI | |
if: success() | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
twine upload wheelhouse/*.whl | |
- name: Publish a Python distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
package-dir: openmc | ||
output-dir: wheelhouse | ||
config-file: "{package}/pyproject.toml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the config-file does not need setting if the package dir is not set to openmc
package-dir: openmc | |
output-dir: wheelhouse | |
config-file: "{package}/pyproject.toml" | |
package-dir: . | |
output-dir: wheelhouse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, but in my case, I found that it was failing. I followed the guidelines provided by cibuildwheel.
python package wheel can be built and tested on this PR using these commands from this branch with python 3.12, I can't get python 3.11 to work # build manylinux image
docker build -t openmc -f tools/ci/manylinux.dockerfile .
docker build --no-cache --build-arg Python_ABI=cp312-cp312 -t openmc_wheel:python3.12 -f tools/ci/manylinux.dockerfile . copy out the wheels
docker image for testing resulting wheel called FROM ubuntu:22.04
RUN apt upgrade -y
RUN apt update -y
RUN apt install libmpich-dev libhdf5-serial-dev libhdf5-mpich-dev libhdf5-hl-100 libhdf5-dev -y
RUN apt install -y python3.12 python3-pip -y
COPY wheelhouse/openmc-0.15.1.dev0-cp312-cp312-manylinux_2_28_x86_64.whl .
RUN python3.11 -m pip install openmc-0.15.1.dev0-cp312-cp312-manylinux_2_28_x86_64.whl
RUN python3.11 -c "import openmc.lib" docker build -f wheeltest.Dockerfile --build-arg python_version=3.12 . |
Co-authored-by: Jon Shimwell <jon@proximafusion.com>
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
How is Python 3.11 able to install a package built for Python 3.12! |
Description
Just making this PR to show a bit of progress with the production of wheels using scikit build core. Tagging @hassec as he made the
OpenMCExtension
part of this PR.Running
pip install .
in the root folder of this repo and this will compile openmc and build a wheel and then install the python package and openmc executable from the wheel with default cmake args.It is also possible to pass in cmake args via the command line in the same line as the pip install command.
you can also run
pip install . --no-clean
This will do the same but it won't delete the wheel afterwards. This allows you to inspect the wheel and manually install from the wheel. The path to the wheel is printed to the terminal and will be in your /tmp folderI've added some
if(SKBUILD)
statements to the CMakeLists.txt to help insure the new commands only run if the process is being driven by Scikit build core and therefore this preserves the current behavior when someone wants to build the executable with cmakeI can follow up this PR to include ciwheelbuilder to make wheels for different OS versions
Fixes # (issue)
Checklist