Skip to content

Commit

Permalink
fix: pixi lock
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Jul 16, 2024
2 parents 40dcbe9 + 2460253 commit 8f1beaf
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# name: Run updater that will check for conda-forge packages

on: push
on:
push:
branches: [ "main" ]
pull_request:

jobs:
run_tests:
Expand All @@ -12,10 +15,7 @@ jobs:
- uses: prefix-dev/[email protected]
with:
pixi-version: "latest"

- name: pixi install
run: |
pixi install
environments: test

- name: run tests
run: |
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ jobs:
with:
environments: lint
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure
env:
# As the rust GitHub action is better at the rust jobs it can be skipped in this job.
SKIP: fmt
run: pixi run pre-commit-run --color=always --show-diff-on-failure --all
2 changes: 1 addition & 1 deletion pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exclude = [
]

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["S101", "INP001"]
"tests/*.py" = ["S101", "INP001", "PLR2004", "ANN001"]

[tool.pyright]
venvPath = ".pixi/envs"
Expand Down
13 changes: 8 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from __future__ import annotations

from os import mkdir
from pathlib import Path
from typing import Any

import pytest


@pytest.fixture()
def python_recipe(tmpdir):
def python_recipe(tmpdir: Path) -> str:
recipe_dir = tmpdir / "recipe"
mkdir(recipe_dir)

Expand All @@ -21,7 +24,7 @@ def python_recipe(tmpdir):


@pytest.fixture()
def env_recipe(tmpdir):
def env_recipe(tmpdir: Path) -> str:
recipe_dir = tmpdir / "recipe"
mkdir(recipe_dir)

Expand All @@ -33,12 +36,12 @@ def env_recipe(tmpdir):


@pytest.fixture()
def unix_namespace():
def unix_namespace() -> dict[str, Any]:
return {"linux-64": True, "unix": True}


@pytest.fixture()
def recipe_dir(tmpdir):
def recipe_dir(tmpdir: Path) -> Path:
py_recipe = Path("tests/data/py_recipe.yaml").read_text()
recipe_dir = tmpdir / "recipe"
mkdir(recipe_dir)
Expand All @@ -49,7 +52,7 @@ def recipe_dir(tmpdir):


@pytest.fixture()
def old_recipe_dir(tmpdir):
def old_recipe_dir(tmpdir: Path) -> Path:
recipe_dir = tmpdir / "recipe"
mkdir(recipe_dir)

Expand Down
5 changes: 4 additions & 1 deletion tests/test_rattler_loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from __future__ import annotations

from pathlib import Path
from typing import Any

from rattler_build_conda_compat.loader import (
load_all_requirements,
Expand All @@ -7,7 +10,7 @@
)


def test_load_variants(snapshot, unix_namespace) -> None:
def test_load_variants(snapshot, unix_namespace: dict[str, Any]) -> None:
variants_path = Path("tests/data/variants.yaml")

loaded_variants = parse_recipe_config_file(str(variants_path), unix_namespace)
Expand Down
8 changes: 7 additions & 1 deletion tests/test_rattler_render.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
from __future__ import annotations

import os
from typing import TYPE_CHECKING, Any

from rattler_build_conda_compat.loader import parse_recipe_config_file
from rattler_build_conda_compat.render import render

if TYPE_CHECKING:
from pathlib import Path


def test_render_recipe(python_recipe, unix_namespace, snapshot) -> None:
def test_render_recipe(python_recipe: Path, unix_namespace: dict[str, Any], snapshot) -> None:
variants = parse_recipe_config_file(str(python_recipe / "variants.yaml"), unix_namespace)

rendered = render(str(python_recipe), variants=variants, platform="linux", arch="64")
Expand Down

0 comments on commit 8f1beaf

Please sign in to comment.