-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Clean up setup.py in favor of pyproject.toml #4879
Conversation
e7db237
to
aae0d6d
Compare
package find may need update |
@jcwchen |
0b615b7
to
f7197d0
Compare
Good question. Although I am not very familiar with setuptools, I guess by default build_ext will be run under some circumstances? |
Looks like only macOS is failing. Could you trigger the release pipelines? |
[100%] Built target onnx_cpp2py_export |
Retrigger release CIs |
|
7157829
to
aaf13fd
Compare
516312d
to
b706a06
Compare
Signed-off-by: Justin Chu <justinchu@microsoft.com>
b706a06
to
a3dd5eb
Compare
You have successfully added a new lintrunner configuration |
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Bump @jcwchen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit comment. Others look good to me.
To confirm, will this PR resolve #4539? Or it will need further fix? |
It will fix it |
### 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>
### 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>
### 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>
Description
--weekly_build
with the env varONNX_PREVIEW_BUILD
. Version number verified locally and in CI.setup.py xxx
usage withpip install
orpython -m build
according to setuptools' suggestions.-p
or--plat-name
option tosetup.py
. Now that we usepython -m build
, I created an env varONNX_WHEEL_PLATFORM_NAME
and supply it via thesetup
call:Motivation and Context
https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
https://pypi.org/project/pytest-runner/
fix #4878 and #4539