-
-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't run my program executable (console_script) via mkPoetryApplication #159
Comments
You are using nix-shell to execute it, but There's If you want to use nix to package application for regular use and not development, you should invoke |
thanks for the help, but mkPoetryEnv doesnt even generate the |
How old is your poetry2nix? Because, this functionality was added very recently: #150 |
I am using the one from nixpkgs so maybe that's why: I doubt it has this change. With nix flakes, is there a way to override nixpkgs' poetry with this repo's ? |
You can use overlays and poetry2nix makes it esier since it creates I personally use niv to pin packages to specific version, I guess I won't need it once flakes are officially released. But basically to set it up I do: $ niv init
$ niv modify nixpkgs -b nixpkgs-unstable
$ niv add nix-community/poetry2nix Then place a { ... }@args:
let
sources = import ./sources.nix;
# remove overlays and config attributes from args
clean_args = builtins.removeAttrs args [ "overlays" "config" ];
in import sources.nixpkgs {
overlays = [
# latest version of poetry and poetry2nix
(import "${sources.poetry2nix}/overlay.nix")
(self: super: {
inherit sources;
inherit (import sources.niv { pkgs = super; }) niv;
})
];
config = {};
} // clean_args Now instead of Of course if you don't want to use niv, you can just provide the overlay, you can use |
arf I tried your suggestion and added poetry2nix as an overlay to nixpkgs to get the latest version, Yet I get the same issue as in my first post #159 (comment) :( |
Maybe I misunderstood you. Do you mean I should add importlib-metadata as a dependency of my program for it to work ?
I can't find my package "mptcpanalyzer", which kinda similar to the first error, aka the current package being developed is not added to the list of importlib-metadata. |
I added importlib-metadata and that fixed it \o/ I don't if it's the final fix, but it should at least be documented. Thanks for the help. |
my bad I was still running my old version that relies on nixpkgs+setup.py |
|
I followed the advice in NixOS/nixpkgs#105593 and just tweaking PYTHONPATH works fine. |
I am trying to convert my project to poetry, it's a cli interactive application. I was annoyed by python-poetry/poetry#1279 but could fix it by committing the generated poetry setup.py file.
Now once I am in a nix-shell (
poetry2nix.mkPoetryApplication {
), I can't run my software (executable is calledmptcpanalyzer
) because of:Not sure what's the error here, wether it's nix or poetry's fault.
If you wanna try/check, just run
nix-shell
on this code https://github.com/teto/mptcpanalyzer/pull/35I am using nixpkgs c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38
The text was updated successfully, but these errors were encountered: