たろマーク (はてなブックマーク)
-
[ api ][ phone ][ webservice ]
- Colorful Bokeh Effect in Pixelmator | Abduzeedo | Graphic Design Inspiration and Photoshop Tutorials
[ pixelmator ] -
[ pixelmator ]
-
[ python ] 結構ボリュームあるw python のみならず、チームの開発サイクルとか、実際にどう活用していくかと言うことが書いてありそうで wktk
■ setup.py に書いた依存関係を PyPI からインストールする
paster コマンドで、新規にプロジェクトを作成する。エキスパート Python プログラミングに習うと、さっきの virtualenv で作った環境に packages というディレクトリを作って、その中で新しく作るのがいいみたい。
$ mkdir packages
$ cd packages
$ paster create -t pbp_package atomisator.parser
/usr/local/bin/paster:5: UserWarning: Module zope was already imported from None, but /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python is being added to sys.path
from pkg_resources import load_entry_point
Selected and implied templates:
pbp.skels#pbp_package A namespaced package
Variables:
egg: atomisator.parser
package: atomisatorparser
project: atomisator.parser
Enter namespace_package (Namespace package (like pbp)) ['pbp']: atomisator
Enter package (The package contained namespace package (like example)) ['example']: parser
Enter version (Version) ['0.1.0']:
Enter description (One-line description of the package) ['']:
Enter long_description (Multi-line description (in reST)) ['']:
Enter author (Author name) ['']:
Enter author_email (Author email) ['']:
Enter keywords (Space-separated keywords/tags) ['']:
Enter url (URL of homepage) ['']:
Enter license_name (License name) ['GPL']:
Enter zip_safe (True/False: if the package can be distributed as a .zip file) [False]:
Creating template pbp_package
Creating directory ./atomisator.parser
Recursing into +namespace_package+
Creating ./atomisator.parser/atomisator/
Recursing into +package+
Creating ./atomisator.parser/atomisator/parser/
Copying README.txt to ./atomisator.parser/atomisator/parser/README.txt
Copying __init__.py_tmpl to ./atomisator.parser/atomisator/parser/__init__.py
Copying __init__.py_tmpl to ./atomisator.parser/atomisator/__init__.py
Copying setup.py_tmpl to ./atomisator.parser/setup.py
Running /usr/bin/python setup.py egg_info
$ cd atomisator.parser
paster で使っている pbp_package は、PyPI に pbp.skels と言うパッケージ名でアップロードされてるので、pip install pbp.skels した。
んで、atomisator.parser にできた setup.py の install_requires に依存している PyPI パッケージを書く。
install_requires=[
'setuptools',
'feedparser', # <= 追加した
# -*- Extra requirements: -*-
],
その後、python setup.py develop を実行すると、feedparser が install される。
このとき使う python は virtualenv で用意した python の方。エキスパート python だと、/usr/bin/atomisator-python に symlink 張って、atomisator-python を実行してる。
エキスパートPythonプログラミング
posted with amazlet at 11.02.20
Tarek Ziade
アスキー・メディアワークス
売り上げランキング: 9716
アスキー・メディアワークス
売り上げランキング: 9716







