dream2nix icon indicating copy to clipboard operation
dream2nix copied to clipboard

Additional v1 python use cases

Open chaoflow opened this issue 2 years ago • 8 comments
trafficstars

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

chaoflow avatar Jul 01 '23 05:07 chaoflow

@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?

chaoflow avatar Jul 01 '23 14:07 chaoflow

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 avatar Jul 04 '23 16:07 DavHau

@DavHau Yes, I wanted to be picked up by CI, will move once the repo is cleaned up.

chaoflow avatar Jul 05 '23 14:07 chaoflow

@DavHau I also updated title and description of this PR

chaoflow avatar Jul 05 '23 14:07 chaoflow

@DavHau @phaer I rebased to latest main and have a couple of issues:

  1. Do you have a suggestion how we can get rid of https://github.com/nix-community/dream2nix/pull/543/commits/fa7d7b5758e1046a8f2398520840032e245e1092 ?
  2. The examples/v1-pip-compile/flake.lock keeps changing for
cd examples/v1-pip-compile
nix build -L .#pypkg1
nix run -L .#pypkg1.config.lock.refresh
  1. nix build -L .#pypkg1 failes 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 avatar Jul 20 '23 16:07 chaoflow

@chaoflow Is this here still relevant or can it be closed?

DavHau avatar Sep 05 '23 22:09 DavHau

@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?

chaoflow avatar Sep 06 '23 16:09 chaoflow

We should make them self contained, and yes, please feel free to add you example to the docs

DavHau avatar Sep 06 '23 20:09 DavHau