<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63369>63369</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Request to distribution lit tool as a wheel (/'bdist') on Pypi
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
EFord36
</td>
</tr>
</table>
<pre>
Hi,
At the moment, lit is available on Pypi as a 'source distribution'/'sdist' i.e. a tarball source ([here](https://pypi.org/project/lit/#files)), but not as a 'built distribution'/'bdist' (normally a 'wheel').
It is recommended to upload built versions as well, e.g. from [the python packaging tutorial](https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives):
> You should always upload a source distribution and provide built distributions for the platforms your project is compatible with.
This is potentially as simple as changing [this line](https://github.com/llvm/llvm-project/blob/3e984182dcea685a42b0e2a63660f6ef1fbc49ef/.github/workflows/release-tasks.yml#L99)
from:
```python
python3 setup.py sdist
```
to:
```python
python3 setup.py sdist bdist_wheel
```
(although I don't know lit well so it could be more complicated if the codebase is much more complex than just pure python).
This is particularly a problem in my case, using a http proxy in a corporate environment. In this case, I actually have to 'build' the wheel myself on my laptop and copy it over into the relevant environment, and specify a dependency on that built wheel. So the lack of a wheel causes considerable pain for me here.
<details><summary>Full details of http proxy issues with pip installs of sdist-only packages</summary>
<p>
Pip will 'build' dependencies like lit that only provide an 'sdist' in an 'isolated environment' now, which means downloading and installing their declared build dependencies (setuptools [in lit's case](https://github.com/llvm/llvm-project/blob/f3a0ad2d8bf65993851598cc9961c1868371abfd/llvm/utils/lit/pyproject.toml#L2)). Unfortunately, that 'isolated environment' does not include http proxies: see this issue for pip https://github.com/pypa/pip/issues/6018. This means that setuptools cannot be downloaded, so the whole install fails.
</p>
</details>
Some more benefits of uploading wheels, from https://pythonwheels.com:
> Advantages of wheels
Faster installation for pure Python and native C extension packages.
Avoids arbitrary code execution for installation. (Avoids setup.py)
Installation of a C extension does not require a compiler on Linux, Windows or macOS.
Allows better caching for testing and continuous integration.
Creates .pyc files as part of installation to ensure they match the Python interpreter used.
More consistent installs across platforms and machines.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykV11v47oR_TX0yyCCLcWy9OCHbHaNBrhFF90WRZ-KETmyeEORuiRlR_--GEr-2qYXaC8Q2I5FDmcOzzkzxhD00RLtxfaL2H5d4Rg75_ffDs6rolw1Tk37P2mRv4r1V7F-mV9fIsSOoHc92SjyVzA6gg6AJ9QGG0PgLHyfBg0YAEHku-BGLwmUDtHrZozaWZHvRH7gZ_ytyHegM8oAIaJv0BhY9oi8EtsvHXkS268ir7oYhyCKl7T5MEyDzpw_8kfvfiUZRX4wOqanRasNBZHX6e8VmjGCdfGaVTNqEz9PqrkkJfLKOt-jMdO86dwRmbSuzu5BeUsQeJKu78kqUhAdjINxqGA-6EQ-aGcDn38mYzglyo4ZtN71AGL7hVEdptg5CwPKdzxqe4Q4Ruc1mk_Lv6zK5m0LFGQZBYzENRwuAcL9hqcFrjAjdSRLHiM_uMfjCb3s9GkGsXi5r1cU3-CfboTQudEoQHPGKVwKRvjkxgGtgsG7k1YE_4l9gNb5RKzBYGyd7wNMbvSwZMrwStcPGDVT7Kxj93ABf-t04DWDi2Sjnm8sQND9YIg_yQ5tQjQhrQMYbT8l1VHHbmwy6XqG0Zwub083ijXGNSI_FFRXz5sqV5KwrLb4nDdryrEsynLdltRu2kY-19SK_JDNUUV-ODv_3hp3Zug9GcJATxHDe8im3oi8-KVOhL0rjQnyM_zlev6bL37-cv5cQKA4Dtkwwaytxw33UaL7_8NC0si_Zj389yNEXqGJnRuPHbyBShqL8G7dOdkGCwGCAx1BJiI1bCye0lUbLTGSAt0mXkinqMFAfMv9KLu7hfQBsUMLv44hwjD6i45-VumVJOijlqNBn3Q9eNcY6kFb6CeQGIjFOQZmCwKzg5d8TLwAQTo_OI-RgOxJe2fZBzN4s5Boddn-BijjmHjY4Yn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