* COMMENT -*- mode: org -*-
#+Date: 2014-05-09
Time-stamp: <2016-09-08>
#+STARTUP: content
* current							      :entry:
** 
** 2016-09-08 support updating site file, deb scripts etc after project is generated.
- the domain in site file could change.
- the pkg name could change.
- whether to use uwsgi could change.

./utils/update_site_file.py --domain foo.emacsos.com --uwsgi
./utils/update_site_file.py --domain foo.emacsos.com --http

** 2016-09-06 support adding celery to existing project.
- This will add a celeryconfig module and a tasks module.
  see examples in
  ~/projects/wechat-article-saver/wechat_article_saver_daemon/wechat_article_saver_daemon/celeryconfig.py
  ~/projects/wechat-article-saver/wechat_article_saver_daemon/wechat_article_saver_daemon/fetcher.py
- I don't know how to call lein from existing project yet.
  shouldn't be so hard.

** 2016-08-18 integrate tox.
let "make test" use the default python in venv, but allow "make tox" to run
unit tests against defined python in tox.ini.

** 2016-08-07 in python project template, add a project wide pylintrc file.
see example ~/.pylintrc
** 2016-07-27 package name should not have -, auto convert it to _.
- package name is part of module name, - is not valid there.

** 2016-06-30 update it for use with default debian config. (non-yy env)
- update nginx config file
- add support for systemd
- create /data if it doesn't exist. auto use sudo to create the dir if it
  doesn't exist.

  make sure it works on fresh system. use a VM to test it.
** 2014-05-09 add sphinx support
* later								      :entry:
* done								      :entry:
** 2016-09-08 when bootstrap, create /var/log/{{name}} dir using sudo and chown to current user.
this makes it easier when developing.

- just add it in bootstrap-dev.

** DONE 2016-09-08 integrate sanity-check
- update yygame-utils pkg version
- in Makefile
 check: just-test
+sanity-check:
+	$(PYTHON) wechat_article_saver_daemon/sanity_check.py
 check-coding-style: bootstrap-dev

- add the template with a dumb check.

** DONE 2016-06-30 make "lein new python bar" work, without --to-dir .
chmod -R +x utils/

- this is not run on project root dir.

  I see there is a "shell/with-sh-dir *dir*", check what is *dir*.

  search: leiningen new *dir* target dir

  leiningen.new.templates reference
  https://github.com/technomancy/leiningen/blob/master/src/leiningen/new/templates.clj
  it's either pwd or ->files file's path.

  seems it's not the target project dir.

- check how --to-dir work.
  https://github.com/technomancy/leiningen/blob/master/src/leiningen/new.clj

  I think it could be nil when --to-dir is not used.
  yes. it's null when user doesn't use --to-dir option.

** DONE 2016-06-30 use python3 in venv by default.
- make old code work with python3.
  - add future imports

    from __future__ import (absolute_import, division, print_function,
                            unicode_literals)

  - pylint fails.

- fallback to python2 if python3 is NA.
  test it on both py2 and py3.

** DONE 2016-06-30 put venv in .venv dir.
- DONE update Makefile
- DONE update ./utils/bootstrap
  use a variable in template.

  no. move bootstrap inside Makefile.

  I will create it from scratch. Just use the old files.

  a recent copy of Makefile is at 

  find /home/sylecn/python/ -name Makefile -mtime -7
  find /home/sylecn/projects/ -name Makefile -mtime -30

  /home/sylecn/projects/molecules/pbsa_jisuan/Makefile
  /home/sylecn/projects/qvm/Makefile
  /home/sylecn/projects/spider/src/python-prototyping/Makefile

  locater '\.venv$'
  DONE /home/sylecn/office/yxy/emeter-elavator-reports/.venv    // also this.
  /home/sylecn/projects/webframework-simple-benchmark/.venv
  DONE /home/sylecn/python/questionsdb/.venv    // also this.
  DONE /home/sylecn/websites/url-alias/.venv    // this is the one I'm looking for.

  - bootstrap. can I use late binding variable to make bootstrap and
    bootstrap-dev work?

    Can I just set a variable and invoke make a 2nd time on a shared target
    that uses that variable?

    well, just define a function in Makefile, pass in parameters.

  - INFO function is a very confusing concept in Makefile.

    the call function
    https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_8.html#SEC81
    This macro simply reverses its arguments:
    reverse = $(2) $(1)
    // and where is macro documented, it also looks like a function.
    Defining Canned Command Sequences
    https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_5.html#SEC55

- DONE can "python3 -m venv" replace virtualenv? no. it can only create venv
  for the python that is being run.

  just use the embedded virtualenv.

- DONE upgrade virtualenv and pip.
  virtualenv 15.0.2, pip 8.1.2 included.
  https://pypi.python.org/pypi/virtualenv
  curl -O https://pypi.python.org/packages/5c/79/5dae7494b9f5ed061cff9a8ab8d6e1f02db352f3facf907d9eb614fb80e9/virtualenv-15.0.2.tar.gz#md5=0ed59863994daf1292827ffdbba80a63

  1.8M tar.gz file.
  old dir: 1.7M
  new dir: 2.1M
  removed some files, down to 1.9M.

- test it now.
  v0.7.0 updated virtualenv, use Makefile do bootstrap, use python3 by default.

- it requires me listing all template and plain files. this is bad. should
  just generate the file list on the fly.

