dream2nix
dream2nix copied to clipboard
Additional v1 python use cases
Aim of this PR is to gradually provide examples for the use cases described in https://github.com/chaoflow/dream2nix/edit/v1-examples/examples/v1-pip-compile/README.md?pr=%2Fnix-community%2Fdream2nix%2Fpull%2F543
@DavHau @phaer The requirements from requirementsFiles seem not to be available during buildPythonPackage, see
cd examples/v1-pip-compile
nix build .#pypkg1
error: builder for '/nix/store/c2jcc3x4zpfiqpp7iii5kkl873lqgaf7-python3.10-pypkg1-1.drv' failed with exit code 1;
last 10 log lines:
> Successfully built pypkg1
> Finished creating a wheel...
> Finished executing pipBuildPhase
> installing
> Executing pipInstallPhase
> /build/pypkg1/dist /build/pypkg1
> Processing ./pypkg1-1.0.0-py3-none-any.whl
> ERROR: Could not find a version that satisfies the requirement cryptography (from pypkg1) (from versions: none)
> ERROR: No matching distribution found for cryptography
>
For full logs, run 'nix log /nix/store/c2jcc3x4zpfiqpp7iii5kkl873lqgaf7-python3.10-pypkg1-1.drv'.
Any ideas?
You might have figured this out by now, but we currently maintain our examples for v1 in v1/nix/modules/drvs. Maybe move the new example there, if you still think it's needed, as everything besides v1/ is supposed to be removed soon.
@DavHau Yes, I wanted to be picked up by CI, will move once the repo is cleaned up.
@DavHau I also updated title and description of this PR
@DavHau @phaer I rebased to latest main and have a couple of issues:
- Do you have a suggestion how we can get rid of https://github.com/nix-community/dream2nix/pull/543/commits/fa7d7b5758e1046a8f2398520840032e245e1092 ?
- The
examples/v1-pip-compile/flake.lockkeeps changing for
cd examples/v1-pip-compile
nix build -L .#pypkg1
nix run -L .#pypkg1.config.lock.refresh
nix build -L .#pypkg1failes with
error: builder for '/nix/store/619k18a1blicssd0bnl6nlji9wh804wc-python3.10-pypkg1-1.drv' failed with exit code 1;
last 10 log lines:
> Successfully built pypkg1
> Finished creating a wheel...
> Finished executing pipBuildPhase
> installing
> Executing pipInstallPhase
> /build/pypkg1/dist /build/pypkg1
> Processing ./pypkg1-1.0.0-py3-none-any.whl
> ERROR: Could not find a version that satisfies the requirement cryptography (from pypkg1) (from versions: none)
> ERROR: No matching distribution found for cryptography
>
For full logs, run 'nix log /nix/store/619k18a1blicssd0bnl6nlji9wh804wc-python3.10-pypkg1-1.drv'.
Let's disregard how the examples are named or where they live - I'd like to get things working and then move around.
@chaoflow Is this here still relevant or can it be closed?
@DavHau It's kind of superseded by https://github.com/chaoflow/dream2nix-pyenv, given that self-contained examples don't work from within the dream2nix repo.
What is you plan about that?
Shall we add a section in the docs to link to external examples?
We should make them self contained, and yes, please feel free to add you example to the docs