When adding or updating dependencies for AI/ML libraries in your project, follow these two key practices:
# Too restrictive
dependencies = ["huggingface_hub>=0.16.4,<0.17"]
# Better approach - allows minor version updates
dependencies = ["huggingface_hub>=0.16.4,<0.18"]
# Potentially too permissive for rapidly evolving AI libraries
dependencies = ["huggingface_hub>=0.16.4,<1.0"]
# Better approach with optional flag
arrow = { git = "https://github.com/apache/arrow-rs", branch = "master", features = [
"pyarrow",
], optional=True }
This approach reduces unnecessary dependencies for users who don’t need all ML features and provides flexibility in environments with compatibility constraints.
Enter the URL of a public GitHub repository