-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Question] Editable install fails after introducing pyproject.toml #3606
Comments
Hi @jcwchen thank you very much for reporting this. I believe the following is happening:
I did a quick test here with the following modification in diff --git i/setup.py w/setup.py
index 1ce70a4d..c23cdbb0 100644
--- i/setup.py
+++ w/setup.py
@@ -240,6 +240,7 @@ class build_py(setuptools.command.build_py.build_py):
dst = os.path.join(TOP_DIR, os.path.relpath(src, CMAKE_BUILD_DIR))
self.copy_file(src, dst)
+ self.editable_mode = False
return setuptools.command.build_py.build_py.run(self) This is a quick-and-dirty way of convincing Please note however that this may copy files to temporary folders that are simply ignored (the files added to
I don't think backwards compatibility between the I believe the best step moving forward would be for
Please let me know if you are able to trace this error to a different part of |
Thank you @abravalheri so much for the quick response and detailed explanation. Much appreciated. I can confirm that the "quick-and-dirty way" (
Perhaps a naive question: what's difference between editable_wheel and develop command? Is there any drawback if a project only works with develop command?
I am happy to dig deeper into this issue, but how can I help? Are there concrete action items? I have a question: why having pyproject.toml matters here? (Adding pyproject.toml causes this error) Thank you for answering. |
The motivation behind my initial words is that I am happy to review everything I have said if anyone finds out a different reason/root cause for the problem. But to be sincere, I don't believe there is anything else...
This behaviour is motivated by PEP 517/PEP 660. Although these PEP are not 100% prescriptive, I believe that The TL;DR is: after PEP 517/PEP 660 all projects that want to be built/installed in editable mode SHOULD have a What |
Enable editable builds for `pip install -e .` by fixing a path not found error in `setup.py`. Previously `Develop` calls `BuildExt` which assumes the directory `{build_lib}/onnx` exists because `BuildPy` would create it. However `BuildPy` is not called in editable build, thus not creating the directory for `BuildExt` to put the artifacts in. This change updates `BuildExt` to create the directory for its own use independent of previous steps. - Remove `CreateVersion` and moved the logic into a function to parameterize it - General cleanup and refactor logic Tested with ``` pip install -e . pip install . python -m build python -m build --sdist python setup.py develop ``` Reference: pypa/setuptools#3606 Fixes #4539 --------- Signed-off-by: Justin Chu <[email protected]> Signed-off-by: Justin Chu <[email protected]>
setuptools version
65.3.0
Python version
3.9
OS
Windows
Additional environment information
No response
Description
Thank you for maintaining setuptools! Recently we saw
pip install -e .
started to fail after adding pyproject.toml in the package. Not sure whether it is a bug or we need to set something else properly in pyproject.toml. Provide some findings here:pip install -e .
will fail due to missing.pyd
file (FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\jacky\AppData\Local\Temp\tmpba9gls20.build-lib\onnx\onnx_cpp2py_export.cp39-win_amd64.pyd')set SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
and thenpip install -e .
works finepip install -e .
without addedpyproject.toml
works fineI tried to find any related existing issues, but I didn't find a solution except adding
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
. I am not sure whether this issue is related: #3557. Thus, I would like to confirm if it is a known issue that will be fixed fromsetuptools
side, or something we should fix in our package. Thank you for looking into it.Related issue: onnx/onnx#4539.
Expected behavior
pip install -e .
should build without errors.How to Reproduce
Build onnx from source with editable mode:
Output
The text was updated successfully, but these errors were encountered: