Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add poetry.lock for CLI project #116

Open
hall opened this issue Dec 12, 2023 · 1 comment
Open

add poetry.lock for CLI project #116

hall opened this issue Dec 12, 2023 · 1 comment

Comments

@hall
Copy link

hall commented Dec 12, 2023

When trying to package the CLI with poetry2nix,

{ poetry2nix
, fetchFromGitHub
}: with poetry2nix;
mkPoetryApplication rec {
  projectDir = (fetchFromGitHub {
    owner = "benkehoe";
    repo = "aws-sso-util";
    rev = "cli-v4.32";
    hash = "sha256-Wo2pTtIuyKwf4B5RrnRFeN8CR0K6Jy4NQECbh2JYqk4=";
  }) + "/cli";
}

it fails as there is no lock file:

error: getting status of '/nix/store/1qc2dl8zxvwpvifmy8sj982q4pldykss-source/cli/poetry.lock': No such file or directory

The only workaround I've been able to come up with is manually creating the lock file

  poetrylock = (runCommand "lock" { } ''
    mkdir $out
    cd $out

    export HOME=$PWD
    cp ${projectDir}/pyproject.toml pyproject.toml

    ${poetry}/bin/poetry lock
  '') + "/poetry.lock";

which requires disabling the sandbox (e.g., nix build --no-sandbox) since poetry resolves dependencies over the network.

Would you accept a PR to add the lock file?

@hall
Copy link
Author

hall commented Dec 12, 2023

Well . . . here's an easier workaround: just manually run poetry lock then vendor it alongside the derivation:

  poetrylock = ./poetry.lock;

That's much simpler and doesn't require disabling the sandbox; though I'd still like to know whether you're opposed to adding it directly in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant