Packaging/Python: Difference between revisions

imported>Milahu
add link: build Rust code in Python projects
imported>Milahu
add section: Testing via this command is deprecated
Line 220: Line 220:


TODO https://pypi.org/project/pypi2nix/
TODO https://pypi.org/project/pypi2nix/
== Testing via this command is deprecated ==
In most cases, tests will pass anyway and you can ignore the warning.
In some cases, tests will fail, for example:
<blockquote>
running test<br>
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.<br>
[ ... ]<br>
TypeError: some_function() missing 1 required positional argument: 'some_argument'
</blockquote>
quick fix:
<syntaxHighlight lang=nix>
  checkPhase = ''
    runHook preCheck
    ${python.interpreter} -m unittest discover
    runHook postCheck
  '';
</syntaxHighlight>


== See also ==
== See also ==