DataChefHQ / damavand

Damavand is an opinionated cloud-agnostic pythonic implementation of ARC (Application Resource Controller) pattern for developing cloud-native applications with best practices.
Mozilla Public License 2.0
3 stars 0 forks source link

Optimizing the Package Size #15

Open kkiani opened 1 month ago

kkiani commented 1 month ago

Description:

To reduce the package size for users, we need to optimize dependency management. Currently, all dependencies are installed regardless of use case, which can unnecessarily bloat the package. For example, if a user is developing a Flask application with Damavand, they don’t need to install PySpark, which is used for Sparkle applications.

Proposed Solution:

Implement optional dependencies in the setup using pip’s extras feature (e.g., pip install damavand[Sparkle]). Allow users to install only the necessary dependencies based on their specific use case, such as Sparkle for PySpark applications or Flask for web applications.

Tasks:

Acceptance Criteria:

kkiani commented 1 month ago

PDM optional dependencies should address this needs. For example to make sparkle an optional depenedency:

# first remove sparkle and pyspark from main dependencies
pdm remove pyspark
pdm remove sparkle

# add sparkle as optional dependency
pdm add -G spark "git+https://github.com/DataChefHQ/sparkle.git"

However, the CI/CD needs to be updated to install all optional dependencies.