Skip to content

Instantly share code, notes, and snippets.

@garettmd
Last active March 9, 2017 15:55
Show Gist options
  • Save garettmd/bd00bab4696ab9a4155519536263e6c4 to your computer and use it in GitHub Desktop.
Save garettmd/bd00bab4696ab9a4155519536263e6c4 to your computer and use it in GitHub Desktop.
Click setup.py snippet for VSCode (and probably other editors)
"click setup": {
"prefix": "click",
"body": [
"from setuptools import setup",
"",
"setup(",
"\tname='<app name>',",
"\tversion='<version #>',",
"\tpy_modules=['<yourscript>'],",
"\tinstall_requires=[",
"\t\t'click',",
"\t],",
"\tentry_points='''",
"\t\t[console_scripts]",
"\t\t<yourscript>=<yourscript>:cli",
"\t'''",
")"
]
}
@garettmd
Copy link
Author

garettmd commented Mar 9, 2017

Use this snippet in your setup.py file when creating a new app with the click CLI framework

This goes in the python.json file in VSCode. Get to it using Cmd+Shift+P, type snippet, choose "Snippets: Open User Snippets", then choose Python. Use the snippet by typing click (usually it will popup by the time you type cli) and when the Intellisense prompt comes up, hit tab.

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment