Python development nix-build failing while nix-shell succeeds

I have a default.nix that looks like so:

buildPythonPackage rec {
  name = "babelfish";
  src = "./.";
  doCheck = false;
  checkPhase = ''
    python -m unittest discover
  propagatedBuildInputs = [

When I do nix-shell, this works and I can import my package fine. However, nix-build gives:

these derivations will be built:
building '/nix/store/j5m15a0xfxn9r987z5827hpff46fk203-python3.7-babelfish.drv'...
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Using pythonImportsCheckPhase
unpacking sources
unpacking source archive ./.
cp: './.' and './.' are the same file
do not know how to unpack source archive ./.
builder for '/nix/store/j5m15a0xfxn9r987z5827hpff46fk203-python3.7-babelfish.drv' failed with exit code 1
error: build of '/nix/store/j5m15a0xfxn9r987z5827hpff46fk203-python3.7-babelfish.drv' failed

Any idea what Iā€™m missing?

src should be a path, not a string. Remove the double quotes.

1 Like