From 8bf1f46e2839bc677c2229bedb574d5de1faa845 Mon Sep 17 00:00:00 2001 From: xraymemory Date: Wed, 24 Jun 2026 11:23:37 -0400 Subject: [PATCH 1/2] chore(packaging): consolidate uv project metadata --- README.md | 40 +++++++++---- pyproject-hatch.toml | 137 ------------------------------------------- pyproject.toml | 83 ++++++++++++++++++++++++-- 3 files changed, 106 insertions(+), 154 deletions(-) delete mode 100644 pyproject-hatch.toml diff --git a/README.md b/README.md index 7ea4bb0a..3853ea8d 100644 --- a/README.md +++ b/README.md @@ -352,7 +352,25 @@ credentials. ## Development -We use [Pixi](https://pixi.sh/) to manage development environments and dependencies. Each model has its own environment, e.g. `boltz-dev`, `protenix-dev`, `rf3-dev`. To install dev dependencies and run tests: +For lightweight source-checkout development, use [uv](https://docs.astral.sh/uv/): + +```bash +uv sync --group dev +uv run sampleworks-guidance --help +uv run pytest tests -m 'not slow' +``` + +Optional model and analysis dependencies are exposed as package extras: + +```bash +uv sync --extra boltz --group dev +uv sync --extra protenix --group dev # Linux/CUDA only +uv sync --extra rf3 --group dev # uses tool.uv.sources for rc-foundry +uv sync --extra analysis --extra eval --group dev +``` + +The existing GPU model environments are split by model, e.g. `boltz-dev`, +`protenix-dev`, `rf3-dev`. To install dev dependencies and run tests there: ```bash pixi install -e [model]-dev # add pytest, ruff, ty @@ -373,19 +391,17 @@ See [`tests/README.md`](tests/README.md) for full testing instructions. ## macOS (experimental) -To develop on OS X, ensure you have [homebrew](https://brew.sh/) installed and run the following commands to install dependencies: +On macOS, use uv for source-checkout development and avoid Linux/CUDA-only model +extras unless you know they are supported on your machine: -1. Install hatch and uv - ```bash - brew install hatch uv - ``` -2. Move/copy `pyproject-hatch.toml` to `pyproject.toml` -3. Use `uvx hatch run ` to run commands. Note the use of `uvx` instead of `uv` -4. Use `uvx hatch run :` to run commands in a specific environment ``. +```bash +brew install uv +uv sync --group dev +uv run pytest tests -m 'not slow' +``` -There are different (and as yet untested) environments for `boltz`. `protenix` won't currently work on a Mac due to -the strict requirement of `triton` which requires an NVIDIA GPU. You may find similar issues with other environments. -Debug as needed. +`protenix` currently requires `triton`/NVIDIA GPU support and is not expected to +work on macOS. Some RF3/Boltz workflows may also require Linux/CUDA packages. ## Commit Messages diff --git a/pyproject-hatch.toml b/pyproject-hatch.toml deleted file mode 100644 index d8db0b6a..00000000 --- a/pyproject-hatch.toml +++ /dev/null @@ -1,137 +0,0 @@ -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[project] -name = "sampleworks" -version = "0.1.0" -description = "Add a short description here" -authors = [ - { name = "K. Chrispens", email = "karson.chrispens@ucsf.edu" } -] -requires-python = ">= 3.11" -readme = "README.md" -license = { file = "LICENSE" } -dependencies = [ - "atomworks[ml]", - "dotenv", - "einx", - "hydra-core", - "jax", - "jaxtyping", - "matplotlib>=3.10.0", - "numpy>=2.2.1", - "omegaconf", - "pandas>=2.2.3", - "seaborn>=0.13.2", - "torch>=2.5.1", - "tqdm>=4.67.1", - "gemmi>=0.6.7", - "reciprocalspaceship>=1.0.3", - "scipy>=1.15.1", - "loguru", -] - -[project.optional-dependencies] -dev = [ - "pytest>=7.0.0", - "pytest-cov>=4.0.0", - "ruff>=0.1.0", - "mypy>=1.0.0", -] -test = [ - "pytest>=7.0.0", - "pytest-cov>=4.0.0", -] - -[tool.hatch.version] -path = "src/sampleworks/__init__.py" - -[tool.hatch.build.targets.wheel] -packages = ["src/sampleworks"] - -[tool.hatch.build.targets.sdist] -include = [ - "/src", - "/tests", - "/README.md", - "/LICENSE", -] - -[tool.hatch.envs.default] -dependencies = [ - "pytest", - "pytest-cov", -] - -[tool.hatch.envs.default.scripts] -test = "pytest {args:tests}" -test-cov = "pytest --cov=sampleworks --cov-report=term-missing {args:tests}" -cov-report = [ - "pytest --cov=sampleworks --cov-report=html {args:tests}", - "python -m http.server 8000 --directory htmlcov", -] - -[tool.hatch.envs.lint] -detached = true -dependencies = [ - "ruff>=0.1.0", - "mypy>=1.0.0", -] - -[tool.hatch.envs.lint.scripts] -check = [ - "ruff check {args:.}", - "mypy {args:src/sampleworks}", -] -fmt = [ - "ruff format {args:.}", - "ruff check --fix {args:.}", -] - -[tool.hatch.envs.boltz] -description = "Environment for molecular modeling with Boltz and RDKit" -dependencies = [ - "boltz", - "cuequivariance-torch", - "cuequivariance-ops-torch-cu12", - "rdkit>=2025.3.6", -] - -[tool.hatch.envs.boltz.scripts] -# Add custom scripts for this environment if needed -check-imports = "python -c 'import boltz; import rdkit; from cuequivariance_torch import *; print(\"All imports successful\")'" - - -[tool.ruff] -line-length = 100 -target-version = "py311" - -[tool.ruff.lint] -select = [ - "E", # pycodestyle errors - "W", # pycodestyle warnings - "F", # pyflakes - "I", # isort - "B", # flake8-bugbear - "C4", # flake8-comprehensions - "UP", # pyupgrade -] -ignore = [] - -[tool.ruff.lint.per-file-ignores] -"__init__.py" = ["F401"] - -[tool.pytest.ini_options] -testpaths = ["tests"] -python_files = ["test_*.py"] -python_classes = ["Test*"] -python_functions = ["test_*"] -addopts = "-v" - -[tool.mypy] -python_version = "3.11" -warn_return_any = true -warn_unused_configs = true -disallow_untyped_defs = false -ignore_missing_imports = true diff --git a/pyproject.toml b/pyproject.toml index 695329bf..eaac243e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] build-backend = "hatchling.build" -requires = ["hatchling"] +requires = ["hatchling>=1.27"] [dependency-groups] analysis = [ @@ -17,6 +17,7 @@ analysis = [ "seaborn" ] dev = ["pytest", "pytest-cov", "mypy", "prek", "ty", "ruff", "pytest-loguru", "python-semantic-release"] +test = ["pytest", "pytest-cov", "pytest-loguru"] [tool.pixi.feature.boltz] pypi-dependencies = {"boltz" = "*", "cuequivariance-torch" = "*", "cuequivariance-ops-torch-cu12" = "*", "rdkit" = ">=2025.3.6"} @@ -33,26 +34,95 @@ platforms = ["linux-64"] [project] authors = [{email = "karson.chrispens@ucsf.edu", name = "Karson Chrispens"}] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Bio-Informatics", + "Topic :: Scientific/Engineering :: Chemistry" +] dependencies = [ "atomworks[ml]==2.1.1", - "python-dotenv", - "jaxtyping", - "jax", "einx<0.4", "hydra-core", + "jax", + "jaxtyping", "loguru", + "numpy<2.0", "omegaconf", - "sfcalculator-torch>=0.3.2" + "python-dotenv", + "sfcalculator-torch>=0.3.2", + "torch", + "tqdm" ] +description = "Experimentally guided biomolecular ensemble generation." +keywords = ["biomolecular-structure", "crystallography", "diffusion", "ensemble-generation", "protein-structure"] +license = {file = "LICENSE"} name = "sampleworks" +readme = "README.md" requires-python = ">= 3.11, <3.14" version = "0.10.0" +[project.optional-dependencies] +analysis = [ + "ipython", + "joblib", + "marimo", + "matplotlib", + "mdtraj", + "pandas", + "peppr", + "polars", + "pyzmq", + "scikit-learn", + "seaborn" +] +boltz = [ + "boltz", + "cuequivariance-ops-torch-cu12; platform_system == 'Linux' and platform_machine == 'x86_64'", + "cuequivariance-torch", + "rdkit>=2025.3.6" +] +dev = ["pytest", "pytest-cov", "mypy", "prek", "ty", "ruff", "pytest-loguru", "python-semantic-release"] +eval = ["gemmi>=0.6.7", "joblib", "pandas>=2.2.3", "reciprocalspaceship>=1.0.3"] +protenix = ["protenix", "triton; platform_system == 'Linux' and platform_machine == 'x86_64'"] +rf3 = ["rc-foundry[rf3]; python_version >= '3.12' and python_version < '3.13'"] +test = ["pytest", "pytest-cov", "pytest-loguru"] + +[project.urls] +Changelog = "https://github.com/diff-use/sampleworks/blob/main/CHANGELOG.md" +Homepage = "https://diffuse.science/posts/sampleworks/" +Issues = "https://github.com/diff-use/sampleworks/issues" +Repository = "https://github.com/diff-use/sampleworks" + [project.scripts] sampleworks-analysis = "sampleworks.runs.analysis_cli:main" sampleworks-guidance = "sampleworks.cli.guidance:main" sampleworks-runs = "sampleworks.runs.cli:main" +[tool.hatch.build.targets.sdist] +include = [ + "/analyses", + "/CHANGELOG.md", + "/experiments", + "/LICENSE", + "/pyproject.toml", + "/README.md", + "/src", + "/tests" +] + +[tool.hatch.build.targets.wheel] +packages = ["src/sampleworks"] + [tool.hatch.build.targets.wheel.force-include] "analyses" = "analyses" "experiments" = "experiments" @@ -226,3 +296,6 @@ unresolved-import = "ignore" unsupported-operator = "warn" unused-ignore-comment = "warn" unused-type-ignore-comment = "warn" + +[tool.uv.sources] +rc-foundry = {git = "https://github.com/k-chrispens/foundry.git"} From 600c8c70e9e4d9e22e2975666bc77c59be26e5ba Mon Sep 17 00:00:00 2001 From: xraymemory Date: Wed, 24 Jun 2026 12:14:58 -0400 Subject: [PATCH 2/2] fix(packaging): avoid pixi feature extras collision --- README.md | 9 ++++----- pyproject.toml | 34 +--------------------------------- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 3853ea8d..13f0875d 100644 --- a/README.md +++ b/README.md @@ -360,13 +360,12 @@ uv run sampleworks-guidance --help uv run pytest tests -m 'not slow' ``` -Optional model and analysis dependencies are exposed as package extras: +Additional uv dependency groups are available for development and analysis: ```bash -uv sync --extra boltz --group dev -uv sync --extra protenix --group dev # Linux/CUDA only -uv sync --extra rf3 --group dev # uses tool.uv.sources for rc-foundry -uv sync --extra analysis --extra eval --group dev +uv sync --group dev +uv sync --group analysis +uv sync --group test ``` The existing GPU model environments are split by model, e.g. `boltz-dev`, diff --git a/pyproject.toml b/pyproject.toml index eaac243e..67edbf27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,12 +56,9 @@ dependencies = [ "jax", "jaxtyping", "loguru", - "numpy<2.0", "omegaconf", "python-dotenv", - "sfcalculator-torch>=0.3.2", - "torch", - "tqdm" + "sfcalculator-torch>=0.3.2" ] description = "Experimentally guided biomolecular ensemble generation." keywords = ["biomolecular-structure", "crystallography", "diffusion", "ensemble-generation", "protein-structure"] @@ -71,32 +68,6 @@ readme = "README.md" requires-python = ">= 3.11, <3.14" version = "0.10.0" -[project.optional-dependencies] -analysis = [ - "ipython", - "joblib", - "marimo", - "matplotlib", - "mdtraj", - "pandas", - "peppr", - "polars", - "pyzmq", - "scikit-learn", - "seaborn" -] -boltz = [ - "boltz", - "cuequivariance-ops-torch-cu12; platform_system == 'Linux' and platform_machine == 'x86_64'", - "cuequivariance-torch", - "rdkit>=2025.3.6" -] -dev = ["pytest", "pytest-cov", "mypy", "prek", "ty", "ruff", "pytest-loguru", "python-semantic-release"] -eval = ["gemmi>=0.6.7", "joblib", "pandas>=2.2.3", "reciprocalspaceship>=1.0.3"] -protenix = ["protenix", "triton; platform_system == 'Linux' and platform_machine == 'x86_64'"] -rf3 = ["rc-foundry[rf3]; python_version >= '3.12' and python_version < '3.13'"] -test = ["pytest", "pytest-cov", "pytest-loguru"] - [project.urls] Changelog = "https://github.com/diff-use/sampleworks/blob/main/CHANGELOG.md" Homepage = "https://diffuse.science/posts/sampleworks/" @@ -296,6 +267,3 @@ unresolved-import = "ignore" unsupported-operator = "warn" unused-ignore-comment = "warn" unused-type-ignore-comment = "warn" - -[tool.uv.sources] -rc-foundry = {git = "https://github.com/k-chrispens/foundry.git"}