-
Notifications
You must be signed in to change notification settings - Fork 557
Switch from Python setuptools to Pixi
#524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| Copyright 2022 - 2025 The Regents of the University of Illinois | ||
|
|
||
| Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
|
||
| 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
|
||
| 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
|
||
| 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| import os | ||
| import pickle | ||
| import pkg_resources | ||
| import mne | ||
| import pandas as pd | ||
| import numpy as np | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| #@meta {desc: "PyHealth build configuration", date: "2025-07-16"} | ||
|
|
||
|
|
||
| ### Project | ||
| # | ||
| [project] | ||
| name = "pyhealth" | ||
| # must be kept in sync with git tags; is not updated by any automation tools | ||
| version = "1.2.0" | ||
| authors = [ | ||
| {name = "John Wu", email = "johnwu3@illinois.edu"}, | ||
| {name = "Chaoqi Yang"}, | ||
| {name = "Zhenbang Wu"}, | ||
| {name = "Patrick Jiang"}, | ||
| {name = "Zhen Lin"}, | ||
| {name = "Benjamin Danek"}, | ||
| {name = "Junyi Gao"}, | ||
| {name = "Paul Landes", email = "landes@mailc.net"}, | ||
| {name = "Jimeng Sun"}, | ||
| ] | ||
| description = "A Python library for healthcare AI" | ||
| readme = "README.rst" | ||
| requires-python = ">=3.13,<3.14" | ||
| dependencies = [ | ||
| "torch~=2.7.1", | ||
| "torchvision", | ||
| "transformers~=4.53.2", | ||
| "rdkit==2025.3.3", | ||
| "scikit-learn!=1.7.0", | ||
| "networkx==3.5", | ||
| "mne~=1.10.0", | ||
| "urllib3~=2.5.0", | ||
| "numpy~=1.26.4", | ||
| "tqdm", | ||
| "polars~=1.31.0", | ||
| "pandas~=2.3.1", | ||
| "pandarallel~=1.6.5", | ||
| "pydantic~=2.11.7", | ||
| ] | ||
| license = "BSD-3-Clause" | ||
| license-files = ["LICENSE.md"] | ||
| keywords = [ | ||
| "heathcare AI", | ||
| "healthcare", | ||
| "electronic health records", | ||
| "EHRs", | ||
| "machine learning", | ||
| "data mining", | ||
| "neural networks", | ||
| "deep learning", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/sunlabuiuc/PyHealth" | ||
| Documentation = "https://pyhealth.readthedocs.io/en/latest/about.html" | ||
| Repository = "https://github.com/sunlabuiuc/PyHealth.git" | ||
| Issues = "https://github.com/sunlabuiuc/PyHealth/issues" | ||
| Changelog = "https://github.com/sunlabuiuc/PyHealth/blob/master/CHANGELOG.md" | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
|
|
||
| ### Hatchling | ||
| # | ||
| [tool.hatch.build.targets.wheel] | ||
| packages = ["pyhealth"] | ||
|
|
||
|
|
||
| ### Pixi | ||
| # | ||
| # specifies properties for the whole workspace | ||
| [tool.pixi.project] | ||
| channels = ["conda-forge"] | ||
| platforms = ["osx-arm64", "linux-64", "linux-aarch64", "win-64"] | ||
| preview = ["pixi-build"] | ||
|
|
||
| # virtual environments (each under '.pixi/envs') for specific tasks | ||
| [tool.pixi.environments] | ||
| default = { features = ["pyverbase"], solve-group = "default" } | ||
| test = { features = ["pyverbase", "test"] } | ||
| base = { features = ["pyverbase", "base"] } | ||
| nlp = { features = ["pyverbase", "nlp"] } | ||
| build-pypi = { features = ["pyverbase", "build-pypi"], solve-group = "default" } | ||
| build-env = { features = ["pyverbase", "build-env"], solve-group = "default" } | ||
|
|
||
| # specify where to download the build backend that builds conda files | ||
| [tool.pixi.package.build] | ||
| backend = { name = "pixi-build-python", version = "0.1.*" } | ||
| channels = [ | ||
| "https://prefix.dev/pixi-build-backends", | ||
| "https://prefix.dev/conda-forge", | ||
| ] | ||
|
|
||
| # set the Python requirement for its environment | ||
| [tool.pixi.feature.pyverbase.dependencies] | ||
| python = "~=3.13" | ||
|
|
||
| # pixi directly supports depending on PyPI packages, the PyPA calls a | ||
| # distributed package a 'distribution' | ||
| [tool.pixi.feature.base.pypi-dependencies] | ||
| pyhealth = { path = ".", editable = true } | ||
|
|
||
| [tool.pixi.feature.test.pypi-dependencies] | ||
| pyhealth = { path = ".", editable = true } | ||
|
|
||
| [tool.pixi.feature.nlp.pypi-dependencies] | ||
| pyhealth = { path = ".", editable = true } | ||
|
|
||
| [tool.pixi.feature.nlp.dependencies] | ||
| pip = "*" | ||
|
|
||
| # dependencies for building the wheel | ||
| [tool.pixi.feature.build-pypi.dependencies] | ||
| hatchling = "==1.26.3" | ||
|
|
||
| [tool.pixi.feature.build-env.dependencies] | ||
| # pip for environment extract | ||
| pip = "*" | ||
|
|
||
| # dependencies needed during build/link time that are specific to the host | ||
| # machine | ||
| [tool.pixi.package.host-dependencies] | ||
| hatchling = "==1.26.3" | ||
| python = "~=3.13" | ||
|
|
||
|
|
||
| ## Tasks | ||
| # | ||
| # task to use hatchling to build the wheel | ||
| [tool.pixi.feature.build-pypi.tasks] | ||
| build-wheel = "python -m hatchling build -t wheel --dir $PX_DIST_DIR" | ||
|
|
||
| # use Python built-in unittest library for tests | ||
| [tool.pixi.feature.test.tasks.test] | ||
| cmd = "python -m unittest discover -t tests -s tests/core -p 'test_*.py' -v" | ||
| [tool.pixi.feature.nlp.tasks.testnlp] | ||
| cmd = "python -m unittest discover -t tests -s tests/nlp -p 'test_*.py' -v" | ||
|
|
||
| # default environment tasks | ||
| [tool.pixi.tasks] | ||
| # env sanity check | ||
| defaultenv = "python -c 'import sys; print(sys.executable, sys.version)'" | ||
| # build the conda distribution file | ||
| build-conda = "pixi build --output-dir $PX_DIST_DIR" | ||
| # export environment.yml | ||
| export = "pixi workspace export conda-environment" | ||
|
|
||
| # command-line program invocation | ||
| [tool.pixi.tasks.invoke] | ||
| args = [{ "arg" = "args", "default" = "" }] | ||
| env = { CLASS = "zensols.relpo.cli", PYTHONPATH = "src" } | ||
| cmd = "\npython -c \"from $CLASS import main;print('_'*80);main('{{args}}'.split())\"" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable
dependenciesis a list butversion()expects a string package name. This should beversion(dependencies[0])or loop through the dependencies list.