devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Add support for `uv` project management

Open lamalex opened this issue 1 year ago • 2 comments

Adds support to python.nix to use uv sync when enabled and uv >= 0.4.4 uv 0.4.4 is the first version to respect UV_PROJECT_ENVIRONMENT which allows uv to play nicely with the venv created by devenv (not .venv)

lamalex avatar Sep 15 '24 12:09 lamalex

Looks like a great start :) Thank you so much!

Could you also add a test to tests?

domenkozar avatar Sep 15 '24 15:09 domenkozar

How do I generate docs so that check will pass?

lamalex avatar Sep 17 '24 02:09 lamalex

Error: Error: Pushing to https://github.com/lamalex/devenv
remote: Permission to lamalex/devenv.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/lamalex/devenv/': The requested URL returned error: 403

@sandydoo I think we've enabled this for PRs, but we'd have to target upstream branch for it to work.

domenkozar avatar Sep 17 '24 08:09 domenkozar

@lamalex

       error: at /run/github-runner/cachix-x86_64-linux/devenv/devenv/tests/python-uv-sync/devenv.nix:2:1:
            1| { pkgs, config, ... }:
            2| : let
             | ^
            3| pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };

       error: syntax error, unexpected ':'

domenkozar avatar Sep 18 '24 14:09 domenkozar

I've rebased and cleaned up in 7df6f2bc57c3d4793d3f96e791a09c0f5261c1ac, but I'm seeing test fail:

~/dev/cachix/devenv/tests/python-uv-sync/directory ~/dev/cachix/devenv/tests/python-uv-sync
Using Python 3.11.8 interpreter at: /nix/store/nbiqypvcx2k9g8d7s4l0h3ym0hz8fa50-python3-3.11.8-env/bin/python3
Creating virtualenv at: /home/domen/dev/cachix/devenv/tests/python-uv-sync/.devenv/state/venv
error: Unable to find lockfile at `uv.lock`. To create a lockfile, run `uv lock` or `uv sync`.
uv sync failed. Run 'uv sync' manually.
~/dev/cachix/devenv/tests/python-uv-sync

@lamalex any idea what's going on?

domenkozar avatar Sep 19 '24 19:09 domenkozar

Seems like we need to commit the initial uv.lock.

I've merged this manually, thank you!

domenkozar avatar Sep 20 '24 09:09 domenkozar