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

Created basic pyproject.toml #10

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

pawel-biernacki-roche
Copy link
Contributor

@pawel-biernacki-roche pawel-biernacki-roche commented Mar 20, 2024

Created a very basic pyproject.toml, so that it is possible to install the package with e.g. poetry.

Previously, the following error was raised:

ChefBuildError Backend subprocess exited when trying to invoke get_requires_for_build_wheel

@charlesll charlesll merged commit 0426b81 into charlesll:master Mar 20, 2024
1 check passed
@pawel-biernacki-roche
Copy link
Contributor Author

@charlesll would it be possible to release a new version of the package to pypi? Much appreciated!

@charlesll
Copy link
Owner

Yes, will do that in the upcoming days!

@pawel-biernacki-roche
Copy link
Contributor Author

Wonderful! Much appreciated 🙌

@charlesll
Copy link
Owner

Hi @pawel-biernacki-roche , I am actually looking at switching to a full pyproject.toml file, but this creates issues with compilation of the FORTRAN code... It is apparently not possible to do the same things that I did in my setup.py file, if I understood right. This issue already exists when working with your minimal pyproject.toml file.

Pyproject does not allow handling the Fortran compilation and extension as setup.py does.

Any idea how to solve this issue ?

@pawel-biernacki-roche
Copy link
Contributor Author

Hi @charlesll ,

I have investigated this a bit and it seems to me that you won't be able to fully drop the setup.py; I have found this two links that are a bit more informative:

However, I personally would still recommend to move as much as possible to pyproject.toml. In our closed-source code we use it to configure tests, dependencies (for poetry environment, which we then use to build the package), linter, styler, etc.

In case you want to go poetry way, then these discussions are quite interesting (and perhaps some kind of a starting point):

@pawel-biernacki-roche
Copy link
Contributor Author

Hi @charlesll ! Is there any progress on pushing the new package to pypi? It starts to become a blocker for our work... Is there maybe something we could help out with?

@charlesll
Copy link
Owner

Hi @pawel-biernacki-roche unfortunately I did not make any progress on this side because when I include the pyproject.toml, the compilation of the FORTRAN code does not work anymore when doing pip install gcvspline. Right now I haven't found a solution (see comments above) or maybe I missed something?

@charlesll
Copy link
Owner

I confirm the following error when trying to install with your pyproject.toml;

import gcvspline
Traceback (most recent call last):
File "", line 1, in
File "/media/charles/DATA/Documents/gcvspline/gcvspline/init.py", line 1, in
from .gcvspline1 import *
File "/media/charles/DATA/Documents/gcvspline/gcvspline/gcvspline1.py", line 12, in
from . import _gcvspl as gcvspl
ImportError: cannot import name '_gcvspl' from partially initialized module 'gcvspline' (most likely due to a circular import) (/media/charles/DATA/Documents/gcvspline/gcvspline/init.py)

I don't get why I have this error...

@pawel-biernacki-roche
Copy link
Contributor Author

pawel-biernacki-roche commented May 7, 2024

@charlesll I have worked a bit more on the pyproject.toml, mostly moving the metadata. I am able to build the wheel with the definition that I have. I also manage to install it in our poetry environments.

We have, however, encountered issues when installing the project with python 3.8, so will investigate that more. In the meantime, shall I open a PR for the pyproject.toml enhancement?

The installation in py3.9 goes fine:
image

@charlesll
Copy link
Owner

Yes, please open a PR and I will also test it on my side.

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