Skip to content

Mark several dependencies as optional#1849

Merged
gdlg merged 3 commits intodevelopfrom
gppayend/dep2
Aug 29, 2025
Merged

Mark several dependencies as optional#1849
gdlg merged 3 commits intodevelopfrom
gppayend/dep2

Conversation

@gdlg
Copy link
Copy Markdown
Contributor

@gdlg gdlg commented Aug 27, 2025

This pull request refactors how optional dependencies are managed in the project, moving many previously core requirements to extras and updating import patterns to avoid unnecessary dependencies. These changes make the installation process more flexible and reduce the risk of installing unused packages, especially for CLI, tabular, visualization, and file format support. Imports for optional packages are now performed only when needed, and the test configuration is updated to reflect the new extras.

Dependency management improvements:

  • Moved several packages (h5py, matplotlib, nibabel, scipy, requests, tokenizers, protobuf, tabulate, nltk, portalocker, tensorboardX) from requirements-core.txt to optional extras in setup.py, reducing the default dependency footprint. [1] [2] [3]
  • Updated setup.py to define new extras for various features (e.g., cli, visualizer, h5py, nibabel, protobuf, tabulate, nlp, scipy) and grouped dependencies by functionality.

Codebase import refactoring:

  • Changed imports of optional dependencies (tabulate, nltk.corpus.stopwords, and DistanceCompareVisualizer) to be performed only at the point of use, preventing import errors when extras are not installed. [1] [2] [3] [4] [5] [6]

Testing configuration updates:

  • Updated tox.ini to install the new extras for relevant test environments, ensuring tests run with the appropriate optional dependencies.

Summary

How to test

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added the description of my changes into CHANGELOG.​
  • I have updated the documentation accordingly

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2025 Intel Corporation
#
# SPDX-License-Identifier: MIT

gdlg added 2 commits August 27, 2025 13:27
Signed-off-by: Grégoire Payen de La Garanderie <gregoire.payen.de.la.garanderie@intel.com>
Signed-off-by: Grégoire Payen de La Garanderie <gregoire.payen.de.la.garanderie@intel.com>
@gdlg gdlg requested a review from AlbertvanHouten August 27, 2025 13:08
@gdlg gdlg merged commit 143aee2 into develop Aug 29, 2025
16 checks passed
@gdlg gdlg deleted the gppayend/dep2 branch September 25, 2025 11:43
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.

2 participants