diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..6de587d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + # GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: ⬆️ + # Python + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: ⬆️ diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml new file mode 100644 index 0000000..451d582 --- /dev/null +++ b/.github/workflows/publish-test.yml @@ -0,0 +1,44 @@ +name: Multimodal Maestro Test Releases to PyPi +on: + push: + tags: + - '[0-9]+.[0-9]+[0-9]+.[0-9]+a[0-9]' + - '[0-9]+.[0-9]+[0-9]+.[0-9]+b[0-9]' + - '[0-9]+.[0-9]+[0-9]+.[0-9]+rc[0-9]' + + workflow_dispatch: + +jobs: + build-n-publish: + name: Build and publish to PyPI + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10"] + steps: + - name: 🛎️ Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: 🐍 Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: 🏗️ Build source and wheel distributions + run: | + python -m pip install --upgrade build twine + python -m build + twine check --strict dist/* + - name: 🚀 Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: ${{ secrets.PYPI_USERNAME }} + password: ${{ secrets.PYPI_PASSWORD }} + - name: 🚀 Publish to Test-PyPi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + user: ${{ secrets.PYPI_TEST_USERNAME }} + password: ${{ secrets.PYPI_TEST_PASSWORD }} + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4d74d52 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +name: Multimodal Maestro Releases to PyPi +on: + push: + tags: + - '[0-9]+.[0-9]+[0-9]+.[0-9]' + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10"] + steps: + - name: 🛎️ Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: 🐍 Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: 🏗️ Build source and wheel distributions + run: | + python -m pip install --upgrade build twine + python -m build + twine check --strict dist/* + - name: 🚀 Publish to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: ${{ secrets.PYPI_USERNAME }} + password: ${{ secrets.PYPI_PASSWORD }} + - name: 🚀 Publish to Test-PyPi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + user: ${{ secrets.PYPI_TEST_USERNAME }} + password: ${{ secrets.PYPI_TEST_PASSWORD }} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..47f55ec --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "maestro" +version = "0.2.0rc3" +description = "Visual Prompting for Large Multimodal Models (LMMs)" +readme = "README.md" +authors = [ + {name = "Roboflow", email = "help@roboflow.com"} +] +license = {text = "Apache-2.0"} +requires-python = ">=3.9,<3.13" +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: Apache Software License", + "Topic :: Software Development", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Typing :: Typed", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS" +] + +dependencies = [ + "supervision~=0.24.0rc1", + "requests>=2.31.0,<=2.32.3", + "transformers~=4.44.2", + "torch~=2.4.0", + "accelerate~=0.33.0", + "sentencepiece~=0.2.0", + "peft~=0.12.0", + "flash-attn~=2.6.3; sys_platform != 'darwin'", + "einops~=0.8.0", + "timm~=1.0.9", + "typer~=0.12.5" +] + +[project.urls] +homepage = "https://github.com/roboflow/multimodal-maestro" + +[project.optional-dependencies] +docs = [ + "mkdocs-material~=9.5.33", + "mkdocstrings[python]>=0.20.0,<0.25.2" +] +dev = [ + "pytest~=8.3.2", + "black~=24.8.0", + "pre-commit~=3.8.0", + "mypy~=1.11.2", + "flake8~=7.1.1" +] + +[project.scripts] +maestro = "maestro.cli.main:app" + +[tool.setuptools.packages.find] +where = ["."] +exclude = ["cookbooks", "docs", "tests", "tests.*", "requirements"] diff --git a/requirements/requirements.docs.txt b/requirements/requirements.docs.txt deleted file mode 100644 index 877109e..0000000 --- a/requirements/requirements.docs.txt +++ /dev/null @@ -1,2 +0,0 @@ -mkdocs-material~=9.5.33 -mkdocstrings[python]>=0.20.0,<0.25.2 diff --git a/requirements/requirements.test.txt b/requirements/requirements.test.txt deleted file mode 100644 index 615272d..0000000 --- a/requirements/requirements.test.txt +++ /dev/null @@ -1,5 +0,0 @@ -pytest~=8.3.2 -black~=24.8.0 -pre-commit~=3.8.0 -mypy~=1.11.2 -flake8~=7.1.1 diff --git a/requirements/requirements.txt b/requirements/requirements.txt deleted file mode 100644 index e06e303..0000000 --- a/requirements/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -supervision~=0.24.0rc1 -requests>=2.31.0,<=2.32.3 -transformers~=4.44.2 -torch~=2.4.0 -accelerate~=0.33.0 -sentencepiece~=0.2.0 -peft~=0.12.0 -flash-attn~=2.6.3 # does not work on mac -einops~=0.8.0 -timm~=1.0.9 -typer~=0.12.5 diff --git a/setup.py b/setup.py deleted file mode 100644 index 740882d..0000000 --- a/setup.py +++ /dev/null @@ -1,71 +0,0 @@ -from typing import List, Union - -import setuptools -from setuptools import find_packages - - -with open("README.md", "r") as fh: - long_description = fh.read() - - -def read_requirements(path: Union[str, List[str]]) -> List[str]: - if not isinstance(path, list): - path = [path] - requirements = [] - for p in path: - with open(p) as fh: - requirements.extend([line.strip() for line in fh]) - return requirements - - -setuptools.setup( - name="maestro", - version="0.2.0rc3", - author="Roboflow", - author_email="help@roboflow.com", - description="Visual Prompting for Large Multimodal Models (LMMs)", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/roboflow/multimodal-maestro", - packages=find_packages( - where=".", - exclude=( - "cookbooks", - "docs", - "tests", - "tests.*", - "requirements", - ), - ), - install_requires=read_requirements("requirements/requirements.txt"), - extras_require={ - "dev": read_requirements("requirements/requirements.test.txt"), - "docs": read_requirements("requirements/requirements.docs.txt"), - }, - entry_points={ - "console_scripts": [ - "maestro=maestro.cli.main:app", - ], - }, - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Software Development", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Typing :: Typed", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", - "Operating System :: MacOS", - ], - python_requires=">=3.9,<3.13", -)