-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add [all] extras to install all extra dependencies #7610
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, please avoid mixing blackening with "real" changes? The noise makes reviewing the substantive bits hard. Either split the blacken bit out into a separate commit, or else a separate PR.
else: | ||
all_extras.extend(extras[extra]) | ||
|
||
extras["all"] = all_extras |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just normalize the extras above to always be lists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fear if we miss one, then we end up with a bad dependency list.
>>> l = []
>>> l.extend("Uh, oh!")
>>> l
['U', 'h', ',', ' ', 'o', 'h', '!']
That means we still would need a check for string type or something else to validate they are all lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't what I was thinking with that comment. This is why we have tests. I assume by using the [all] extra in the nox session, we'd catch such errors. I'll simplify this on Monday as you suggest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 17e65d7.
Good point re: blackening separately. Sent #7619 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted the blacken changes.
else: | ||
all_extras.extend(extras[extra]) | ||
|
||
extras["all"] = all_extras |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fear if we miss one, then we end up with a bad dependency list.
>>> l = []
>>> l.extend("Uh, oh!")
>>> l
['U', 'h', ',', ' ', 'o', 'h', '!']
That means we still would need a check for string type or something else to validate they are all lists.
An [all] extra will be useful for convenience to get all the "bonus" features like progress bars, pandas integration, and BigQuery Storage API integration. It also simplifies the noxfile a bit, since the list of extras installed in each session was getting long, especially after using the bqstorage extra instead of in LOCAL_DEPS.
* Add [all] extras to install all extra dependencies An [all] extra will be useful for convenience to get all the "bonus" features like progress bars, pandas integration, and BigQuery Storage API integration. It also simplifies the noxfile a bit, since the list of extras installed in each session was getting long, especially after using the bqstorage extra instead of in LOCAL_DEPS. * Need fastavro to actually read rows from bqstorage. * Blacken * Use lists for all extras.
An [all] extra will be useful for convenience to get all the "bonus"
features like progress bars, pandas integration, and BigQuery Storage
API integration.
I also blacken the setup.py file and simplify the noxfile by using this
new [all] extra.
This is a pattern I've seen in other projects that have a lot of "extras", such as Apache Airflow (though they have a lot more the
google-cloud-bigquery
).https://github.com/apache/airflow/blob/6cb735c6d301a5689ff9666349abdb6387abc7a1/setup.py#L335