Skip to content

[DEV-11651] Reduce base install size by making Msgpack, Numpy, and Pandas optional dependencies#314

Merged
mawelborn merged 4 commits into
masterfrom
mawelborn/optional-dependencies
Dec 9, 2024
Merged

[DEV-11651] Reduce base install size by making Msgpack, Numpy, and Pandas optional dependencies#314
mawelborn merged 4 commits into
masterfrom
mawelborn/optional-dependencies

Conversation

@mawelborn
Copy link
Copy Markdown

Summary

Make large dependencies like Numpy and Pandas optional to reduce the base install size of the client. These are required by only a handful of uncommon calls, yet represent 75% of the install size. This will better support customers who use the client in AWS Lambdas where they're limited to 250Mb.

[michael@macbook indico-client-python]$ du -hd 1 . | grep venv
 37M    ./venv-base
146M    ./venv-all

Changelog

  • Removed pillow as it appears to be unneeded.
  • Made msgpack and numpy optional as they are only used for specific deserialization functions.
    • Available via the indico-client[deserialization] or indico-client[all] extras.
  • Made pandas optional as it is only used for creating image datasets and retrieving exports.
    • Available via the indico-client[datasets], indico-client[exports], or indico-client[all] extras.
    • Pandas could be dropped entirely if CreateDataset manipulated CSVs with the native csv module and DownloadExport returned a CSV string instead of a dataframe.
  • Added instructional errors when functionality is used that requires optional dependencies that are not installed.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • Jira story/task is put into PR title
  • Code has been self-reviewed
  • Hard-to-understand areas have been commented
  • Documentation has been updated
  • My changes generate no new warnings
  • Unit tests have been added for base functionality and known edge cases
  • Any dependent changes have been merged and published in downstream modules

@mawelborn mawelborn requested a review from a team as a code owner June 26, 2024 19:16
@mawelborn mawelborn changed the title [CAT-907] Reduce base install size by making Msgpack, Numpy, and Pandas optional dependencies [DEV-11651] Reduce base install size by making Msgpack, Numpy, and Pandas optional dependencies Jun 27, 2024
@goatrocks goatrocks mentioned this pull request Jul 11, 2024
11 tasks
@mawelborn mawelborn merged commit 54fccb6 into master Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants