-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Path dependencies with setup.py cannot be installed if setup.py imports numpy
(or more general, imports any site-packages)
#3364
Comments
Looks to me like you might need a
Although it might get complicated for the editable installation... |
numpy
numpy
(or more general, imports any site-packages)
Yes that could help, but it is less ideal. This means that all the previously written setup.py |
@hyliu1989 I do not understand what you mean. Edit Oh, you mean |
Are there a discussion and documentations about build isolation? I would like to know how to deactivate it. |
@hyliu1989 I do not have a self contained link to suggest, nothing that comes to mind. You might have to read a bit everywhere.
|
@hyliu1989 your case is exactly why PEP 517 was invented: The need to know which packages are needed to build the package before starting the build process. So the way that @sinoroc shows above is the correct solution. |
@finswimmer I got that to fix this problem requires a [build-system].requires and a pyproject.toml in |
@hyliu1989 You can add the minimal |
@sinoroc Thanks! Now I remember seeing that poetry says setup.py exists and it is going to use that setup.py. Having a pyproject.toml with minimal specification will be a solution to my question. A follow-up question is: will poetry support running an existing setup.py in the foreseeable future? Is this behavior something poetry will get rid of? |
That is the beauty of it. poetry nor pip (the build front ends) do not need to support setuptools (or any other build back ends) directly. As long as they all agree to the PEP 517 standard (which is declared in the In those cases, no need for poetry (or pip) to execute the I hope it is clear, let me know if some things need more details. |
Now that I re-read your question:
I think I missed the point of it. So allow me to rectify... To be honest, I do not know if poetry will forever be able to install projects that have a My personal opinion is: as much as I would like to get rid of those, there is such a huge amount of older pre-PEP517 projects (i.e. |
There are currently no plans to drop the support for non-pyproject.toml projects. Furthermore PEP517 says "If the pyproject.toml file is absent, or the build-backend key is missing, the source tree is not using this specification, and tools should revert to the legacy behaviour of running setup.py (either directly, or by implicitly invoking the setuptools.build_meta:legacy backend)." |
is there a way to install a local project that is only contained in a
Anytime I use |
@zoj613 This is not related to the rest of the current discussion, is it? I think your query is similar to this one, please read that discussion. And if it does not correspond to what you want then I would recommend you to open your own new ticket (or come to poetry's Discord chat channel). |
I'm trying to install a local package that has a submodule. The submodule's build needs |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option).Issue
I have searched in here and found #2638 is similar but not the same problem as I am facing. I have also tried a possible solution of
[build-system].requires
and consulted its documentation (as specified in #744) but no success. Here is a snapshot of the error message:I will reuse its structure and show how the problem is reproduced.
The project structure is something like
The toml file is
And
./lib/my-dev-module/setup.py
is likeThe setup() in setup.py is a placeholder and the script does not get executed to setup(). It erred out at line 2 when importing numpy. In my actual application, module numpy is used to provide its C library for non-Python extension.
My question is: why does it fail at importing numpy? Shouldn't specifying
[build-system].requires
fix this? If not, I got that to fix this problem requires a[build-system].requires
and a pyproject.toml inmydevmodule
but that is not an ideal solution. Is there any other ways to specify the installation time requirements of a path-dependency module? Note that I have put numpy in both the dependencies and build-system requirement of the top-level projecttestmodule
.The text was updated successfully, but these errors were encountered: