GeezerVison is showing github.com — Packaging: "Guard" calls to `setuptools.setup()` behind `if __name__ == '__main__'` · Issue #4295 · googleapis/google-cloud-python
Packaging: "Guard" calls to setuptools.setup() behind if __name__ == '__main__' #4295
Description
This way our setup.py files could be imported (for example).
This is low-priority, but an easy change to make.
Activity
tseaver commented on Nov 1, 2017
I'm a pretty big -1 on the idea that setup.py should ever be importable.
dhermes commented on Nov 1, 2017
ContributorAuthor
More actions
@tseaver I don't actually mind if it's import-able, but that was just an example. It's more just like good hygiene to have if __name__ == '__main__' in all scripts.
duggelz commented on Nov 1, 2017
+1 on __main__ hygiene across the board.
added
priority: p2Moderately-important priority. Fix may not be included in next release. and removed
priority: p2Moderately-important priority. Fix may not be included in next release. on Nov 2, 2017changed the title
[-]"Guard" calls to `setuptools.setup()` behind `if __name__ == '__main__'`[/-] [+]Packaging: "Guard" calls to `setuptools.setup()` behind `if __name__ == '__main__'`[/+] on Nov 3, 2017theacodes commented on Feb 2, 2018
setup.py, like nox.py, is a configuration file for a specific tool. We should not treat it as a Python module.
Metadata
Metadata
Development
No branches or pull requestsIssue actions