diff --git a/.gitignore b/.gitignore index 07e76ee4d..d283596c3 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,5 @@ venv.bak/ # Mac .DS_Store + +.pixi diff --git a/docs/contributor_guide/index.rst b/docs/contributor_guide/index.rst index 3b94f2f35..660e3a656 100644 --- a/docs/contributor_guide/index.rst +++ b/docs/contributor_guide/index.rst @@ -73,3 +73,13 @@ Here are instructions for two popular environment managers: pre-commit install # to trigger manual check use: # pre-commit run --all-files + +* If you are using `pixi `_, then you can use the following pre-defined tasks: + +:: + + # run pytest + pixi run test + + # run pre-commit on all files + pixi run pre-commit diff --git a/pyproject.toml b/pyproject.toml index a3447b751..77a78b184 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -484,3 +484,28 @@ disable = [ "locally-disabled", "suppressed-message", ] + +[tool.pixi.project] +channels = ["conda-forge", "nodefaults"] +platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] + +[tool.pixi.pypi-dependencies] +python_graphblas = { path = ".", editable = true } + +[tool.pixi.environments] +default = { solve-group = "default" } +test-env = { features = ["test"], solve-group = "default" } +dev-env = { features = ["dev"], solve-group = "default" } + +[tool.pixi.feature.test-env.tasks] +test = "pytest graphblas" + +[tool.pixi.feature.dev.tasks] +post-install = "pre-commit install" +pre-commit = { cmd = [ + "pre-commit", + "run", + "--all-files", +], depends-on = [ + "post-install", +] }