Skip to content

Commit 2c303dc

Browse files
committed
feat(nix): integrate uv2nix for Python dependency management
Replace uv-managed .venv with Nix-managed Python environments using uv2nix. This provides fully reproducible builds with dependencies cached in the Nix store, eliminating the need for uv sync in CI. Key changes: - Add uv2nix, pyproject-nix, and pyproject-build-systems inputs - Create devShells for Python 3.11 and 3.13 (default, python311, python313) - Add build system overrides for pypika (setuptools) and stackone-ai (editables) - Update CI matrix to use nix develop .#pythonXXX instead of uv sync - Simplify setup-nix action with gc-max-store-size for cache management - Add lint-fix alias to justfile The .venv directory is no longer needed as all dependencies are managed by Nix. Both Nix and non-Nix users can still use uv run commands which will work in either environment.
1 parent 0bbfd2d commit 2c303dc

File tree

5 files changed

+247
-78
lines changed

5 files changed

+247
-78
lines changed

.github/actions/setup-nix/action.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,4 @@ runs:
1212
uses: nix-community/cache-nix-action@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7
1313
with:
1414
primary-key: nix-${{ runner.os }}
15-
16-
- name: Load Nix development environment
17-
shell: bash
18-
run: nix develop --command true
15+
gc-max-store-size: 4G

.github/workflows/ci.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ jobs:
3434
runs-on: ubuntu-latest
3535
strategy:
3636
matrix:
37-
python-version: ["3.11", "3.13"]
38-
include:
39-
- python-version: "3.11"
40-
sync-extras: "--all-extras"
41-
- python-version: "3.13"
42-
sync-extras: "--all-extras"
37+
python-version: ["python311", "python313"]
4338
env:
4439
STACKONE_API_KEY: ${{ secrets.STACKONE_API_KEY }}
4540
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
@@ -52,17 +47,14 @@ jobs:
5247
- name: Setup Nix
5348
uses: ./.github/actions/setup-nix
5449

55-
- name: Install dependencies
56-
run: nix develop --command just install ${{ matrix.sync-extras }}
57-
5850
- name: Run Lint
59-
run: nix develop --command just lint
51+
run: nix develop .#${{ matrix.python-version }} --command just lint
6052

6153
- name: Run Ty
62-
run: nix develop --command just ty
54+
run: nix develop .#${{ matrix.python-version }} --command just ty
6355

6456
- name: Run Tests
65-
run: nix develop --command just test
57+
run: nix develop .#${{ matrix.python-version }} --command just test
6658

6759
coverage:
6860
runs-on: ubuntu-latest
@@ -79,9 +71,6 @@ jobs:
7971
- name: Setup Nix
8072
uses: ./.github/actions/setup-nix
8173

82-
- name: Install dependencies
83-
run: nix develop --command just install --all-extras
84-
8574
- name: Run Tests with Coverage
8675
run: nix develop --command just coverage
8776

flake.lock

Lines changed: 87 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)