Skip to main content

Posts

Showing posts with the label buildout

My Python Workflow

This is basically what I did whenever starting on new Python project. mkdir project_name cd project_name wget https://bootstrap.pypa.io/bootstrap-buildout.py vim buildout.cfg Where my buildout.cfg look like:- [buildout] parts = main [main] recipe = zc.recipe.egg eggs = python-telegram-bot interpreter = python Then I just execute the following to get my new python environment initialize:- python bootstrap.py ./bin/buildout A python interpreter that already has access to my packages dependencies - in this case python-telegram-bot is ready in ./bin/python . I'm a fan of buildout and shall write more about it in later post.

Buildout custom Python interpreter

Menggunakan Buildout , kita boleh generate custom Python interpreter khusus untuk kegunaan projek buildout ini dengan sys.path disetkan kepada eggs dalam projek ini. Berikut contoh buildout.cfg yang digunakan:- [buildout] newest = false parts = pylons python find-links = http://pylonshq.com/download/0.9.7 develop = . [python] recipe = zc.recipe.egg interpreter = python [pylons] recipe = zc.recipe.egg eggs = nose>=0.11.1 Paste>=1.7.2 PasteScript>=1.7.3 PasteDeploy>=1.3.3 Pylons==0.9.7 SQLAlchemy==0.5.5 Jinja2==2.1.1 Tapi apabila run, dapat error:- We have no distributions for python that satisfies 'python'. Getting distribution for 'python'. We have a develop egg: setuptools 0.6c9 Running easy_install: /usr/bin/python "-c" "from setuptools.command.easy_install import main; main()" "-mUNxd" "/home/kamal/webapps/clinic-pylons/eggs/tmpflXKv-" "-q" "/usr/lib/python2.5/lib-dynload...