nix-community / pypi2nix

Abandoned! Generate Nix expressions for Python packages
194 stars 47 forks source link

nix-prefetch-github broke pypi2nix #464

Closed layday closed 4 years ago

layday commented 4 years ago

nix-prefetch-github is not pinned and the latest release, which I believe was last week, broke pypi2nix, both on Nix (unstable) and PyPI:

[...]
  File "/home/runner/work/instawow-nix/instawow-nix/instawow/.py-nox/nixify/lib/python3.7/site-packages/pypi2nix/overrides.py", line 67, in nix_expression
    rev=prefetch_data["rev"],
TypeError: 'PrefetchedRepository' object is not subscriptable

prefetch_data used to be a dictionary but it's an attrs class now.

There's also a separate issue with the pip override which appears to have been fixed on master but not downstream.

leo60228 commented 3 years ago

This doesn't seem to have been fixed, why was this issue closed?

layday commented 3 years ago

Because this project was marked as abandoned shortly after I opened this issue.

Enteee commented 3 years ago

@layday can you please re-open this issue.

I did encounter the exact same thing here as well working with pypi2nix on the current nixpkgs unstable.

$ nix-shell \
  -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/f2c88014c8cc7b93be871248747e17528da2b3bf.tar.gz \
  -p pypi2nix \
  --command "pypi2nix -e  everett==1.0.3"

yields:

INFO: pypi2nix v2.0.4 running ...
INFO: Downloading wheels and creating wheelhouse ...
INFO: Downloading runtime requirements
WARNING: You are using pip version 20.0.dev0; however, version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
INFO: Build wheels of setup and runtime requirements
INFO: Extracting metadata from pypi.python.org ...
INFO: -- sources ---------------------------------------------------------------
INFO: --------------------------------------------------------------------------
INFO: Generating Nix expressions ...
Traceback (most recent call last):
  File "/nix/store/iqcjqk0yyhdpkgxdga7sypv4f1jhdy2s-pypi2nix-2.0.4/bin/.pypi2nix-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/xfqcnnp7rvdf5kyw1mwvns6m400w53jw-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/nix/store/xfqcnnp7rvdf5kyw1mwvns6m400w53jw-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/nix/store/xfqcnnp7rvdf5kyw1mwvns6m400w53jw-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nix/store/xfqcnnp7rvdf5kyw1mwvns6m400w53jw-python3.8-click-7.1.2/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/nix/store/iqcjqk0yyhdpkgxdga7sypv4f1jhdy2s-pypi2nix-2.0.4/lib/python3.8/site-packages/pypi2nix/cli.py", line 219, in main
    Pypi2nix(configuration).run()
  File "/nix/store/iqcjqk0yyhdpkgxdga7sypv4f1jhdy2s-pypi2nix-2.0.4/lib/python3.8/site-packages/pypi2nix/main.py", line 86, in run
    main(
  File "/nix/store/iqcjqk0yyhdpkgxdga7sypv4f1jhdy2s-pypi2nix-2.0.4/lib/python3.8/site-packages/pypi2nix/stage3.py", line 98, in main
    common_overrides_expressions = [
  File "/nix/store/iqcjqk0yyhdpkgxdga7sypv4f1jhdy2s-pypi2nix-2.0.4/lib/python3.8/site-packages/pypi2nix/stage3.py", line 99, in <listcomp>
    "    (" + override.nix_expression(logger) + ")" for override in common_overrides
  File "/nix/store/iqcjqk0yyhdpkgxdga7sypv4f1jhdy2s-pypi2nix-2.0.4/lib/python3.8/site-packages/pypi2nix/overrides.py", line 115, in nix_expression
    rev=prefetch_data["rev"],
TypeError: 'PrefetchedRepository' object is not subscriptable
layday commented 3 years ago

I don't see what the point of that would be when this package is abandoned. This should be reported on the nixpkgs repo to have the package removed.