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 pyproject.toml file #195

Merged
merged 14 commits into from
Oct 10, 2024
Merged

Conversation

agseaton
Copy link
Contributor

No description provided.

@bluescarni
Copy link
Owner

bluescarni commented Sep 24, 2024

Thanks for the PR @agseaton !

I have worked on it a bit, mostly cleanups and formatting, plus modifying the CI to use pyproject.toml to build the wheels.

There's a couple of tentative modifications I made about which it would be good to get your feedback:

  • I removed pybind11 as a a dependency in pyproject.toml, on grounds that the heyoka.py build system just cares about the C++ bits of pybind11 (and I do not think the build system would be able to detect a pybind11 installation somewhere in the Python modules path anyway, rather than /usr/include or some other C++ prefix);
  • I have added the wheel.packages = [] option to the [tool.scikit-build] section of the pyproject.toml because I noticed that the binary wheel contained the C++ source files of heyoka.py, which I wanted to avoid. I do not know however what are the consequences for e.g. sdist, as I have not tried that out yet...

Thanks again, that is pretty great progress :)

@bluescarni
Copy link
Owner

@agseaton I will go ahead and merge this for the next version, we can iterate rapidly with additional patch versions if more changes are needed.

Thanks again!

@bluescarni bluescarni merged commit 9106752 into bluescarni:main Oct 10, 2024
1 of 16 checks passed
@agseaton
Copy link
Contributor Author

Sounds good! Sorry for not getting back to you earlier on this. I have been busy and am currently on travel so won't be able to take a look for another week or so.

@bluescarni
Copy link
Owner

Sounds good! Sorry for not getting back to you earlier on this. I have been busy and am currently on travel so won't be able to take a look for another week or so.

No worries!

FYI, I tried to produce an sdist and it seems like everything in the resulting archive was included (not sure how it did it, seems like black magic to me).

In any case, let me know how it goes when you have time to try out.

@agseaton
Copy link
Contributor Author

agseaton commented Oct 18, 2024

Okay I gave it a go, and I'm not able to build with the changes you made. I think we do actually need the pybind11 build requirement.

Presumably this worked in CI because pybind11 was already installed there?

As a side note, I also wasn't able to install from source using PYPI, i.e. this fails:

pip3 install --no-binary :all: heyoka

To do a source install I had to pull heyoka.py direct from the repo. I'm guessing you need to submit a source distribution to get that to work.

Edit: or maybe this has something to do with the wheel.packages =[] line?

@bluescarni
Copy link
Owner

@agseaton sorry for the late reply...

The wheel.packages =[] line should only prevent the inclusion of the cpp files in the wheel, as far as I have seen from my local testing.

Okay I gave it a go, and I'm not able to build with the changes you made. I think we do actually need the pybind11 build requirement.

Indeed in my testing I had installed pybind11 without pip. In the CI, we are installing pybind11 without pip (i.e., directly from source) and as you can see it is working ok:

https://github.com/bluescarni/heyoka.py/actions/runs/11275749409/job/31357924774

I am fine with re-introducing pybind11 in the pyproject.toml if that helps things out with spack and possibly other package managers.

As a side note, I also wasn't able to install from source using PYPI

Yes that is expected, I have not uploaded an sdist because I haven't managed yet to test it properly. As soon as we can confirm it works as expected, I will add another build to the CI that also uploads the sdist.

@agseaton
Copy link
Contributor Author

Okay, I see. As far as I can tell, including the pybind11 line should be sufficient to get the sdist working in pip, but I agree it'd be best to test that in CI once you have a chance to get that going.

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