Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/pytest_and_autopublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Unittests & Auto-publish

# Allow to trigger the workflow manually (e.g. when deps changes)
on: [push, workflow_dispatch]

jobs:
pytest-job:
runs-on: ubuntu-latest
timeout-minutes: 30

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4

# Install deps
- uses: actions/setup-python@v5
with:
python-version: "3.10"
# Uncomment to cache of pip dependencies (if tests too slow)
# cache: pip
# cache-dependency-path: '**/pyproject.toml'

- run: pip --version
- run: pip install -e .[dev]
- run: pip freeze

# Run tests (in parallel)
- name: Run core tests
run: pytest -vv -n auto

# Auto-publish when version is increased
publish-job:
# Only try to publish if:
# * Repo is self (prevents running from forks)
# * Branch is `main`
if: |
github.repository == 'google/hackable_diffusion'
&& github.ref == 'refs/heads/main'
needs: pytest-job # Only publish after tests are successful
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 30

steps:
# Publish the package (if local `__version__` > pip version)
- uses: etils-actions/pypi-auto-publish@v1
with:
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
parse-changelog: true
78 changes: 78 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[project]
name = "hackable_diffusion"
description = "A modular toolbox to facilitate diffusion modeling."
readme = "README.md"
requires-python = ">=3.10"
license = {file = "LICENSE"}
authors = [{name = "hackable_diffusion authors", email="gdm-flows@google.com"}]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Science/Research",
]
keywords = ["diffusion", "jax", "flax", "kauldron"]

dynamic = ["version"]

dependencies = [
"absl-py>=2.3.1",
"aiofiles>=25.1.0",
"chex>=0.1.91",
"einops>=0.8.1",
"etils>=1.13.0",
"flax>=0.12.0",
"fsspec>=2025.9.0",
"humanize>=4.14.0",
"immutabledict>=4.2.2",
"importlib_resources>=6.5.2",
"jax>=0.8.0",
"jaxlib>=0.8.0",
"jaxtyping>=0.3.3",
"markdown-it-py>=4.0.0",
"mdurl>=0.1.2",
"ml_dtypes>=0.5.3",
"mock>=5.2.0",
"msgpack>=1.1.2",
"nest-asyncio>=1.6.0",
"numpy>=2.3.4",
"opt_einsum>=3.4.0",
"optax>=0.2.6",
"orbax-checkpoint>=0.11.26",
"protobuf>=6.33.0",
"psutil>=7.1.2",
"Pygments>=2.19.2",
"PyYAML>=6.0.3",
"rich>=14.2.0",
"scipy>=1.16.2",
"simplejson>=3.20.2",
"tensorstore>=0.1.78",
"toolz>=1.1.0",
"treescope>=0.1.10",
"typeguard>=4.4.4",
"typing_extensions>=4.15.0",
"wadler_lindig>=0.1.7",
"zipp>=3.23.0",
"kauldron>=1.4.0",
]

[project.optional-dependencies]
dev = [
"pytest",
"pytest-xdist",
"pylint>=2.6.0",
"pyink",
]

[tool.pyink]
line-length = 80
unstable = true
pyink-indentation = 2
pyink-use-majority-quotes = true

[build-system]
requires = ["flit_core >=3.8,<4"]
build-backend = "flit_core.buildapi"

[tool.flit.sdist]
exclude = [
"**/*_test.py",
]
38 changes: 0 additions & 38 deletions requirements.txt

This file was deleted.

Loading