From 3e2f85f36accecbd8a1998ab3d9b596b62b89d0f Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Sat, 28 Feb 2026 18:18:50 -0800 Subject: [PATCH 01/12] Add pre-commit config and build workflow --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 10 ++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..92bdbd6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Build + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.12] + + # Skip CI if 'skip ci' is contained in the latest commit message + if: "!contains(github.event.head_commit.message, 'skip ci')" + + steps: + - uses: actions/checkout@v6 + + - name: Setup UV and python version + uses: astral-sh/setup-uv@v7 + with: + version: "0.10.6" + python: ${{ matrix.python-version }} + + - name: Install dependencies + run: uv sync --group dev + + - name: Run tests + env: + TEST_DATA_DIR: ${{ github.workspace }}/tests/test_files + run: uv run pytest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..412c34d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.15.0 + hooks: + # Run the linter. + - id: ruff-check + args: [--verbose, --fix] + # Run the formatter. + - id: ruff-format + args: [--verbose] \ No newline at end of file From 8e8c42ae24bff92f0ab5dfbf7a17db1517957c23 Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Sat, 28 Feb 2026 22:11:02 -0800 Subject: [PATCH 02/12] added more pre-commit and auto-commit. skip ci. --- .github/workflows/build.yml | 6 +++-- .github/workflows/lint.yml | 52 +++++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 7 ++++- pyproject.toml | 18 +++++++++++++ 4 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92bdbd6..9e80298 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,10 @@ jobs: matrix: python-version: [3.12] - # Skip CI if 'skip ci' is contained in the latest commit message - if: "!contains(github.event.head_commit.message, 'skip ci')" + # Skip CI if 'skip ci' is in the latest commit message or if PR is a draft + if: | + !contains(github.event.head_commit.message, 'skip ci') && + (github.event_name != 'pull_request' || !github.event.pull_request.draft) steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..ad487de --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,52 @@ +name: Lint + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + ruff: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install ruff + run: pip install ruff + + - name: Auto-fix with ruff + run: | + ruff check --fix . + ruff format . + + - name: Commit ruff fixes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Auto-commit ruff fixes [skip ci]" + commit_username: "Autoformatter" + commit_email: "Autoformatter " + + mypy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Setup UV and python version + uses: astral-sh/setup-uv@v7 + with: + version: "0.10.6" + python: "3.12" + + - name: Install dependencies + run: uv sync --group dev + + - name: Run mypy + run: uv run mypy src/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 412c34d..914db6c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,4 +7,9 @@ repos: args: [--verbose, --fix] # Run the formatter. - id: ruff-format - args: [--verbose] \ No newline at end of file + args: [--verbose] + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.19.1 + hooks: + - id: mypy \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e59121b..903ce5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -201,6 +201,24 @@ dev = [ "pytest-xdist>=3.0.0", ] +[tool.mypy] +python_version = "3.12" +warn_return_any = true +warn_unused_ignores = true +ignore_missing_imports = false + +[[tool.mypy.overrides]] +module = [ + "biotite.*", + "e3nn.*", + "torch_geometric.*", + "torch_cluster.*", + "torch_scatter.*", + "pymol2.*", + "esm.*", +] +ignore_missing_imports = true + # PyTorch CUDA 12.6 index (so `torch`/`torchvision` come from the right place) [[tool.uv.index]] name = "pytorch-cu126" From d40139de638fc2468728744542606452c7e3e218 Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Sun, 1 Mar 2026 17:22:54 -0800 Subject: [PATCH 03/12] fixing type check. skip ci. --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 903ce5c..66b17cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -194,11 +194,13 @@ dev = [ "hypothesis>=6.70.0", "isort>=5.12.0", "mypy>=1.0.0", + "pandas-stubs>=2.0.0", "pytest>=7.0.0", "pytest-cov>=4.0.0", "pytest-mock>=3.10.0", "pytest-timeout>=2.1.0", "pytest-xdist>=3.0.0", + "types-tqdm>=4.0.0", ] [tool.mypy] @@ -209,6 +211,8 @@ ignore_missing_imports = false [[tool.mypy.overrides]] module = [ + "scipy.*", + "sklearn.*", "biotite.*", "e3nn.*", "torch_geometric.*", From c2a8a1999c5679272c2688f7752ead4313a27d29 Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Mon, 2 Mar 2026 11:12:18 -0800 Subject: [PATCH 04/12] removing dev dependencies from main dependency group. --- pyproject.toml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 66b17cb..09c4334 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ version = "0.1.0" requires-python = ">=3.12,<3.13" dependencies = [ "torch==2.8.0", - "torchvision", "torch-geometric", "torch-scatter", "torch-cluster", @@ -27,7 +26,6 @@ dependencies = [ "attrs>=25.4.0", "biopandas>=0.4.1", "biotraj>=1.2.2", - "black>=25.12.0", "boto3>=1.42.22", "botocore>=1.42.22", "brotli>=1.2.0", @@ -37,7 +35,6 @@ dependencies = [ "cloudpathlib>=0.23.0", "comm>=0.2.3", "contourpy>=1.3.3", - "coverage>=7.13.0", "cycler>=0.12.1", "cython>=3.2.4", "cytoolz>=0.12.3", @@ -49,7 +46,6 @@ dependencies = [ "execnet>=2.1.2", "executing>=2.2.1", "filelock>=3.20.1", - "flake8>=7.3.0", "fonttools>=4.61.1", "frozendict>=2.4.7", "frozenlist>=1.8.0", @@ -63,13 +59,11 @@ dependencies = [ "huggingface-hub>=0.36.0", "hydra-core>=1.3.2", "hydride>=1.2.3", - "hypothesis>=6.148.7", "idna>=3.11", "iniconfig>=2.3.0", "ipython>=9.9.0", "ipython-pygments-lexers>=1.1.1", "ipywidgets>=8.1.8", - "isort>=7.0.0", "jedi>=0.19.2", "jinja2>=3.1.6", "jmespath>=1.0.1", @@ -91,8 +85,6 @@ dependencies = [ "msgpack>=1.1.2", "msgpack-numpy>=0.4.8", "multidict>=6.7.0", - "mypy>=1.19.1", - "mypy-extensions>=1.1.0", "numpy>=1.26.4", "nvidia-cublas-cu12>=12.6.4.1", "nvidia-cuda-cupti-cu12>=12.6.80", @@ -128,20 +120,13 @@ dependencies = [ "pure-eval>=0.2.3", "py3dmol>=2.5.3", "pyarrow>=17.0.0", - "pycodestyle>=2.14.0", "pydantic>=2.12.5", "pydantic-core>=2.41.5", "pydssp>=0.9.1", - "pyflakes>=3.4.0", "pygments>=2.19.2", "pygtrie>=2.5.0", "pymol-remote>=1.1.0", "pyparsing>=3.2.5", - "pytest>=9.0.2", - "pytest-cov>=7.0.0", - "pytest-mock>=3.15.1", - "pytest-timeout>=2.4.0", - "pytest-xdist>=3.8.0", "python-dateutil>=2.9.0.post0", "pytokens>=0.3.0", "pytorch-lightning>=2.6.0", From 7ac377c4eaae92813f1520fde1b0212ee33ef60a Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Mon, 2 Mar 2026 11:19:42 -0800 Subject: [PATCH 05/12] removing dependencies not used. --- .github/workflows/build.yml | 11 +++++--- pyproject.toml | 53 +++++++------------------------------ 2 files changed, 17 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e80298..e947849 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: jobs: build: @@ -13,10 +14,12 @@ jobs: matrix: python-version: [3.12] - # Skip CI if 'skip ci' is in the latest commit message or if PR is a draft - if: | - !contains(github.event.head_commit.message, 'skip ci') && - (github.event_name != 'pull_request' || !github.event.pull_request.draft) + # Skip CI if 'skip ci' is in the latest commit message + if: "!contains(github.event.head_commit.message, 'skip ci')" + # Will add back on skipping for draft PRs too. + # if: | + # !contains(github.event.head_commit.message, 'skip ci') && + # (github.event_name != 'pull_request' || !github.event.pull_request.draft) steps: - uses: actions/checkout@v6 diff --git a/pyproject.toml b/pyproject.toml index 09c4334..a8e053e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ name = "waterflow" version = "0.1.0" requires-python = ">=3.12,<3.13" dependencies = [ + # --- directly used --- "torch==2.8.0", "torch-geometric", "torch-scatter", @@ -10,11 +11,18 @@ dependencies = [ "pyg-lib", "biotite", "wandb", - "networkx", "e3nn", - "biopython", + "esm>=3.2.3", "matplotlib>=3.10.8", "pymol-open-source-whl>=3.1.0.4", + "loguru>=0.7.3", + "numpy>=1.26.4", + "pandas>=2.3.3", + "pillow>=12.0.0", + "scikit-learn>=1.8.0", + "scipy>=1.16.3", + "tqdm>=4.67.1", + # --- transitive (cleaned up in later steps) --- "aiohappyeyeballs>=2.6.1", "aiohttp>=3.13.2", "aiosignal>=1.4.0", @@ -22,27 +30,17 @@ dependencies = [ "antlr4-python3-runtime>=4.9.3", "anyio>=4.12.1", "asttokens>=3.0.1", - "atomworks==2.2.0", "attrs>=25.4.0", - "biopandas>=0.4.1", - "biotraj>=1.2.2", - "boto3>=1.42.22", - "botocore>=1.42.22", "brotli>=1.2.0", "certifi>=2025.11.12", "charset-normalizer>=3.4.4", "click>=8.3.1", - "cloudpathlib>=0.23.0", "comm>=0.2.3", "contourpy>=1.3.3", "cycler>=0.12.1", "cython>=3.2.4", "cytoolz>=0.12.3", "decorator>=5.2.1", - "dna-features-viewer>=3.1.5", - "einops>=0.8.1", - "einx>=0.3.0", - "esm>=3.2.3", "execnet>=2.1.2", "executing>=2.2.1", "filelock>=3.20.1", @@ -56,9 +54,6 @@ dependencies = [ "hf-xet>=1.2.0", "httpcore>=1.0.9", "httpx>=0.28.1", - "huggingface-hub>=0.36.0", - "hydra-core>=1.3.2", - "hydride>=1.2.3", "idna>=3.11", "iniconfig>=2.3.0", "ipython>=9.9.0", @@ -71,21 +66,16 @@ dependencies = [ "jupyterlab-widgets>=3.0.16", "kiwisolver>=1.4.9", "librt>=0.7.4", - "lightning>=2.6.0", - "lightning-utilities>=0.15.2", - "loguru>=0.7.3", "looseversion>=1.3.0", "markdown-it-py>=4.0.0", "markupsafe>=3.0.3", "matplotlib-inline>=0.2.1", "mccabe>=0.7.0", "mdurl>=0.1.2", - "mmtf-python>=1.1.3", "mpmath>=1.3.0", "msgpack>=1.1.2", "msgpack-numpy>=0.4.8", "multidict>=6.7.0", - "numpy>=1.26.4", "nvidia-cublas-cu12>=12.6.4.1", "nvidia-cuda-cupti-cu12>=12.6.80", "nvidia-cuda-nvrtc-cu12>=12.6.77", @@ -101,15 +91,12 @@ dependencies = [ "nvidia-nvjitlink-cu12>=12.6.85", "nvidia-nvshmem-cu12>=3.5.19", "nvidia-nvtx-cu12>=12.6.77", - "omegaconf>=2.3.0", "opt-einsum>=3.4.0", "opt-einsum-fx>=0.1.4", "packaging>=25.0", - "pandas>=2.3.3", "parso>=0.8.5", "pathspec>=0.12.1", "pexpect>=4.9.0", - "pillow>=12.0.0", "platformdirs>=4.5.1", "pluggy>=1.6.0", "prompt-toolkit>=3.0.52", @@ -118,29 +105,16 @@ dependencies = [ "psutil>=7.1.3", "ptyprocess>=0.7.0", "pure-eval>=0.2.3", - "py3dmol>=2.5.3", "pyarrow>=17.0.0", - "pydantic>=2.12.5", - "pydantic-core>=2.41.5", - "pydssp>=0.9.1", "pygments>=2.19.2", "pygtrie>=2.5.0", - "pymol-remote>=1.1.0", "pyparsing>=3.2.5", "python-dateutil>=2.9.0.post0", "pytokens>=0.3.0", - "pytorch-lightning>=2.6.0", "pytz>=2025.2", "pyyaml>=6.0.3", - "rdkit>=2025.3.6", "regex>=2025.11.3", "requests>=2.32.5", - "rich>=14.2.0", - "s3transfer>=0.16.0", - "safetensors>=0.7.0", - "scikit-learn>=1.8.0", - "scipy>=1.16.3", - "sentry-sdk>=2.48.0", "setuptools>=80.9.0", "shellingham>=1.5.4", "six>=1.17.0", @@ -152,14 +126,8 @@ dependencies = [ "threadpoolctl>=3.6.0", "tokenizers>=0.21.4", "toolz>=1.1.0", - "torch-runstats>=0.2.0", - "torchmetrics>=1.8.2", - "torchtext>=0.18.0", - "tqdm>=4.67.1", "traitlets>=5.14.3", - "transformers>=4.48.1", "triton>=3.4.0", - "typer>=0.21.1", "typing-extensions>=4.15.0", "typing-inspection>=0.4.2", "tzdata>=2025.3", @@ -223,7 +191,6 @@ explicit = true [tool.uv.sources] torch = { index = "pytorch-cu126" } -torchvision = { index = "pytorch-cu126" } torch-scatter = { index = "pyg-cu126" } torch-cluster = { index = "pyg-cu126" } From 094c59dd5559bab3294255bed0bb5a1588864318 Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Mon, 2 Mar 2026 11:53:40 -0800 Subject: [PATCH 06/12] removing nvidia-cu12 related dependencies. torch should hopefully handle. --- pyproject.toml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a8e053e..2fc4861 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,21 +76,6 @@ dependencies = [ "msgpack>=1.1.2", "msgpack-numpy>=0.4.8", "multidict>=6.7.0", - "nvidia-cublas-cu12>=12.6.4.1", - "nvidia-cuda-cupti-cu12>=12.6.80", - "nvidia-cuda-nvrtc-cu12>=12.6.77", - "nvidia-cuda-runtime-cu12>=12.6.77", - "nvidia-cudnn-cu12>=9.10.2.21", - "nvidia-cufft-cu12>=11.3.0.4", - "nvidia-cufile-cu12>=1.11.1.6", - "nvidia-curand-cu12>=10.3.7.77", - "nvidia-cusolver-cu12>=11.7.1.2", - "nvidia-cusparse-cu12>=12.5.4.2", - "nvidia-cusparselt-cu12>=0.7.1", - "nvidia-nccl-cu12>=2.27.3", - "nvidia-nvjitlink-cu12>=12.6.85", - "nvidia-nvshmem-cu12>=3.5.19", - "nvidia-nvtx-cu12>=12.6.77", "opt-einsum>=3.4.0", "opt-einsum-fx>=0.1.4", "packaging>=25.0", From fdd9fb75109b456c856ac5d2650346be407d0cc6 Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Mon, 2 Mar 2026 11:54:50 -0800 Subject: [PATCH 07/12] Remove transitive and nvidia-cu12 noise from pyproject.toml Steps 3 & 4: drop all 17 nvidia-*-cu12 packages (transitive from torch==2.8.0 cu126 build) and ~85 other transitive packages that uv resolves automatically. Direct dependencies only remain. Co-Authored-By: Claude Sonnet 4.6 --- pyproject.toml | 102 ------------------------------------------------- 1 file changed, 102 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2fc4861..cb1862b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,6 @@ name = "waterflow" version = "0.1.0" requires-python = ">=3.12,<3.13" dependencies = [ - # --- directly used --- "torch==2.8.0", "torch-geometric", "torch-scatter", @@ -22,107 +21,6 @@ dependencies = [ "scikit-learn>=1.8.0", "scipy>=1.16.3", "tqdm>=4.67.1", - # --- transitive (cleaned up in later steps) --- - "aiohappyeyeballs>=2.6.1", - "aiohttp>=3.13.2", - "aiosignal>=1.4.0", - "annotated-types>=0.7.0", - "antlr4-python3-runtime>=4.9.3", - "anyio>=4.12.1", - "asttokens>=3.0.1", - "attrs>=25.4.0", - "brotli>=1.2.0", - "certifi>=2025.11.12", - "charset-normalizer>=3.4.4", - "click>=8.3.1", - "comm>=0.2.3", - "contourpy>=1.3.3", - "cycler>=0.12.1", - "cython>=3.2.4", - "cytoolz>=0.12.3", - "decorator>=5.2.1", - "execnet>=2.1.2", - "executing>=2.2.1", - "filelock>=3.20.1", - "fonttools>=4.61.1", - "frozendict>=2.4.7", - "frozenlist>=1.8.0", - "fsspec>=2025.12.0", - "gitdb>=4.0.12", - "gitpython>=3.1.45", - "h11>=0.16.0", - "hf-xet>=1.2.0", - "httpcore>=1.0.9", - "httpx>=0.28.1", - "idna>=3.11", - "iniconfig>=2.3.0", - "ipython>=9.9.0", - "ipython-pygments-lexers>=1.1.1", - "ipywidgets>=8.1.8", - "jedi>=0.19.2", - "jinja2>=3.1.6", - "jmespath>=1.0.1", - "joblib>=1.5.3", - "jupyterlab-widgets>=3.0.16", - "kiwisolver>=1.4.9", - "librt>=0.7.4", - "looseversion>=1.3.0", - "markdown-it-py>=4.0.0", - "markupsafe>=3.0.3", - "matplotlib-inline>=0.2.1", - "mccabe>=0.7.0", - "mdurl>=0.1.2", - "mpmath>=1.3.0", - "msgpack>=1.1.2", - "msgpack-numpy>=0.4.8", - "multidict>=6.7.0", - "opt-einsum>=3.4.0", - "opt-einsum-fx>=0.1.4", - "packaging>=25.0", - "parso>=0.8.5", - "pathspec>=0.12.1", - "pexpect>=4.9.0", - "platformdirs>=4.5.1", - "pluggy>=1.6.0", - "prompt-toolkit>=3.0.52", - "propcache>=0.4.1", - "protobuf>=6.33.2", - "psutil>=7.1.3", - "ptyprocess>=0.7.0", - "pure-eval>=0.2.3", - "pyarrow>=17.0.0", - "pygments>=2.19.2", - "pygtrie>=2.5.0", - "pyparsing>=3.2.5", - "python-dateutil>=2.9.0.post0", - "pytokens>=0.3.0", - "pytz>=2025.2", - "pyyaml>=6.0.3", - "regex>=2025.11.3", - "requests>=2.32.5", - "setuptools>=80.9.0", - "shellingham>=1.5.4", - "six>=1.17.0", - "smmap>=5.0.2", - "sortedcontainers>=2.4.0", - "stack-data>=0.6.3", - "sympy>=1.14.0", - "tenacity>=9.1.2", - "threadpoolctl>=3.6.0", - "tokenizers>=0.21.4", - "toolz>=1.1.0", - "traitlets>=5.14.3", - "triton>=3.4.0", - "typing-extensions>=4.15.0", - "typing-inspection>=0.4.2", - "tzdata>=2025.3", - "urllib3>=2.6.2", - "wcwidth>=0.2.14", - "widgetsnbextension>=4.0.15", - "xxhash>=3.6.0", - "yarl>=1.22.0", - "zstandard>=0.25.0", - "zstd>=1.5.7.2", ] [dependency-groups] From 22ae0892cbba22f39745c77934dd07640a0dd4d0 Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Mon, 2 Mar 2026 13:39:29 -0800 Subject: [PATCH 08/12] removes most dependency version constraints --- pyproject.toml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cb1862b..9b9f078 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,15 +12,15 @@ dependencies = [ "wandb", "e3nn", "esm>=3.2.3", - "matplotlib>=3.10.8", - "pymol-open-source-whl>=3.1.0.4", - "loguru>=0.7.3", - "numpy>=1.26.4", - "pandas>=2.3.3", - "pillow>=12.0.0", - "scikit-learn>=1.8.0", - "scipy>=1.16.3", - "tqdm>=4.67.1", + "matplotlib", + "pymol-open-source", + "loguru", + "numpy", + "pandas", + "pillow", + "scikit-learn", + "scipy", + "tqdm", ] [dependency-groups] @@ -59,7 +59,7 @@ module = [ ] ignore_missing_imports = true -# PyTorch CUDA 12.6 index (so `torch`/`torchvision` come from the right place) +# PyTorch CUDA 12.6 index [[tool.uv.index]] name = "pytorch-cu126" url = "https://download.pytorch.org/whl/cu126" From 73bd0c1f1ddb43204cc75a56dff5be580645fdcb Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Tue, 3 Mar 2026 19:00:31 -0800 Subject: [PATCH 09/12] reverting dependency changes, as they are covered in PR 45. skip ci. --- pyproject.toml | 207 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 175 insertions(+), 32 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9b9f078..e59121b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,23 +4,187 @@ version = "0.1.0" requires-python = ">=3.12,<3.13" dependencies = [ "torch==2.8.0", + "torchvision", "torch-geometric", "torch-scatter", "torch-cluster", "pyg-lib", "biotite", "wandb", + "networkx", "e3nn", + "biopython", + "matplotlib>=3.10.8", + "pymol-open-source-whl>=3.1.0.4", + "aiohappyeyeballs>=2.6.1", + "aiohttp>=3.13.2", + "aiosignal>=1.4.0", + "annotated-types>=0.7.0", + "antlr4-python3-runtime>=4.9.3", + "anyio>=4.12.1", + "asttokens>=3.0.1", + "atomworks==2.2.0", + "attrs>=25.4.0", + "biopandas>=0.4.1", + "biotraj>=1.2.2", + "black>=25.12.0", + "boto3>=1.42.22", + "botocore>=1.42.22", + "brotli>=1.2.0", + "certifi>=2025.11.12", + "charset-normalizer>=3.4.4", + "click>=8.3.1", + "cloudpathlib>=0.23.0", + "comm>=0.2.3", + "contourpy>=1.3.3", + "coverage>=7.13.0", + "cycler>=0.12.1", + "cython>=3.2.4", + "cytoolz>=0.12.3", + "decorator>=5.2.1", + "dna-features-viewer>=3.1.5", + "einops>=0.8.1", + "einx>=0.3.0", "esm>=3.2.3", - "matplotlib", - "pymol-open-source", - "loguru", - "numpy", - "pandas", - "pillow", - "scikit-learn", - "scipy", - "tqdm", + "execnet>=2.1.2", + "executing>=2.2.1", + "filelock>=3.20.1", + "flake8>=7.3.0", + "fonttools>=4.61.1", + "frozendict>=2.4.7", + "frozenlist>=1.8.0", + "fsspec>=2025.12.0", + "gitdb>=4.0.12", + "gitpython>=3.1.45", + "h11>=0.16.0", + "hf-xet>=1.2.0", + "httpcore>=1.0.9", + "httpx>=0.28.1", + "huggingface-hub>=0.36.0", + "hydra-core>=1.3.2", + "hydride>=1.2.3", + "hypothesis>=6.148.7", + "idna>=3.11", + "iniconfig>=2.3.0", + "ipython>=9.9.0", + "ipython-pygments-lexers>=1.1.1", + "ipywidgets>=8.1.8", + "isort>=7.0.0", + "jedi>=0.19.2", + "jinja2>=3.1.6", + "jmespath>=1.0.1", + "joblib>=1.5.3", + "jupyterlab-widgets>=3.0.16", + "kiwisolver>=1.4.9", + "librt>=0.7.4", + "lightning>=2.6.0", + "lightning-utilities>=0.15.2", + "loguru>=0.7.3", + "looseversion>=1.3.0", + "markdown-it-py>=4.0.0", + "markupsafe>=3.0.3", + "matplotlib-inline>=0.2.1", + "mccabe>=0.7.0", + "mdurl>=0.1.2", + "mmtf-python>=1.1.3", + "mpmath>=1.3.0", + "msgpack>=1.1.2", + "msgpack-numpy>=0.4.8", + "multidict>=6.7.0", + "mypy>=1.19.1", + "mypy-extensions>=1.1.0", + "numpy>=1.26.4", + "nvidia-cublas-cu12>=12.6.4.1", + "nvidia-cuda-cupti-cu12>=12.6.80", + "nvidia-cuda-nvrtc-cu12>=12.6.77", + "nvidia-cuda-runtime-cu12>=12.6.77", + "nvidia-cudnn-cu12>=9.10.2.21", + "nvidia-cufft-cu12>=11.3.0.4", + "nvidia-cufile-cu12>=1.11.1.6", + "nvidia-curand-cu12>=10.3.7.77", + "nvidia-cusolver-cu12>=11.7.1.2", + "nvidia-cusparse-cu12>=12.5.4.2", + "nvidia-cusparselt-cu12>=0.7.1", + "nvidia-nccl-cu12>=2.27.3", + "nvidia-nvjitlink-cu12>=12.6.85", + "nvidia-nvshmem-cu12>=3.5.19", + "nvidia-nvtx-cu12>=12.6.77", + "omegaconf>=2.3.0", + "opt-einsum>=3.4.0", + "opt-einsum-fx>=0.1.4", + "packaging>=25.0", + "pandas>=2.3.3", + "parso>=0.8.5", + "pathspec>=0.12.1", + "pexpect>=4.9.0", + "pillow>=12.0.0", + "platformdirs>=4.5.1", + "pluggy>=1.6.0", + "prompt-toolkit>=3.0.52", + "propcache>=0.4.1", + "protobuf>=6.33.2", + "psutil>=7.1.3", + "ptyprocess>=0.7.0", + "pure-eval>=0.2.3", + "py3dmol>=2.5.3", + "pyarrow>=17.0.0", + "pycodestyle>=2.14.0", + "pydantic>=2.12.5", + "pydantic-core>=2.41.5", + "pydssp>=0.9.1", + "pyflakes>=3.4.0", + "pygments>=2.19.2", + "pygtrie>=2.5.0", + "pymol-remote>=1.1.0", + "pyparsing>=3.2.5", + "pytest>=9.0.2", + "pytest-cov>=7.0.0", + "pytest-mock>=3.15.1", + "pytest-timeout>=2.4.0", + "pytest-xdist>=3.8.0", + "python-dateutil>=2.9.0.post0", + "pytokens>=0.3.0", + "pytorch-lightning>=2.6.0", + "pytz>=2025.2", + "pyyaml>=6.0.3", + "rdkit>=2025.3.6", + "regex>=2025.11.3", + "requests>=2.32.5", + "rich>=14.2.0", + "s3transfer>=0.16.0", + "safetensors>=0.7.0", + "scikit-learn>=1.8.0", + "scipy>=1.16.3", + "sentry-sdk>=2.48.0", + "setuptools>=80.9.0", + "shellingham>=1.5.4", + "six>=1.17.0", + "smmap>=5.0.2", + "sortedcontainers>=2.4.0", + "stack-data>=0.6.3", + "sympy>=1.14.0", + "tenacity>=9.1.2", + "threadpoolctl>=3.6.0", + "tokenizers>=0.21.4", + "toolz>=1.1.0", + "torch-runstats>=0.2.0", + "torchmetrics>=1.8.2", + "torchtext>=0.18.0", + "tqdm>=4.67.1", + "traitlets>=5.14.3", + "transformers>=4.48.1", + "triton>=3.4.0", + "typer>=0.21.1", + "typing-extensions>=4.15.0", + "typing-inspection>=0.4.2", + "tzdata>=2025.3", + "urllib3>=2.6.2", + "wcwidth>=0.2.14", + "widgetsnbextension>=4.0.15", + "xxhash>=3.6.0", + "yarl>=1.22.0", + "zstandard>=0.25.0", + "zstd>=1.5.7.2", ] [dependency-groups] @@ -30,36 +194,14 @@ dev = [ "hypothesis>=6.70.0", "isort>=5.12.0", "mypy>=1.0.0", - "pandas-stubs>=2.0.0", "pytest>=7.0.0", "pytest-cov>=4.0.0", "pytest-mock>=3.10.0", "pytest-timeout>=2.1.0", "pytest-xdist>=3.0.0", - "types-tqdm>=4.0.0", ] -[tool.mypy] -python_version = "3.12" -warn_return_any = true -warn_unused_ignores = true -ignore_missing_imports = false - -[[tool.mypy.overrides]] -module = [ - "scipy.*", - "sklearn.*", - "biotite.*", - "e3nn.*", - "torch_geometric.*", - "torch_cluster.*", - "torch_scatter.*", - "pymol2.*", - "esm.*", -] -ignore_missing_imports = true - -# PyTorch CUDA 12.6 index +# PyTorch CUDA 12.6 index (so `torch`/`torchvision` come from the right place) [[tool.uv.index]] name = "pytorch-cu126" url = "https://download.pytorch.org/whl/cu126" @@ -74,6 +216,7 @@ explicit = true [tool.uv.sources] torch = { index = "pytorch-cu126" } +torchvision = { index = "pytorch-cu126" } torch-scatter = { index = "pyg-cu126" } torch-cluster = { index = "pyg-cu126" } From 88d333e05f48f97f10b62f848c1c8d9ee6d080b9 Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Thu, 5 Mar 2026 13:48:19 -0800 Subject: [PATCH 10/12] added test coverage to build workflow, and changed mypy to ty. --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 7 ++++--- .pre-commit-config.yaml | 9 ++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e947849..43c1283 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,4 +36,4 @@ jobs: - name: Run tests env: TEST_DATA_DIR: ${{ github.workspace }}/tests/test_files - run: uv run pytest + run: uv run pytest tests/ --cov=src --cov-report=html --cov-report=term-missing --cov-fail-under=80 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ad487de..ff1e8aa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,7 +33,7 @@ jobs: commit_username: "Autoformatter" commit_email: "Autoformatter " - mypy: + ty: runs-on: ubuntu-latest steps: @@ -48,5 +48,6 @@ jobs: - name: Install dependencies run: uv sync --group dev - - name: Run mypy - run: uv run mypy src/ + - name: Run ty + # Use uv if replacing mypy with ty in dev dependency group + run: uvx ty check src/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 914db6c..e4c15a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,10 @@ repos: - id: ruff-format args: [--verbose] - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.19.1 + - repo: local hooks: - - id: mypy \ No newline at end of file + - id: ty + name: ty check + # Use uv if replacing mypy with ty in dev dependency group + entry: uvx ty check + language: python \ No newline at end of file From 7d223553d025ec5c3bbcd0e60f92f1ee119401ae Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Mon, 9 Mar 2026 11:11:05 -0700 Subject: [PATCH 11/12] keeping build workflow as manual trigger for now --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43c1283..9e713eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ name: Build on: - push: - branches: [main] - pull_request: - branches: [main] + # push: + # branches: [main] + # pull_request: + # branches: [main] workflow_dispatch: jobs: @@ -14,8 +14,8 @@ jobs: matrix: python-version: [3.12] - # Skip CI if 'skip ci' is in the latest commit message - if: "!contains(github.event.head_commit.message, 'skip ci')" + # Skip CI if 'skip ci' is in the latest commit message (only relevant for push/pull_request triggers) + # if: "!contains(github.event.head_commit.message, 'skip ci')" # Will add back on skipping for draft PRs too. # if: | # !contains(github.event.head_commit.message, 'skip ci') && From 9c83b99118ec7a479ba8eef5b9806bbf54a406bd Mon Sep 17 00:00:00 2001 From: Doris Mai Date: Tue, 10 Mar 2026 00:14:32 +0000 Subject: [PATCH 12/12] fixes ruff/ty set up --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 16 ++++------------ .pre-commit-config.yaml | 6 +++--- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e713eb..4fc5448 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: uses: astral-sh/setup-uv@v7 with: version: "0.10.6" - python: ${{ matrix.python-version }} + python-version: ${{ matrix.python-version }} - name: Install dependencies run: uv sync --group dev diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ff1e8aa..d08821d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,10 +1,9 @@ name: Lint on: - push: - branches: [main] - pull_request: - branches: [main] + # pull_request: + # branches: [main] + workflow_dispatch: jobs: ruff: @@ -31,7 +30,7 @@ jobs: with: commit_message: "Auto-commit ruff fixes [skip ci]" commit_username: "Autoformatter" - commit_email: "Autoformatter " + commit_email: "actions@github.com" ty: runs-on: ubuntu-latest @@ -41,13 +40,6 @@ jobs: - name: Setup UV and python version uses: astral-sh/setup-uv@v7 - with: - version: "0.10.6" - python: "3.12" - - - name: Install dependencies - run: uv sync --group dev - name: Run ty - # Use uv if replacing mypy with ty in dev dependency group run: uvx ty check src/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4c15a3..65fd394 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,6 @@ repos: hooks: - id: ty name: ty check - # Use uv if replacing mypy with ty in dev dependency group - entry: uvx ty check - language: python \ No newline at end of file + entry: uv run ty check + language: system + types: [python] \ No newline at end of file