From 1ed037134c95700b56ae84e84e7b8eceea0bed49 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 19 Nov 2025 17:34:27 -0700 Subject: [PATCH 1/2] feat: Add Pixi workspace to pyproject.toml * Add Pixi workspace to pyproject.toml under [tool.pixi] table. * Add Pixi lock file to .gitignore. --- .gitattributes | 2 ++ .gitignore | 5 +++++ pyproject.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) diff --git a/.gitattributes b/.gitattributes index 743057e6f8..04ea30cfe6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,5 @@ .git_archival.txt export-subst *.py diff=python *.md diff=markdown +# SCM syntax highlighting & preventing 3-way merges +pixi.lock merge=binary linguist-language=YAML linguist-generated=true diff --git a/.gitignore b/.gitignore index 66b6392026..22fe6a8b79 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,8 @@ htmlcov # text editors .vscode/ + +# pixi environments +.pixi/* +!.pixi/config.toml +pixi.lock diff --git a/pyproject.toml b/pyproject.toml index e4d3d82341..68098b93de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -281,3 +281,58 @@ flake8-tidy-imports.ban-relative-imports = "all" [tool.ruff.lint.per-file-ignores] "docs/lite/jupyterlite.py" = ["F401", "F704"] "**.ipynb" = ["F821", "F401", "F841", "F811", "E703"] + +[tool.pixi.workspace] +channels = ["conda-forge"] +platforms = ["linux-64", "osx-arm64"] + +[tool.pixi.pypi-dependencies] +pyhf = { path = ".", editable = true } + +[tool.pixi.tasks] + +[tool.pixi.dependencies] +click = ">=8.0.0" +jsonpatch = ">=1.15" +jsonschema = ">=4.15.0" +pyyaml = ">=5.1" +scipy = ">=1.5.4,!=1.16.0,!=1.16.1,!=1.16.2" +tqdm = ">=4.56.0" + +[tool.pixi.feature.xmlio.dependencies] +uproot = ">=4.1.1" + +[tool.pixi.feature.jax.dependencies] +jax = ">=0.4.1" + +[tool.pixi.feature.jax-cpu.dependencies] +jax = ">=0.4.1" +jaxlib = { version = "*", build = "cpu*" } + +[tool.pixi.feature.jax-gpu.dependencies] +jax = ">=0.4.1" + +[tool.pixi.feature.jax-gpu.system-requirements] +cuda = "12.0" + +[tool.pixi.feature.contrib.dependencies] +matplotlib = ">=3.0.0" +requests = ">=2.22.0" + +[tool.pixi.feature.minuit.dependencies] +iminuit = ">=2.7.0" + +[tool.pixi.environments] +default = { solve-group = "default" } +jax = { features = ["jax"], solve-group = "default" } +jax-cpu = { features = ["jax-cpu"], solve-group = "default" } +jax-gpu = { features = ["jax-gpu"], solve-group = "gpu" } +xmlio = { features = ["xmlio"], solve-group = "default" } +minuit = { features = ["minuit"], solve-group = "default" } +contrib = { features = ["contrib"], solve-group = "default" } +backends = { features = ["jax", "minuit"], solve-group = "default" } +all = { features = ["jax", "minuit", "xmlio", "contrib"], solve-group = "default" } + +# dev = { features = ["dev"], solve-group = "default" } +# docs = { features = ["docs"], solve-group = "default" } +# test = { features = ["test"], solve-group = "default" } From a5606904ba2fd8a1635099c796302381b208dc9b Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 19 Nov 2025 18:30:06 -0700 Subject: [PATCH 2/2] stub out test environment --- pyproject.toml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 68098b93de..6b566a6831 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -322,6 +322,28 @@ requests = ">=2.22.0" [tool.pixi.feature.minuit.dependencies] iminuit = ">=2.7.0" +[tool.pixi.feature.test.dependencies] +pytest = ">=6.0" +scikit-hep-testdata = ">=0.4.11" +coverage = ">=6.0.0" +pytest-mock = "*" +requests-mock = ">=1.9.0" +pytest-benchmark = "*" +pytest-console-scripts = ">=1.4.0" +pytest-mpl = "*" +ipympl = ">=0.3.0" +pydocstyle = "*" +papermill = ">=2.5.0" +scrapbook = ">=0.5.0" +notebook = ">=6.5.7" +graphviz = "*" +pytest-socket = ">=0.2.0" + +[tool.pixi.feature.test.tasks.test] +cmd = """ +coverage run --module pytest --ignore tests/contrib --ignore tests/benchmarks --ignore tests/test_notebooks.py +""" + [tool.pixi.environments] default = { solve-group = "default" } jax = { features = ["jax"], solve-group = "default" } @@ -333,6 +355,6 @@ contrib = { features = ["contrib"], solve-group = "default" } backends = { features = ["jax", "minuit"], solve-group = "default" } all = { features = ["jax", "minuit", "xmlio", "contrib"], solve-group = "default" } +test = { features = ["jax", "minuit", "xmlio", "contrib", "test"], solve-group = "default" } # dev = { features = ["dev"], solve-group = "default" } # docs = { features = ["docs"], solve-group = "default" } -# test = { features = ["test"], solve-group = "default" }