Open deemp opened 1 year ago
Have you tried after https://github.com/nix-community/poetry2nix/pull/1001 was merged? I am using jupyter via those overrides, so it would be odd if it doesn't work
Hi, @ryanswrt! I tried now here and got a similar error:
error: builder for '/nix/store/wkx7vxybb18vq7qykbm17isr4lyjhhcz-python3.10-jupyter-server-2.4.0.drv' failed with exit code 1;
last 10 log lines:
> full command: /nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/bin/python3.10 /nix/store/7i9aca5djiprkq30y6qznszfl72dqak4-python3.10-pip-22.3.1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /build/tmp5h64ojzd
> cwd: /build/jupyter_server-2.4.0
> Preparing metadata (pyproject.toml) ... error
> error: metadata-generation-failed
>
> × Encountered error while generating package metadata.
> ╰─> See above for output.
>
> note: This is an issue with the package mentioned above, not pip.
> hint: See above for details.
For full logs, run 'nix log /nix/store/wkx7vxybb18vq7qykbm17isr4lyjhhcz-python3.10-jupyter-server-2.4.0.drv'.
error (ignored): error: cannot unlink '/tmp/nix-build-python3.10-mypy-1.1.1.drv-1/mypy-1.1.1': Directory not empty
error: 1 dependencies of derivation '/nix/store/g8b8s644ac0vpi1bqig2vxlbzmyii720-python3-3.10.10-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8cy7wz4chy7c10vpcwzzpwx72i64xf2w-interactive-python3-3.10.10-environment-env.drv' failed to build
Hmm, could you lock it to jupyter_server 2.3.0? That is the version that works for me
Locked as follows https://github.com/deemp/gists/blob/5bfaa710d8505fca6e84be7ba655ab60309d7650/tryP2N/pyproject.toml#L23
First, I get lots of warnings in red like
trace: warning: 'deps' argument to makeSetupHook is deprecated and will be removed in release 23.11., Please use propagatedBuildInputs instead. content of deps: /nix/store/8gzj48mkr8i824a4ali025hk85gmfdzy-python3.10-pip-22.3.1 /nix/store/0623n2275d43mqpd82djrlcmp296fi7d-python3.10-wheel-0.38.4
trace: warning: 'deps' argument to makeSetupHook is deprecated and will be removed in release 23.11., Please use propagatedBuildInputs instead. content of deps: /nix/store/8gzj48mkr8i824a4ali025hk85gmfdzy-python3.10-pip-22.3.1 /nix/store/0623n2275d43mqpd82djrlcmp296fi7d-python3.10-wheel-0.38.4
Then, I get an error
error: builder for '/nix/store/kl65zzha4zgcg6p0k4xvfdj7rcbbjcy8-python3.10-jupyter-server-2.3.0.drv' failed with exit code 1;
last 10 log lines:
> full command: /nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/bin/python3.10 /nix/store/7i9aca5djiprkq30y6qznszfl72dqak4-python3.10-pip-22.3.1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /build/tmpkgf6lz88
> cwd: /build/jupyter_server-2.3.0
> Preparing metadata (pyproject.toml) ... error
> error: metadata-generation-failed
>
> × Encountered error while generating package metadata.
> ╰─> See above for output.
>
> note: This is an issue with the package mentioned above, not pip.
> hint: See above for details.
For full logs, run 'nix log /nix/store/kl65zzha4zgcg6p0k4xvfdj7rcbbjcy8-python3.10-jupyter-server-2.3.0.drv'.
error (ignored): error: cannot unlink '/tmp/nix-build-python3.10-mypy-1.1.1.drv-4/mypy-1.1.1': Directory not empty
error: 1 dependencies of derivation '/nix/store/f8ipfqk2n9jxbgxy2v1lzh3m2zyqnv8w-python3-3.10.10-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/f2lyd4057skxh56wjcx2y8v1siajwymx-interactive-python3-3.10.10-environment-env.drv' failed to build
You seem to have a number of overrides in your flake, which I am unsure are still necessary; have you tried without them?
Yes, I tried. Like here. Then had to add them because of the errors like
error: builder for '/nix/store/ck2rd4wsgqfp0zqjzcbwrl1vdfvl9i6q-python3.10-bs4-0.0.1.drv' failed with exit code 2;
last 10 log lines:
> File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
> File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
> File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
> File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
> ModuleNotFoundError: No module named 'setuptools'
>
>
For full logs, run 'nix log /nix/store/ck2rd4wsgqfp0zqjzcbwrl1vdfvl9i6q-python3.10-bs4-0.0.1.drv'.
error (ignored): error: cannot unlink '/tmp/nix-build-python3.10-numpy-1.24.2.drv-1/numpy-1.24.2': Directory not empty
error: 1 dependencies of derivation '/nix/store/pba6jffs0h2s3ldb595gsa985rqgv7hf-python3-3.10.10-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/nrh78nj1pyhf913j6xqjy5qj9f3j1bgf-interactive-python3-3.10.10-environment-env.drv' failed to build
I have the same issue, I created a small project with only a few dependencies to reproduce the error.
https://github.com/rafa-dot-el/python-poetry-on-nixos/blob/feat/add-nix-shell/flake.nix#L21
Gives
e propagatedBuildInputs instead. content of deps: /nix/store/micahg85qjjalavnrjsv6yip8m1m4qds-python3.10-pip-23.0.1 /nix/store/if8hmh5jb452r7xrqdabc83gdazx825n-python3.10-wheel-0.38.4
error: builder for '/nix/store/dvy4pm4wwy8v2pyzifr53525c642qys9-python3.10-pandas-ta-0.3.14b.drv' failed with exit code 2;
last 10 log lines:
> File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
> File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
> File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
> File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
> ModuleNotFoundError: No module named 'setuptools'
>
>
For full logs, run 'nix log /nix/store/dvy4pm4wwy8v2pyzifr53525c642qys9-python3.10-pandas-ta-0.3.14b.drv'.
Full logs: nix log /nix/store/06adx8wbaglgklnar1mcxn2zkdn3j9a0-python3.10-iniconfig-2.0.0.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/di4c31yr68j50ii2lh8qg02nax4x02ny-iniconfig-2.0.0.tar.gz
source root is iniconfig-2.0.0
setting SOURCE_DATE_EPOCH to timestamp 1580601600 of file iniconfig-2.0.0/src/iniconfig/py.typed
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
Removing path dependencies
Finished removing path dependencies
Removing git dependencies
Finished removing git dependencies
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Executing pipBuildPhase
Creating a wheel...
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should >
Processing /build/iniconfig-2.0.0
Running command Preparing metadata (pyproject.toml)
Traceback (most recent call last):
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/metadata/core.py", line 1409, in cached
self._cached = self.source.get_version_data()['version']
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/metadata/core.py", line 1457, in source
raise UnknownPluginError(message)
hatchling.plugin.exceptions.UnknownPluginError: Unknown version source: vcs
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/nix/store/wfgc28if3wg2g01q18f7s9mqzf1a02sh-python3.10-pip-23.0.1/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/nix/store/wfgc28if3wg2g01q18f7s9mqzf1a02sh-python3.10-pip-23.0.1/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/nix/store/wfgc28if3wg2g01q18f7s9mqzf1a02sh-python3.10-pip-23.0.1/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/build.py", line 56, in build_wheel
return os.path.basename(next(builder.build(wheel_directory, ['standard'])))
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/builders/plugin/interface.py", line 93, in build
self.metadata.validate_fields()
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/metadata/core.py", line 243, in validate_fields
_ = self.version
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/metadata/core.py", line 128, in version
self._version = self._get_version()
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/metadata/core.py", line 226, in _get_version
version = self.hatch.version.cached
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/metadata/core.py", line 1411, in cached
message = f'Error getting the version from source `{self.source.PLUGIN_NAME}`: {e}'
File "/nix/store/dsrpjlnb2rl5qx2h4kp7aibz6byzfbzb-python3.10-hatchling-1.13.0/lib/python3.10/site-packages/hatchling/metadata/core.py", line 1457, in source
raise UnknownPluginError(message)
hatchling.plugin.exceptions.UnknownPluginError: Unknown version source: vcs
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /nix/store/0n4y44dnaxafqs7cg625aldrb152x7bx-python3-3.10.10/bin/python3.10 /nix/store/wfgc28if3wg2g01q18f7s9mqzf1a02sh-python3.10-pip-23.0.1/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_m>
cwd: /build/iniconfig-2.0.0
Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I could bypass the error and execute the build with the following workaround.
But during runtime the following exception is thrown:
# ./result/bin/example-nix-poetry
Traceback (most recent call last):
File "/nix/store/py8rijy114g14yh5vmp0avw16yyz6syh-python3.10-nix-poetry-example-0.1.0/bin/.example-nix-poetry-wrapped", line 6, in <module>
from nix_poetry_example.cli import hello
File "/nix/store/py8rijy114g14yh5vmp0avw16yyz6syh-python3.10-nix-poetry-example-0.1.0/lib/python3.10/site-packages/nix_poetry_example/__init__.py", line 2, in <module>
import pandas_ta as ta
File "/nix/store/1n94grfgg3w7w4r6y3qsp25216qbl0jq-python3.10-pandas-ta-0.3.14b/lib/python3.10/site-packages/pandas_ta/__init__.py", line 7, in <module>
from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'
Describe the issue
I expect that I get a devshell.
But I receive:
jupyter-server
failed with exit code 1;Additional context
in my
flake.nix
, I useIn
nix repl
,inputs.nixpkgs.rev
showse3f9921357f83dbf45934d1e72e89b928544a4be
.pyproject.toml
has: