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

Use meson to build extension #11

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

tobiscode
Copy link
Collaborator

@tobiscode tobiscode commented Mar 18, 2024

Hi,
I was able to track the error to some unintuitive (or buggy) behavior in how meson and/or f2py use the .pyf file. Specifically, it seems that the part where it specifies the output of the DC3D(0) functions is at least partially ignored. By adding the intent as a comment into the source .f file, the expected behavior is restored. (I'm not sure whether the .pyf file is still needed, but I kept it in for now.)
I took the liberty of addressing some linter messages and removing the LaTeX dependency for test_okada.py to make it easier for people to test everything, please feel free to ignore these parts of the PR if desired.
I hope this fixes #8 ; I've tested it with Python 3.12 myself and the installation and and test_okada.py work now.
Cheers

dxiao and others added 4 commits February 19, 2024 21:39
* Convert setup.py -> pyproject.toml
* Remove VERSION file in favor of having information in pyproject.toml directly
* Add meson.build files for okada_wrapper and DC3D modules
  Conversion was done according to information at
  https://numpy.org/doc/stable/f2py/buildtools/meson.html

Note:
* This commit gets `pip install .` to work, `import okada_wrapper` to work,
  but not `test_okada.py` yet. Help would be appreciated.
@tobiscode
Copy link
Collaborator Author

Oh, I didn't change the version number, that's maybe something to consider to make it clearer for pip installations to see it was updated and now has different requirements.

@brendanjmeade
Copy link
Collaborator

Wow! This is fantastic. Is it the python version that needs to be updated in environment.yml? Something else?

@tbenthompson
Copy link
Owner

@tobiscode This is fantastic!! Thank you so much. I'm going to give this PR a look over as soon as I can but I'll probably just merge it. Then I'll release a new version. It might be this week but it might take until this weekend because I'm on a work trip and it's quite busy.

@brendanjmeade If I remember correctly, there are several places. environment.yml and setup.py come to mind.

@tbenthompson tbenthompson merged commit b002e97 into tbenthompson:master Mar 19, 2024
@tbenthompson
Copy link
Owner

Ok, I got excited and looked through! All great stuff. Thanks again.

@tobiscode
Copy link
Collaborator Author

tobiscode commented Mar 19, 2024

Awesome! Since setup.py isn't a thing anymore, the only place to update the package version is pyproject.toml (version = "18.12.08.3"). For the users, nothing should change since all changes are backwards-compatible / enforced by the use of the meson backend, so the part requires-python = ">=3.8" inside pyproject.toml can probably just stay. I don't see an environment.yml file but that is probably also fine.

@tobiscode tobiscode deleted the feature/meson_distutils branch March 19, 2024 16:11
@brendanjmeade
Copy link
Collaborator

Thanks Tobias! That makes a lot of sense.

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.

Request for help: Upgrade okada_wrapper to work with Python 3.12 and up.
4 participants