From bdc7dd30a656021407ca59c787c9ed3b8d04da9f Mon Sep 17 00:00:00 2001 From: lucidrains Date: Wed, 1 Oct 2025 07:18:18 -0700 Subject: [PATCH] scaffold --- .github/workflows/python-publish.yml | 36 +++++++++++++++++ .github/workflows/test.yml | 21 ++++++++++ dreamer4/__init__.py | 0 dreamer4/dreamer4.py | 0 pyproject.toml | 60 ++++++++++++++++++++++++++++ tests/test_dreamer.py | 3 ++ 6 files changed, 120 insertions(+) create mode 100644 .github/workflows/python-publish.yml create mode 100644 .github/workflows/test.yml create mode 100644 dreamer4/__init__.py create mode 100644 dreamer4/dreamer4.py create mode 100644 pyproject.toml create mode 100644 tests/test_dreamer.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..3bfabfc --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,36 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d97c9fb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: Pytest +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e .[test] + - name: Test with pytest + run: | + python -m pytest tests/ diff --git a/dreamer4/__init__.py b/dreamer4/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dreamer4/dreamer4.py b/dreamer4/dreamer4.py new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a82c3cd --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,60 @@ +[project] +name = "dreamer4" +version = "0.0.1" +description = "Dreamer 4" +authors = [ + { name = "Phil Wang", email = "lucidrains@gmail.com" } +] +readme = "README.md" +requires-python = ">= 3.9" +license = { file = "LICENSE" } +keywords = [ + 'artificial intelligence', + 'deep learning', + 'transformer', + 'attention mechanism', + 'model-based reinforcement learning', + 'world models' +] + +classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3.9', +] + +dependencies = [ + "einops>=0.8.1", + "torch>=2.4" +] + +[project.urls] +Homepage = "https://pypi.org/project/dreamer4/" +Repository = "https://github.com/lucidrains/dreamer4" + +[project.optional-dependencies] +examples = [] +test = [ + "pytest" +] + +[tool.pytest.ini_options] +pythonpath = [ + "." +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.rye] +managed = true +dev-dependencies = [] + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["dreamer4"] diff --git a/tests/test_dreamer.py b/tests/test_dreamer.py new file mode 100644 index 0000000..f365e9c --- /dev/null +++ b/tests/test_dreamer.py @@ -0,0 +1,3 @@ + +def test_dreamer(): + assert True