jupyenv icon indicating copy to clipboard operation
jupyenv copied to clipboard

[Bug]: Async_generator not in package list

Open IllustratedMan-code opened this issue 1 year ago • 4 comments

Current Behavior

Any package that depends on async_generator cannot be installed. They return some form of the following error:

      > installing
      > Executing pipInstallPhase
      > /build/trio-0.22.0/dist /build/trio-0.22.0
      > Processing ./trio-0.22.0-py3-none-any.whl
      > Requirement already satisfied: idna in /nix/store/vqqdd8y40jmamw70f9mh9y71iin9pcqr-python3.10-idna-3.4/lib/python3.10/site-packages (from trio==0.22.0) (3.4)
      > Requirement already satisfied: attrs>=19.2.0 in /nix/store/56h9cj9vzadvw8xibxgys08s915g8rx2-python3.10-attrs-22.2.0/lib/python3.10/site-packages (from trio==0.22.0) (22.2.0)
      > ERROR: Could not find a version that satisfies the requirement async-generator>=1.9 (from trio) (from versions: none)
      > ERROR: No matching distribution found for async-generator>=1.9
      > 

When trying to install async-generator itself, I get:

error: A definition for option `kernel.python.tick.extraPackages.<function body>."[definition 1-entry 6]"' is not of type `package'. Definition values:
       - In `<unknown-file>': null
(use '--show-trace' to show detailed location information)

This is weird, because async_generator is definitely in nixpkgs as can be shown by nix shell nixpkgs#python3Packages.async_generator

Expected Behavior

packages should be installed in the kernel.

Steps To Reproduce

Use this kernel with the example flake:

{ pkgs, ... }: {
  kernel.python.tick = {
    enable = true;
    extraPackages = ps: [ ps.pandas
                          ps.numpy
                          ps.matplotlib
                          ps.plotly
                          ps.scikit-learn
                          ps.nbdime
                        ];
  };
}

Or, try this kernel

{ pkgs, ... }: {
  kernel.python.tick = {
    enable = true;
    extraPackages = ps: [ ps.async_generator ];
  };
}

OS

- system: `"x86_64-linux"`
 - host os: `Linux 5.15.95, NixOS, 23.05 (Stoat), 23.05.20230225.b1f87ca`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.2`
 - channels(david): `""`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Version

0.1.0

Additional Context

I get the same error whether I use poetry or nixpkgs.

Relevant log output

No response

IllustratedMan-code avatar Mar 17 '23 20:03 IllustratedMan-code

Haven't found a solution but found some more info that might be relevant to why it is not working.

nix-repl> pkgs.python310Packages.async_generator
«derivation /nix/store/vxlj2zgi078w2vq583apgw1kqn6z4z1i-python3.10-async_generator-1.10.drv»

nix-repl> :log pkgs.python310Packages.async_generator
error: build log of '/nix/store/vxlj2zgi078w2vq583apgw1kqn6z4z1i-python3.10-async_generator-1.10.drv' is not available

nix-repl> :b pkgs.python310Packages.async_generator   
error: builder for '/nix/store/jcyia4729kjkbv70cbwzlnz7w4ah4nxm-python3.10-pytest-6.2.5.drv' failed with exit code 1;
       last 10 log lines:
       >             ^
       > SyntaxError: invalid syntax
       > =========================== short test summary info ============================
       > ERROR test_errors_in_xfail_skip_expressions.py::test_nameerror
       > ERROR test_errors_in_xfail_skip_expressions.py::test_syntax
       > ========================= 1 passed, 2 errors in 0.01s ==========================
       > =========================== short test summary info ============================
       > FAILED testing/test_skipping.py::test_errors_in_xfail_skip_expressions - Fail...
       > !!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
       > = 1 failed, 2052 passed, 45 skipped, 9 deselected, 9 xfailed in 62.94s (0:01:02) =
       For full logs, run 'nix log /nix/store/jcyia4729kjkbv70cbwzlnz7w4ah4nxm-python3.10-pytest-6.2.5.drv'.
error: 1 dependencies of derivation '/nix/store/vxlj2zgi078w2vq583apgw1kqn6z4z1i-python3.10-async_generator-1.10.drv' failed to build

djacu avatar Mar 18 '23 01:03 djacu

Does appear to work for Python 3.7

nix-repl> :b pkgs.python37Packages.async_generator   

This derivation produced the following outputs:
  out -> /nix/store/y2haxb9ms8650chda8zrav1mb7yqk243-python3.7-async_generator-1.10

Which version of Python are you trying to use? The default for jupyenv is python3 which translates to version 3.10 currently.

Looking at this issue, it appears that async_generators might be deprecated soon and isn't recommended for Python version 3.7 and greater.

Are you trying to run some code on an older version of Python? If so, you'll probably have to pull in an older version of nixpkgs because the older version currently available is 3.7.

djacu avatar Mar 18 '23 01:03 djacu

I only noticed this issue on a couple packages I was using notably nbdime which on further inspection doesn't seem to work normally anyway.

Another package I noticed it on was jupyterlab-lsp, but as far as I know, lsp servers don't currently work right?

IllustratedMan-code avatar Mar 18 '23 03:03 IllustratedMan-code

@GTrunSec has a PR in to add an LSP module but other things need to be taken care of before it gets merged in. See https://github.com/tweag/jupyenv/pull/426.

djacu avatar Mar 18 '23 18:03 djacu