Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

nix-prefetch-github broke pypi2nix #464

Closed
layday opened this issue Sep 6, 2020 · 4 comments
Closed

nix-prefetch-github broke pypi2nix #464

layday opened this issue Sep 6, 2020 · 4 comments

Comments

@layday
Copy link

layday commented Sep 6, 2020

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.

@layday layday closed this as completed Sep 13, 2020
@leo60228
Copy link

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

@layday
Copy link
Author

layday commented Dec 22, 2020

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

@Enteee
Copy link

Enteee commented Jan 22, 2021

@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
Copy link
Author

layday commented Jan 22, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants