Open davidak opened 5 years ago
It works when i also specify fetchPypi in the overlay.
nixpkgs.overlays = [
(self: super:
{
toolz = super.callPackage ../../packages/toolz {
fetchPypi = super.python35Packages.fetchPypi;
buildPythonPackage = super.python35Packages.buildPythonPackage;
};
}
)];
But the build of that package fails:
writing manifest file 'toolz.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "nix_run_setup", line 8, in <module>
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
File "setup.py", line 22, in <module>
zip_safe=False)
File "/nix/store/pky8wchkji14q3nabm7dps7c0frsqi0j-python3.5-setuptools-41.2.0/lib/python3.5/site-packages/setuptools-41.2.0-py3.5.egg/setuptools/__init__.py", line 145, in setup
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/nix/store/pky8wchkji14q3nabm7dps7c0frsqi0j-python3.5-setuptools-41.2.0/lib/python3.5/site-packages/setuptools-41.2.0-py3.5.egg/setuptools/command/test.py", line 229, in run
File "/nix/store/pky8wchkji14q3nabm7dps7c0frsqi0j-python3.5-setuptools-41.2.0/lib/python3.5/site-packages/setuptools-41.2.0-py3.5.egg/setuptools/command/test.py", line 251, in run_tests
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/unittest/main.py", line 94, in __init__
self.parseArgs(argv)
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/unittest/main.py", line 118, in parseArgs
self._do_discovery(argv[2:])
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/unittest/main.py", line 229, in _do_discovery
self.test = loader.discover(self.start, self.pattern, self.top)
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/unittest/loader.py", line 341, in discover
tests = list(self._find_tests(start_dir, pattern))
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/unittest/loader.py", line 398, in _find_tests
full_path, pattern, namespace)
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/unittest/loader.py", line 475, in _find_test_path
tests = self.loadTestsFromModule(package, pattern=pattern)
File "/nix/store/pky8wchkji14q3nabm7dps7c0frsqi0j-python3.5-setuptools-41.2.0/lib/python3.5/site-packages/setuptools-41.2.0-py3.5.egg/setuptools/command/test.py", line 55, in loadTestsFromModule
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/unittest/loader.py", line 153, in loadTestsFromName
module = __import__(module_name)
File "/build/toolz-0.7.4/toolz/curried/__init__.py", line 53, in <module>
_curry_namespace(vars(toolz)),
File "/build/toolz-0.7.4/toolz/curried/__init__.py", line 48, in _curry_namespace
for name, f in ns.items() if '__' not in name
File "/build/toolz-0.7.4/toolz/curried/__init__.py", line 48, in <genexpr>
for name, f in ns.items() if '__' not in name
File "/build/toolz-0.7.4/toolz/curried/__init__.py", line 42, in _should_curry
return (callable(f) and _nargs(f) > 1 or f in do_curry)
File "/build/toolz-0.7.4/toolz/curried/__init__.py", line 35, in _nargs
return len(inspect.getargspec(f).args)
File "/nix/store/bmb13jiq3g1lslc7j42f4krh8n3shx0l-python3-3.5.7/lib/python3.5/inspect.py", line 1050, in getargspec
raise ValueError("Function has keyword-only arguments or annotations"
ValueError: Function has keyword-only arguments or annotations, use getfullargspec() API which can support them
builder for '/nix/store/bybr5zdsh78xn177l2pml2drrzh9np9p-python3.5-toolz-0.7.4.drv' failed with exit code 1
cannot build derivation '/nix/store/mgflkpv67krgjrig7qlkl4zy4sb0zdrk-system-path.drv': 1 dependencies couldn't be built
That's probably why the workaround in the nixpkgs package exists: https://github.com/NixOS/nixpkgs/blob/257c6529b1d6feefe118e150b3ed15c9cf005aa0/pkgs/development/python-modules/toolz/default.nix#L20
So we might use a different example here that works and is also simple to understand.
just add fetchPypi
to the function parameters...
@FRidh like here https://github.com/NixOS/nixpkgs/issues/72167#issuecomment-546984659?
I got it working in my code.
But the example in the documentation should be in a form that one can just copy it and it works.
There seems to be a major difference between derivations introduced into pkgs/top-level/python-packages.nix and all other derivations. As far as I can tell derivations in python-packages.nix automatically get a selected version of buildPythonPackage, while all other derivations need to select their own version of python by using pythonXXXPackages.buildPythonPackage, but I'm not sure that's the only difference. It can be very confusing if example code doesn't work.
Hello, I'm a bot and I thank you in the name of the community for opening this issue.
To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.
The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.
If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.
Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.
since this was not closed, it's probably not fixed
I marked this as stale due to inactivity. → More info
Describe the bug
I just copied the code and put it into
nixpkgs.overlays
.Build fails.
To Reproduce Steps to reproduce the behavior:
packages/toolz/default.nix
configuration.nix
when i define fetchPypi in the package like:
I get this error:
Why is that missing in this context? That is not a problem with fetchurl! It is done exactly like this in nixpkgs https://github.com/NixOS/nixpkgs/blob/5102201ba4f22e6d91e5a13d9b1e89eb4b8e4eb5/pkgs/development/python-modules/poetry/glob2.nix.
In the documentation it says: "We now call this function using callPackage in the definition of our environment". Please add a filename and command, how to build the package. I might doing it wrong because the documentation is not detailed enough here.
Expected behavior Package get's build and installed.
Metadata
"x86_64-linux"
Linux 4.19.80, NixOS, 19.09.907.f6dac808387 (Loris)
yes
yes
nix-env (Nix) 2.3
"nixos-19.09.907.f6dac808387, nixos-hardware, nixos-unstable-20.03pre197685.f35f0880f2c"
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information: