-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Build error with the latest setuptool #4539
Comments
This break happened after this PR: #4361, probably related to introduced pyproject.toml file. Still investigating. |
This was referenced Sep 23, 2022
#4558 would be a quick workaround to make onnx build forcely use old legacy development mode for now, but in the long term we should modify the existing build logic to enable the latest editable_mode if it is beneficial. |
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 5, 2023
### Description <!-- - Describe your changes. --> - Move much of the metadata from setup.py to pyproject.toml. Setuptools commands are left unchanged. - Replace `--weekly_build` with the env var `ONNX_PREVIEW_BUILD`. Version number verified locally and in CI. > **Note** > Due to `pyproject.toml` limitation, we need to use a script to rename the package for the weekly build. > On Windows, it is `(Get-Content -Path 'pyproject.toml') | ForEach-Object { $_ -replace 'name = "onnx"', 'name = "onnx-weekly"' } | Set-Content -Path 'pyproject.toml'` > On linux, it is `sed -i 's/name = "onnx"/name = "onnx-weekly"/' 'pyproject.toml'` > Tested locally. - Replace all `setup.py xxx` usage with `pip install` or `python -m build` according to setuptools' suggestions. - The MacOS wheel's platform name needs to be tweaked. Previously it was modified by supplying the `-p` or `--plat-name` option to `setup.py`. Now that we use `python -m build`, I created an env var `ONNX_WHEEL_PLATFORM_NAME` and supply it via the `setup` call: ``` setuptools.setup( ... options={"bdist_wheel": {"plat_name": ONNX_WHEEL_PLATFORM_NAME}} if ONNX_WHEEL_PLATFORM_NAME is not None else {}, ) ``` ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html > Starting with [PEP 621](https://peps.python.org/pep-0621/), the Python community selected pyproject.toml as a standard way of specifying project metadata. Setuptools has adopted this standard and will use the information contained in this file as an input in the build process. https://pypi.org/project/pytest-runner/ > It is recommended that you: > Remove 'pytest-runner' from your setup_requires, preferably removing the setup_requires option. > Remove 'pytest' and any other testing requirements from tests_require, preferably removing the tests_requires option. > Select a tool to bootstrap and then run tests such as tox. fix #4878 and #4539 --------- Signed-off-by: Justin Chu <justinchu@microsoft.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 5, 2023
### Description <!-- - Describe your changes. --> - Move much of the metadata from setup.py to pyproject.toml. Setuptools commands are left unchanged. - Replace `--weekly_build` with the env var `ONNX_PREVIEW_BUILD`. Version number verified locally and in CI. > **Note** > Due to `pyproject.toml` limitation, we need to use a script to rename the package for the weekly build. > On Windows, it is `(Get-Content -Path 'pyproject.toml') | ForEach-Object { $_ -replace 'name = "onnx"', 'name = "onnx-weekly"' } | Set-Content -Path 'pyproject.toml'` > On linux, it is `sed -i 's/name = "onnx"/name = "onnx-weekly"/' 'pyproject.toml'` > Tested locally. - Replace all `setup.py xxx` usage with `pip install` or `python -m build` according to setuptools' suggestions. - The MacOS wheel's platform name needs to be tweaked. Previously it was modified by supplying the `-p` or `--plat-name` option to `setup.py`. Now that we use `python -m build`, I created an env var `ONNX_WHEEL_PLATFORM_NAME` and supply it via the `setup` call: ``` setuptools.setup( ... options={"bdist_wheel": {"plat_name": ONNX_WHEEL_PLATFORM_NAME}} if ONNX_WHEEL_PLATFORM_NAME is not None else {}, ) ``` ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html > Starting with [PEP 621](https://peps.python.org/pep-0621/), the Python community selected pyproject.toml as a standard way of specifying project metadata. Setuptools has adopted this standard and will use the information contained in this file as an input in the build process. https://pypi.org/project/pytest-runner/ > It is recommended that you: > Remove 'pytest-runner' from your setup_requires, preferably removing the setup_requires option. > Remove 'pytest' and any other testing requirements from tests_require, preferably removing the tests_requires option. > Select a tool to bootstrap and then run tests such as tox. fix #4878 and #4539 --------- Signed-off-by: Justin Chu <justinchu@microsoft.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
It is still open and waiting for #5558. |
corwinjoy
pushed a commit
to corwinjoy/onnx
that referenced
this issue
Sep 5, 2023
### Description <!-- - Describe your changes. --> - Move much of the metadata from setup.py to pyproject.toml. Setuptools commands are left unchanged. - Replace `--weekly_build` with the env var `ONNX_PREVIEW_BUILD`. Version number verified locally and in CI. > **Note** > Due to `pyproject.toml` limitation, we need to use a script to rename the package for the weekly build. > On Windows, it is `(Get-Content -Path 'pyproject.toml') | ForEach-Object { $_ -replace 'name = "onnx"', 'name = "onnx-weekly"' } | Set-Content -Path 'pyproject.toml'` > On linux, it is `sed -i 's/name = "onnx"/name = "onnx-weekly"/' 'pyproject.toml'` > Tested locally. - Replace all `setup.py xxx` usage with `pip install` or `python -m build` according to setuptools' suggestions. - The MacOS wheel's platform name needs to be tweaked. Previously it was modified by supplying the `-p` or `--plat-name` option to `setup.py`. Now that we use `python -m build`, I created an env var `ONNX_WHEEL_PLATFORM_NAME` and supply it via the `setup` call: ``` setuptools.setup( ... options={"bdist_wheel": {"plat_name": ONNX_WHEEL_PLATFORM_NAME}} if ONNX_WHEEL_PLATFORM_NAME is not None else {}, ) ``` ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html > Starting with [PEP 621](https://peps.python.org/pep-0621/), the Python community selected pyproject.toml as a standard way of specifying project metadata. Setuptools has adopted this standard and will use the information contained in this file as an input in the build process. https://pypi.org/project/pytest-runner/ > It is recommended that you: > Remove 'pytest-runner' from your setup_requires, preferably removing the setup_requires option. > Remove 'pytest' and any other testing requirements from tests_require, preferably removing the tests_requires option. > Select a tool to bootstrap and then run tests such as tox. fix onnx#4878 and onnx#4539 --------- Signed-off-by: Justin Chu <justinchu@microsoft.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
corwinjoy
pushed a commit
to corwinjoy/onnx
that referenced
this issue
Sep 5, 2023
### Description <!-- - Describe your changes. --> - Move much of the metadata from setup.py to pyproject.toml. Setuptools commands are left unchanged. - Replace `--weekly_build` with the env var `ONNX_PREVIEW_BUILD`. Version number verified locally and in CI. > **Note** > Due to `pyproject.toml` limitation, we need to use a script to rename the package for the weekly build. > On Windows, it is `(Get-Content -Path 'pyproject.toml') | ForEach-Object { $_ -replace 'name = "onnx"', 'name = "onnx-weekly"' } | Set-Content -Path 'pyproject.toml'` > On linux, it is `sed -i 's/name = "onnx"/name = "onnx-weekly"/' 'pyproject.toml'` > Tested locally. - Replace all `setup.py xxx` usage with `pip install` or `python -m build` according to setuptools' suggestions. - The MacOS wheel's platform name needs to be tweaked. Previously it was modified by supplying the `-p` or `--plat-name` option to `setup.py`. Now that we use `python -m build`, I created an env var `ONNX_WHEEL_PLATFORM_NAME` and supply it via the `setup` call: ``` setuptools.setup( ... options={"bdist_wheel": {"plat_name": ONNX_WHEEL_PLATFORM_NAME}} if ONNX_WHEEL_PLATFORM_NAME is not None else {}, ) ``` ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html > Starting with [PEP 621](https://peps.python.org/pep-0621/), the Python community selected pyproject.toml as a standard way of specifying project metadata. Setuptools has adopted this standard and will use the information contained in this file as an input in the build process. https://pypi.org/project/pytest-runner/ > It is recommended that you: > Remove 'pytest-runner' from your setup_requires, preferably removing the setup_requires option. > Remove 'pytest' and any other testing requirements from tests_require, preferably removing the tests_requires option. > Select a tool to bootstrap and then run tests such as tox. fix onnx#4878 and onnx#4539 --------- Signed-off-by: Justin Chu <justinchu@microsoft.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 7, 2023
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 <justinchu@microsoft.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Is the issue related to model conversion?
No
Describe the bug
Building from source with
pip install -e .
resulted in an error with the latest setuptool.Running
works.
System information
Reproduction instructions
pip install -e .
Expected behavior
Notes
The text was updated successfully, but these errors were encountered: