diff --git a/.gitignore b/.gitignore index b6ae075..1ba1595 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ TGTest-* devtools/tests/data/ dist/ build/ +\#*\# +.\#* \ No newline at end of file diff --git a/devtools/gearbox/quickstart/command.py b/devtools/gearbox/quickstart/command.py index 9b29435..7400812 100644 --- a/devtools/gearbox/quickstart/command.py +++ b/devtools/gearbox/quickstart/command.py @@ -6,6 +6,7 @@ import shutil import sys import glob +from subprocess import Popen from gearbox.template import GearBoxTemplate from gearbox.command import Command @@ -115,6 +116,22 @@ def get_parser(self, prog_name): help="Disables Kajiki default templates", action="store_true", dest="skip_default_tmpl", default=False) + parser.add_argument( + "--enable-git", + help="Enables git support: place .gitignore does `git init` and `git add .`", + action="store_true", + dest="git", + default=False, + ) + + parser.add_argument( + "--enable-mercurial", + help="Enables hg support: place .hgignore does `hg init` and `hg add`", + action="store_true", + dest="hg", + default=False, + ) + parser.add_argument("--minimal-quickstart", help="Throw away example boilerplate from quickstart project", action="store_true", dest="minimal_quickstart", default=False) @@ -276,3 +293,14 @@ def overwrite_templates(template_type): # remove existing migrations directory package_migrations_dir = os.path.abspath('migration') shutil.rmtree(package_migrations_dir, ignore_errors=True) + + for vcs in ('hg', 'git'): + if opts.__getattribute__(vcs): + print('Enabling %s support' % vcs) + Popen([vcs, 'init']).wait() + Popen([vcs, 'add', '.']).wait() + print('remember to do:') + print('cd %s && %s commit -m "gearbox quickstarted"' % (opts.name, vcs)) + else: + vcs_ignore = '.hgignore' if vcs == 'hg' else '.gitignore' + os.remove(vcs_ignore) diff --git a/devtools/gearbox/quickstart/template/+dot+coveragerc_tmpl b/devtools/gearbox/quickstart/template/+dot+coveragerc_tmpl new file mode 100644 index 0000000..8479197 --- /dev/null +++ b/devtools/gearbox/quickstart/template/+dot+coveragerc_tmpl @@ -0,0 +1,16 @@ +# refer to https://coverage.readthedocs.io/en/latest/config.html +[run] +source = {{package}} + +[report] +show_missing = True + +# if you don't omit tests directory you have more chances of seeing two tests with same name +# omit = tests/* + +# fail test suite if coverage drops below 100% (if you uncomment it) +# this does not work for nosetests, set it in setup.cfg +# fail_under = 100 + +# Don’t include files in the report that are 100% covered files +skip_covered = True \ No newline at end of file diff --git a/devtools/gearbox/quickstart/template/+dot+gitignore_tmpl b/devtools/gearbox/quickstart/template/+dot+gitignore_tmpl new file mode 100644 index 0000000..92935ed --- /dev/null +++ b/devtools/gearbox/quickstart/template/+dot+gitignore_tmpl @@ -0,0 +1,71 @@ +# Turbogears files +devdata.db + +# tgext.webassets (if plugged) +.webassets-cache + +# depot (if used) +{{project}}/depot + +# python files +__pycache__/ +*.egg-info/ +*.py[cod] +.env +.venv +env/ +venv/ + +# tests +.coverage +.coverage.* +coverage.xml +cover/ +htmlcov/ +.pytest_cache/ +.tox/ +geckodriver.log + + +# i18n Translations +*.mo +*.pot + + +### editors, ide + +# emacs files +\#*\# +.\#* +*_flymake.* +flycheck_*.el +.dir-locals.el + +# intellij +.idea + +# vscode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace +.history/ + + +### other tools + +# vagrant files +.vagrant/ +*.log + +# ansible files +*.retry + +# type checkers +.mypy_cache/ +.dmypy.json +dmypy.json +.pyre/ +.pytype/ \ No newline at end of file diff --git a/devtools/gearbox/quickstart/template/+dot+hgignore_tmpl b/devtools/gearbox/quickstart/template/+dot+hgignore_tmpl new file mode 100644 index 0000000..ddc880c --- /dev/null +++ b/devtools/gearbox/quickstart/template/+dot+hgignore_tmpl @@ -0,0 +1,76 @@ +syntax: glob + +# Turbogears files +devdata.db + +# tgext.webassets (if plugged) +.webassets-cache +assets/ + +# depot (if used) +{{project}}/depot + +# python files +__pycache__/ +*.egg-info/ +*.pyc +*.pyo +*.pyd +.env +.venv +env/ +venv/ + +# tests +.coverage +.coverage.* +coverage.xml +cover/ +htmlcov/ +.pytest_cache/ +.tox/ +geckodriver.log + + +# i18n Translations +*.mo +*.pot + + +### editors, ide + +# emacs files +\#*\# +.\#* +*_flymake.* +flycheck_*.el +.dir-locals.el + +# intellij +.idea + +# vscode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace +.history/ + + +### other tools + +# vagrant files +.vagrant/ +*.log + +# ansible files +*.retry + +# type checkers +.mypy_cache/ +.dmypy.json +dmypy.json +.pyre/ +.pytype/ \ No newline at end of file diff --git a/devtools/gearbox/quickstart/template/setup.cfg_tmpl b/devtools/gearbox/quickstart/template/setup.cfg_tmpl index 18c6c53..1731f26 100755 --- a/devtools/gearbox/quickstart/template/setup.cfg_tmpl +++ b/devtools/gearbox/quickstart/template/setup.cfg_tmpl @@ -4,6 +4,7 @@ detailed-errors = 1 with-coverage = false cover-erase = true cover-package = {{package}} +#cover-min-percentage=100 # Babel configuration [compile_catalog]