February 9, 2010
Enablr : Bitbucket でのプロジェクトを初期化する

SubversionとGit/Githubも可能ですが、まだ完璧にテストしていません。

virtualenvを作る

hdknr@deblen:~$ mkvirtualenv twitq
New python executable in twitq/bin/python
Installing setuptools………………….done.

pipを入れる

(twitq)hdknr@deblen:~$ easy_install pip
Searching for pip
Reading http://pypi.python.org/simple/pip/
Reading http://pip.openplans.org
Best match: pip 0.6.3
Downloading http://pypi.python.org/packages/source/p/pip/pip-0.6.3.tar.gz#md5=0602fa9179cfaa98e41565d4a581d98c
Processing pip-0.6.3.tar.gz
Running pip-0.6.3/setup.py -q bdist_egg —dist-dir /tmp/easy_install-cY8Ghr/pip-0.6.3/egg-dist-tmp-AtENEu
warning: no previously-included files matching ‘*.txt’ found under directory ‘docs/_build’
no previously-included directories found matching ‘docs/_build/_sources’
warning: no files found matching ‘*’ under directory ‘scripts/completion’
zip_safe flag not set; analyzing archive contents…
pip.runner: module references __file__
pip.basecommand: module references __file__
pip.venv: module references __file__
pip.vcs.__init__: module references __file__
Adding pip 0.6.3 to easy-install.pth file
Installing pip script to /home/hdknr/.ve/twitq/bin Installed /home/hdknr/.ve/twitq/lib/python2.5/site-packages/pip-0.6.3-py2.5.egg
Processing dependencies for pip
Finished processing dependencies for pip

MySQLdbを入れておく

(twitq)hdknr@deblen:~$ easy_install mysql-python
Searching for mysql-python
Reading http://pypi.python.org/simple/mysql-python/
Reading http://sourceforge.net/projects/mysql-python
Best match: MySQL-python 1.2.3c1
Downloading http://pypi.python.org/packages/2.5/M/MySQL-python/MySQL_python-1.2.3c1-py2.5-linux-i686.egg#md5=1efcbed6f1f29acd50993f54109938d3
Processing MySQL_python-1.2.3c1-py2.5-linux-i686.egg
Moving MySQL_python-1.2.3c1-py2.5-linux-i686.egg to /home/hdknr/.ve/twitq/lib/python2.5/site-packages
Adding MySQL-python 1.2.3c1 to easy-install.pth file Installed /home/hdknr/.ve/twitq/lib/python2.5/site-packages/MySQL_python-1.2.3c1-py2.5-linux-i686.egg
Processing dependencies for mysql-python
Finished processing dependencies for mysql-python

(twitq)hdknr@deblen:~$ pip install yolk
Downloading/unpacking yolk
  Downloading yolk-0.4.1.tar.gz (80Kb): 80Kb downloaded
  Running setup.py egg_info for package yolk
Requirement already satisfied (use —upgrade to upgrade): setuptools in ./.ve/twitq/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg (from yolk)
Installing collected packages: yolk
  Running setup.py install for yolk
    Installing yolk script to /home/hdknr/.ve/twitq/bin
Successfully installed yolk

yolkも入れておく

(twitq)hdknr@deblen:~$ pip install yolk
Downloading/unpacking yolk
  Downloading yolk-0.4.1.tar.gz (80Kb): 80Kb downloaded
  Running setup.py egg_info for package yolk
Requirement already satisfied (use —upgrade to upgrade): setuptools in ./.ve/twitq/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg (from yolk)
Installing collected packages: yolk
  Running setup.py install for yolk
    Installing yolk script to /home/hdknr/.ve/twitq/bin
Successfully installed yolk

Djangoも入れておく

(twitq)hdknr@deblen:~$ pip install django
Downloading/unpacking django
  Downloading Django-1.1.1.tar.gz (5.6Mb): 5.6Mb downloaded
  Running setup.py egg_info for package django
Installing collected packages: django
  Running setup.py install for django
    changing mode of build/scripts-2.5/django-admin.py from 644 to 755
    changing mode of /home/hdknr/.ve/twitq/bin/django-admin.py to 755
Successfully installed django

Enablrを入れる

