Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Python build commands for Bookworm
In Bookworm's version of setuptools, direct calls to setup.py are deprecated and no longer guaranteed to work. One of the recommended commands is to use the `build` python package to build packages, and call it with `python -m build`. This, by default, builds the packages in a virtualenv to ensure that only the specified dependencies in setup.py are needed to build the package. This also extends to running tests, where directly calling `setup.py test` may not work, and the recommended alternatives are to either call `pytest` directly, or call `tox` or `nox.` More details are available at [1]. For SONiC's use case, for building python packages, we cannot build all Python packages in a virtualenv since there are dependencies that we would have built earlier, and these packages are not pushed to pypi or any package registry. (There may be a cleaner approach to this, though, but I'm not aware of it.) For this reason, the `-n` flag is added to not build the package in a virtualenv. For testing, `pytest` is now called instead of `setup.py test`. [1] https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
- Loading branch information