video-generation 0.1.0
A package for video generation tasks
Requires Python: >=3.10

Below is the detailed information that provides instructions for creating a Python package (.whl) for the omni_video_studio backend project.

# Building and packaging the video_generation backend into python package
This document provides step-by-step instructions for creating a distributable Python package (.whl) for your backend.

## Project Structure
Ensure your project has the following structure:

```
video_generation/
â”‚
â”œâ”€â”€ LICENSE
â”œâ”€â”€ setup.py
â”œâ”€â”€ requirements.txt (if needed)
â”‚
â”œâ”€â”€ video_generation/
â”‚   â”œâ”€â”€ __init__.py
â”‚   â”œâ”€â”€ utils.pyx    # Updated extension for Cython
```

## File Descriptions
- `LICENSE`: Contains the license information for your project.
- `setup.py`: Contains metadata and configuration for building the package.
- `init.py`: Specifies the public interface of the video_generation module.
- `utils.pyx`: Rename Python source files you want to compile (e.g., utils.py) to .pyx files. Contains all backend functions(helper as well).

## Step-by-Step Instructions
**1. Verify Your Environment**
- Ensure you have Python 3.10 and pip installed.
- Check Python version:
  ```
  python --version
  ```
**2. Install Required Tools**
- Install the latest versions of setuptools and wheel:
  ```
  pip install --upgrade setuptools wheel cython
  ```
**3. Prepare setup.py**
- Update setup.py with the necessary metadata. Below is an example:
  ```
  from setuptools import setup, Extension, find_packages
  from Cython.Build import cythonize
  # Define the extensions
  extensions = [
    Extension("video_generation.utils", ["video_generation/utils.pyx"]),
  ]
  
  setup(
      name="video_generation",        # Package name
      version="0.1.0",                # Version
      ext_modules=cythonie(extensions),
      packages=find_packages(),       # Automatically find sub-packages
      install_requires=[              # Dependencies
          "fastapi==0.115.6",
          "python-dotenv==1.0.1",
          "celery==5.4.0",
          "spaces>=0.29.3",
          "safetensors>=0.4.5",
          "spandrel>=0.4.0",
          "tqdm>=4.66.5",
          "scikit-video>=1.1.11",
          "diffusers>=0.31.0",
          "transformers>=4.44.0",
          "accelerate>=0.34.2",
          "opencv-python>=4.10.0.84",
          "sentencepiece>=0.2.0",
          "sentencepiece>=0.2.0",
          "numpy==1.26.0",
          "SwissArmyTransformer>=0.4.12",
          "gradio>=5.4.0",
          "imageio>=2.35.1",
          "imageio-ffmpeg>=0.5.1",
          "openai>=1.54.0",
          "moviepy>=1.0.3",
          "pillow==9.5.0",
          "pyngrok==7.2.1",
          "moviepy==2.0.0.dev2",
          "numpy==1.26.0",
          # Add other dependencies here
      ],
      entry_points={
          "console_scripts": [
              "video_generation=video_generation.api:app",  # CLI (Optional)
          ],
      },
      author="Shivam Kumar",
      author_email="shivam@omnineura.ai",
      description="A package for video generation tasks",
      long_description=open("README.md").read(),
      long_description_content_type="text/markdown",
      url="https://github.com/yourusername/video_generation",  # GitHub link
      classifiers=[
          "Programming Language :: Python :: 3.10",
          "License :",
          "Operating System :: OS Independent",
      ],
      python_requires=">=3.10",  # Specify Python version compatibility
  )
  ```
**4. Build the Package**
- Run the following command in the root directory (where setup.py is located):
  ```
  python setup.py build_ext --inplace  # Builds the Cython files
  ```
  ```
  python setup.py sdist bdist_wheel    # Creates distributable packages
  ```
This will generate the package files(.whl,.tgz) in the dist/ directory.

**5. Install the Package Locally (Optional)**
- You can install the package locally to test it:
  ```
  pip install dist/video_generation-0.1.0-py3-none-any.whl
  ```