(twitq)hdknr@deblen:~$ pip install -e hg+ssh://hg@bitbucket.org/hdknr/enablr#egg=enablr
Obtaining enablr from hg+ssh://hg@bitbucket.org/hdknr/enablr#egg=enablr
  Cloning hg ssh://hg@bitbucket.org/hdknr/enablr to ./.ve/twitq/src/enablr
  Running setup.py egg_info for package enablr
    warning: no previously-included files matching ‘*~’ found anywhere in distribution
Downloading/unpacking pit (from enablr)
  Downloading pit-0.2.tar.gz
  Running setup.py egg_info for package pit
Downloading/unpacking pyYAML (from pit->enablr)
  Downloading PyYAML-3.09.tar.gz (238Kb): 238Kb downloaded
  Running setup.py egg_info for package pyYAML
Installing collected packages: enablr, pit, pyYAML
  Running setup.py develop for enablr
    warning: no previously-included files matching ‘*~’ found anywhere in distribution
    Creating /home/hdknr/.ve/twitq/lib/python2.5/site-packages/enablr.egg-link (link to .)
    Adding enablr 0.0.1 to easy-install.pth file

       Installed /home/hdknr/.ve/twitq/src/enablr
  Running setup.py install for pit
  Running setup.py install for pyYAML
    checking if libyaml is compilable
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c build/temp.linux-i686-2.5/check_libyaml.c -o build/temp.linux-i686-2.5/check_libyaml.o
    checking if libyaml is linkable
    gcc -pthread build/temp.linux-i686-2.5/check_libyaml.o -lyaml -o build/temp.linux-i686-2.5/check_libyaml
    building ‘_yaml’ extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c ext/_yaml.c -o build/temp.linux-i686-2.5/ext/_yaml.o
    ext/_yaml.c: In function ‘__pyx_pf_5_yaml_get_version_string’:
    ext/_yaml.c:1072: warning: assignment discards qualifiers from pointer target type
    ext/_yaml.c: In function ‘__pyx_pf_5_yaml_7CParser___init__’:
    ext/_yaml.c:1830: warning: passing argument 2 of ‘yaml_parser_set_input’ from incompatible pointer type
    ext/_yaml.c:2040: warning: pointer targets in passing argument 2 of ‘yaml_parser_set_input_string’ differ in signedness
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__token_to_object’:
    ext/_yaml.c:3465: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:3465: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:3478: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:3478: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:4045: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:4045: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:4099: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:4099: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:4153: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:4153: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:4166: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:4166: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:4253: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__event_to_object’:
    ext/_yaml.c:5716: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:5716: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:5729: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:5729: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:5899: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:5899: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:5974: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:5974: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:6011: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:6011: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:6027: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:6343: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:6343: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:6380: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:6380: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:6576: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:6576: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:6613: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:6613: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__compose_node’:
    ext/_yaml.c:7934: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:7934: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:8152: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:8152: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:8181: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:8181: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:8210: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:8210: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__compose_scalar_node’:
    ext/_yaml.c:8727: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c:8894: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:8894: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__compose_sequence_node’:
    ext/_yaml.c:9341: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:9341: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__compose_mapping_node’:
    ext/_yaml.c:9882: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    ext/_yaml.c:9882: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness
    ext/_yaml.c: In function ‘__pyx_pf_5_yaml_8CEmitter___init__’:
    ext/_yaml.c:10912: warning: passing argument 2 of ‘yaml_emitter_set_output’ from incompatible pointer type
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_8CEmitter__object_to_event’:
    ext/_yaml.c:12070: warning: pointer targets in assignment differ in signedness
    ext/_yaml.c:12182: warning: pointer targets in assignment differ in signedness
    ext/_yaml.c:12458: warning: pointer targets in passing argument 2 of ‘yaml_alias_event_initialize’ differ in signedness
    ext/_yaml.c:13112: warning: pointer targets in passing argument 2 of ‘yaml_scalar_event_initialize’ differ in signedness
    ext/_yaml.c:13112: warning: pointer targets in passing argument 3 of ‘yaml_scalar_event_initialize’ differ in signedness
    ext/_yaml.c:13112: warning: pointer targets in passing argument 4 of ‘yaml_scalar_event_initialize’ differ in signedness
    ext/_yaml.c:13490: warning: pointer targets in passing argument 2 of ‘yaml_sequence_start_event_initialize’ differ in signedness
    ext/_yaml.c:13490: warning: pointer targets in passing argument 3 of ‘yaml_sequence_start_event_initialize’ differ in signedness
    ext/_yaml.c:13868: warning: pointer targets in passing argument 2 of ‘yaml_mapping_start_event_initialize’ differ in signedness
    ext/_yaml.c:13868: warning: pointer targets in passing argument 3 of ‘yaml_mapping_start_event_initialize’ differ in signedness
    ext/_yaml.c: In function ‘__pyx_pf_5_yaml_8CEmitter_serialize’:
    ext/_yaml.c:15146: warning: pointer targets in assignment differ in signedness
    ext/_yaml.c:15258: warning: pointer targets in assignment differ in signedness
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_8CEmitter__serialize_node’:
    ext/_yaml.c:15955: warning: pointer targets in passing argument 2 of ‘yaml_alias_event_initialize’ differ in signedness
    ext/_yaml.c:16629: warning: pointer targets in passing argument 2 of ‘yaml_scalar_event_initialize’ differ in signedness
    ext/_yaml.c:16629: warning: pointer targets in passing argument 3 of ‘yaml_scalar_event_initialize’ differ in signedness
    ext/_yaml.c:16629: warning: pointer targets in passing argument 4 of ‘yaml_scalar_event_initialize’ differ in signedness
    ext/_yaml.c:16932: warning: pointer targets in passing argument 2 of ‘yaml_sequence_start_event_initialize’ differ in signedness
    ext/_yaml.c:16932: warning: pointer targets in passing argument 3 of ‘yaml_sequence_start_event_initialize’ differ in signedness
    ext/_yaml.c:17348: warning: pointer targets in passing argument 2 of ‘yaml_mapping_start_event_initialize’ differ in signedness
    ext/_yaml.c:17348: warning: pointer targets in passing argument 3 of ‘yaml_mapping_start_event_initialize’ differ in signedness
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-i686-2.5/ext/_yaml.o -lyaml -o build/lib.linux-i686-2.5/_yaml.so
Successfully installed enablr pit pyYAML

