Packaging/Python: Difference between revisions
reintroduce comment that tells ppl to replace ./derivation.nix with the appropriate path |
→Testing out a module in a Python shell: Use python3.withPackages instead of a devshell |
||
| Line 37: | Line 37: | ||
}; | }; | ||
in { | in { | ||
packages.default = pkgs.python3.withPackages(_: [ xacro ]); | |||
}); | }); | ||
} | } | ||
</syntaxhighlight>Replace "mypackage" with your package name. Then, | </syntaxhighlight>Replace "mypackage" with your package name. Then, run the flake to get into a python REPL with your package, ready to be imported:<syntaxhighlight lang="shell-session"> | ||
$ nix | $ nix run | ||
Python 3.11.10 (main, Sep 7 2024, 01:03:31) [GCC 13.2.0] on linux | Python 3.11.10 (main, Sep 7 2024, 01:03:31) [GCC 13.2.0] on linux | ||
Type "help", "copyright", "credits" or "license" for more information. | Type "help", "copyright", "credits" or "license" for more information. | ||