nix-community / pypi2nix

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

pypi2nix doesn't work without git installed #454

Open chuwy opened 4 years ago

chuwy commented 4 years ago

I use pypi2nix to generate a docker image from another docker container, built on top of nixos/nix image, which doesn't have git installed by default.

Here's the command that I run:

$ pypi2nix -r requirements/production.txt -E 'pkgconfig zlib libjpeg openjpeg libtiff freetype lcms2 libwebp tcl postgresql ncurses' -V python36

requirements/production.txt contain mostly Django-related stuff. This is an error I'm getting:

  File "/nix/store/rxp37v8lm0qbyg28jcvzw1mfxy4h0zg9-python3.7-effect-1.1.0/lib/python3.7/site-packages/effect/_sync.py", line 69, in sync_wrapper
    box.succeed(f(*pass_args, **kwargs))
  File "/nix/store/zm8fnml4zl5b00hwjhnn61zw5n73wbsx-python3.7-nix-prefetch-github-2.3.2/lib/python3.7/site-packages/nix_prefetch_github/__init__.py", line 106, in get_list_remote_performer
    _, stdout = cmd(["git", "ls-remote", "--symref", repository_url])
  File "/nix/store/zm8fnml4zl5b00hwjhnn61zw5n73wbsx-python3.7-nix-prefetch-github-2.3.2/lib/python3.7/site-packages/nix_prefetch_github/io.py", line 7, in cmd
    command, stdout=subprocess.PIPE, stderr=stderr, universal_newlines=True
  File "/nix/store/ihy2vly61ndky6qlv1q4dfdiv28vszkh-python3-3.7.7/lib/python3.7/subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/nix/store/ihy2vly61ndky6qlv1q4dfdiv28vszkh-python3-3.7.7/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/nix/store/ihy2vly61ndky6qlv1q4dfdiv28vszkh-python3-3.7.7/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git': 'git'

I tried to add git to pypi2nix inputs, but it didn't help. However if I install git globally with nix-env -iA nixpkgs.git - pypi2nix manages to finish its job.