Pitでレポジトリ(Bitbucket)のアカウントを作成する。

(twitq)hdknr@deblen:~$ echo $EDITOR
vim

(twitq)hdknr@deblen:~$ python -c “from pit import Pit ; Pit.set(‘bitbucket’);” email: *******@hdknr.compassword: ***********
push: hg clone %(url)s
repository: hg
url: ssh://hg@bitbucket.org/%(username)s/%(package)s/
username: hdknr

Bitbucketにプロジェクトをつくる

作ったプロジェクトを”Enablr”する

(twitq)hdknr@deblen:~/.ve/twitq/src$ python -c “import enablr;enablr.enable(‘bitbucket’,’twiq’);”
checkouting … ssh://hg@bitbucket.org/hdknr/twiq/ to /home/hdknr/.ve/twitq/src/twiq
hg clone ssh://hg@bitbucket.org/hdknr/twiq/
destination directory: twiq
no changes found
updating working directory
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

hg -R /home/hdknr/.ve/twitq/src/twiq add /home/hdknr/.ve/twitq/src/twiq/*
adding twiq/twiq/__init__.py
hg -R /home/hdknr/.ve/twitq/src/twiq add /home/hdknr/.ve/twitq/src/twiq/.svnignore hg -R /home/hdknr/.ve/twitq/src/twiq add /home/hdknr/.ve/twitq/src/twiq/.hgignore

hg -R /home/hdknr/.ve/twitq/src/twiq commit -u hdknr -m “initialized” hg -R /home/hdknr/.ve/twitq/src/twiq push
pushing to ssh://hg@bitbucket.org/hdknr/twiq/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 7 changes to 7 files
remote: bb/acl: hdknr is allowed. accepted payload.
remote: quota: 8.3 MB in use, 150.0 MB available (5.55% used)
pip install -e hg+ssh://hg@bitbucket.org/hdknr/twiq/#egg=twiq
Obtaining twiq from hg+ssh://hg@bitbucket.org/hdknr/twiq/#egg=twiq
  Updating ./twiq clone
  Running setup.py egg_info for package twiq
    warning: no previously-included files matching ‘*~’ found anywhere in distribution
Installing collected packages: twiq
  Running setup.py develop for twiq
    warning: no previously-included files matching ‘*~’ found anywhere in distribution
    Creating /home/hdknr/.ve/twitq/lib/python2.5/site-packages/twiq.egg-link (link to .)
    Adding twiq 0.0.1 to easy-install.pth file

       Installed /home/hdknr/.ve/twitq/src/twiq
Successfully installed twiq

Bitbucketのソースを確認


ディレクトリツリーはこんな感じ

(twitq)hdknr@deblen:~/.ve/twitq/src$ tree 
.
|-- enablr
|   |-- LICENSE
|   |-- MANIFEST.in
|   |-- README.rst
|   |-- enablr
|   |   |-- __init__.py
|   |   `-- __init__.pyc
|   |-- enablr.egg-info
|   |   |-- PKG-INFO
|   |   |-- SOURCES.txt
|   |   |-- dependency_links.txt
|   |   |-- not-zip-safe
|   |   |-- requires.txt
|   |   `-- top_level.txt
|   `-- setup.py
`-- twiq
    |-- LICENSE
    |-- MANIFEST.in
    |-- README.rst
    |-- setup.py
    |-- twiq
    |   `-- __init__.py
    `-- twiq.egg-info
        |-- PKG-INFO
        |-- SOURCES.txt
        |-- dependency_links.txt
        |-- not-zip-safe
        `-- top_level.txt
 6 directories, 22 files
そうすると、同じvirtualenvで別プロジェクトから今作ったtwiqをimport できて、かつtwiqも同時進行で開発できる。

Posted via email from 原宿工業大学 | Comment »

December 14, 2009
Enablr: virtualenvのプロジェクト初期化を作ってみる(1)

http://bitbucket.org/hdknr/enablr/ をCreate New (zn)hdknr@deblen:~/.ve/zn/src$ hg clone ssh://hg@bitbucket.org/hdknr/enablr/destination directory: enablr
no changes found
updating working directory
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

(zn)hdknr@deblen:~/.ve/zn/src/enablr$ curl http://code.hdknr.com/virtualenv/scaffold/.template/LICENSE.mit > LICENSE
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1065  100  1065    0     0   5522      0 —:—:— —:—:— —:—:—     0 (zn)hdknr@deblen:~/.ve/zn/src/enablr$ vi LICENSE

適当に編集。 (zn)hdknr@deblen:~/.ve/zn/src/enablr$ vi README.rst

適当に編集。
(zn)hdknr@deblen:~/.ve/zn/src/enablr$ curl http://code.hdknr.com/virtualenv/scaffold/MANIFEST.in > MANIFEST.in  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    66    0    66    0     0    355      0 —:—:— —:—:— —:—:—     0

(zn)hdknr@deblen:~/.ve/zn/src/enablr$ curl http://code.hdknr.com/virtualenv/scaffold/setup.py > setup.py  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   381  100   381    0     0   2115      0 —:—:— —:—:— —:—:—     0 (zn)hdknr@deblen:~/.ve/zn/src/enablr$ vi setup.py
適当に編集。

(zn)hdknr@deblen:~/.ve/zn/src/enablr$ svn export http://code.hdknr.com/virtualenv/scaffold/hoge enablr
A    enablr
A    enablr/views.py
A    enablr/__init__.py
リビジョン 440 をエクスポートしました。 (zn)hdknr@deblen:~/.ve/zn/src/enablr$ rm enablr/views.py

(zn)hdknr@deblen:~/.ve/zn/src/enablr$ cp ../flickrapi/.hgignore  .

(zn)hdknr@deblen:~/.ve/zn/src/enablr$ hg add *
adding enablr/__init__.py (zn)hdknr@deblen:~/.ve/zn/src/enablr$ hg add .hgignore
(zn)hdknr@deblen:~/.ve/zn/src/enablr$ hg status
A .hgignore
A LICENSE
A MANIFEST.in
A README.rst
A enablr/__init__.py
A setup.py

(zn)hdknr@deblen:~/.ve/zn/src/enablr$ hg commit -u hdknr -m “initial files”
(zn)hdknr@deblen:~/.ve/zn/src/enablr$ hg push
pushing to ssh://hg@bitbucket.org/hdknr/enablr/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 6 changes to 6 files
remote: bb/acl: hdknr is allowed. accepted payload.
remote: quota: 8.3 MB in use, 150.0 MB available (5.51% used)

とりあえずこれで開発してみる。

Posted via email from hdknr’s posterous | Comment »