Open Andy3153 opened 2 months ago
You also need gtk3
and maybe gobject-introspection
.
Seems like only gobject-introspection
was needed to not get an error on that import... but, point still stands. Why isn't it in the derivation's dependencies
list?
Why isn't it in the derivation's
dependencies
list?
It's not a Python package.
Sorry, you're correct. buildInputs
?
It should maybe be put in propagatedNativeBuildInputs
.
In my opinion, wherever it would put the necessary runtime dependencies in the dependency list
It's not a runtime dependency.
Is it not..? You can't import the library without an error without that.
Is it not..? You can't import the library without an error without that.
That's not true, usually wrapGAppsHook
sets everything up.
I don't fully understand, but alright. Is my concern valid though? It should be added to propagatedNativeBuildInputs
, right?
You need glib
package if you want to use it through introspection – just like with most other introspected libraries.
We have not made glib
a dependency for pygobject3
when GLib’s typelibs were moved out of gobject-introspection
package because I do not think GObject is actually needed for introspected libraries (as evidenced by cairo). Though I acknowledge that it will be required in at least 95% of uses and it does not make much difference to closure size so it is open to re-evaluation.
You may also need gobject-introspection
for the setup-hook that sets GI_TYPELIB_PATH
. We propagate it from pygobject3
wholesale (until we manage to get https://github.com/NixOS/nixpkgs/pull/308488 work) but I am not sure how it interacts with python3.withPackages
.
Ah, so it'll eventually be done. I understand.
No, there are currently no plans to change the current behaviour.
I'll give a thumbs-up to the PR because, with how things "just work" in Nix, if you don't understand the underlying debate, it really just feels broken without this.
The gobject-introspection
is already propagated by pygobject3
.
The PR actually narrows the propagation so that only setupHook
part of gobject-introspection
introspection is propagated. So it will not help you – in fact, it might break packages relying on gobject-introspection
itself propagating glib
.
I'm a little confused right now... what would even need to be done to be able to make my "Steps To Reproduce" work with just adding pygobjects3
to python-pkgs
in the Python package for my devshell?
I would say the example should not work without also adding glib
to packages
explicitly.
Docs might need adjusting to make it clear.
Describe the bug
I'm trying to use
pygobject3
and it can't even importGLib
out of it. Am I doing anything wrong or is this broken?Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
No errors appear
Notify maintainers
@jtojnar (pygobject3)
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.