[lit] Add pyproject.toml and fix build w/ modern setuptools backend
authorMichał Górny <mgorny@gentoo.org>
Fri, 28 Oct 2022 20:13:35 +0000 (22:13 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 1 Nov 2022 06:30:14 +0000 (07:30 +0100)
commit7b4b15042d2b9f513dc23a951e4a6e92492894e3
tree85ea4a0ba59d065eeb1fc086618f3e0e8aee9811
parent5e0d29103a3f9252b26669f6d4bdc9dc29cef1f1
[lit] Add pyproject.toml and fix build w/ modern setuptools backend

Add a `pyproject.toml` file that provides build system information
for PEP 517-compliant builders.  While all the commonly used builders
provide fallback to running `setup.py` for backwards compatibility, this
ensures the best forward compatibility.  It also provides a reliable way
of specifying the minimum required setuptools version.  Effectively, it
will make it possible to remove `setup.py` in favor of purely
declarative configuration in the future, or even switch to a different
build system.

Update `setup.py` to explicitly add the current directory to `sys.path`
for importing `lit`.  This is necessary, as the modern setuptools
backend does not guarantee that the current directory is present there.

Differential Revision: https://reviews.llvm.org/D136976
llvm/utils/lit/pyproject.toml [new file with mode: 0644]
llvm/utils/lit/setup.py