Packaging/Python: Difference between revisions

imported>Abhillman
info regarding pyproject.toml in src
imported>Abhillman
m fix order
Line 152: Line 152:
but it's missing in some packages.
but it's missing in some packages.
If you get the following error, you need to one of the workarounds below.
If you get the following error, you need to one of the workarounds below.
'''Note: sometimes you will be able to find <code>pyproject.toml</code> in the source for a package despite it not being present in a <code>.whl</code> file.''' You can inspect the contents of a <code>.whl</code> file by downloading it from PyPi and then extracting it with <code>nix shell -p python311Packages.wheel --command wheel unpack path/to/package.whl</code>.


<pre>
<pre>
Line 169: Line 167:
If both <code>setup.py</code> and <code>pyproject.toml</code> are missing,
If both <code>setup.py</code> and <code>pyproject.toml</code> are missing,
you have to add one of these files.
you have to add one of these files.
'''Note: sometimes you will be able to find <code>pyproject.toml</code> in the source for a package despite it not being present in a <code>.whl</code> file.''' You can inspect the contents of a <code>.whl</code> file by downloading it from PyPi and then extracting it with <code>nix shell -p python311Packages.wheel --command wheel unpack path/to/package.whl</code>.
For example, you can create the <code>setup.py</code> in the <code>preBuild</code> phase.
For example, you can create the <code>setup.py</code> in the <code>preBuild</code> phase.